【发布时间】:2017-05-19 10:13:40
【问题描述】:
我能够通过 ARM 和 Portal 上传和使用自动化模块。我想通过 powershell 上传模块。这可能吗?
我的目标是通过我们的构建服务器将自定义模块上传到 azure 自动化。使用 ARM 或 powershell 将模块从构建服务器上传到 azure 更好吗?
【问题讨论】:
标签: powershell azure msbuild azure-automation
我能够通过 ARM 和 Portal 上传和使用自动化模块。我想通过 powershell 上传模块。这可能吗?
我的目标是通过我们的构建服务器将自定义模块上传到 azure 自动化。使用 ARM 或 powershell 将模块从构建服务器上传到 azure 更好吗?
【问题讨论】:
标签: powershell azure msbuild azure-automation
只需使用 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.
【讨论】: