通过powershell导入Azure自动化模块

时间:2017-05-19 10:13:40

标签: powershell azure msbuild azure-automation

我可以通过ARM和Portal上传和使用自动化模块。我想通过powershell上传模块。这可能吗?

我的目标是通过我们的构建服务器将自定义模块上传到azure自动化。使用ARM或PowerShell将模块从构建服务器上传到azure是否更好?

1 个答案:

答案 0 :(得分:3)

使用powershell,非常简单:

New-AzureRmAutomationModule -ResourceGroupName  $rgName -AutomationAccountName $name -Name $moduleName -ContentLink $moduleUrl

取自cmdlet的帮助:

The New-AzureRmAutomationModule cmdlet imports a module into Azure Automation. This command accepts a compressed file that has a .zip file
name extension. The file contains a folder that includes a file that is one of the following types:

- wps_2 module, which has a .psm1 or .dll file name extension

- wps_2 module manifest, which has a .psd1 file name extension


The name of the .zip file, the name of the folder, and the name of the file in the folder must be the same.

Specify the .zip file as a URL that the Automation service can access.