通过 Powershell Runbook 从 ARM 模板部署 Azure VM,无需下载模板

Deploy an Azrue VM from an ARM template via Powershell Runbook without downloading template

This 文章介绍了如何在 Powershell Runbook 中从 ARM 模板部署一些资源的教程。据我了解,它将在特定路径中下载模板和参数文件。但是,在没有任何直接附加存储到自动化帐户的情况下,它如何在自动化 Runbook 中工作。显然,我误会了什么...

我的意思是 Get-AzureStorageFileContent 命令:

# Create a new context
$Context = New-AzureStorageContext -StorageAccountName $StorageAccountName - 
StorageAccountKey $StorageAccountKey

Get-AzureStorageFileContent -ShareName 'resource-templates' -Context 
$Context -path 'TemplateTest.json' -Destination 'C:\Temp'

$TemplateFile = Join-Path -Path 'C:\Temp' -ChildPath $StorageFileName

# Deploy the storage account
New-AzureRmResourceGroupDeployment -ResourceGroupName $ResourceGroupName - 
TemplateFile $TemplateFile -TemplateParameterObject $Parameters

你知道怎么理解这个吗,或者有什么更好的方法可以达到目的吗?

您可以使用 -TemplateParameterUri-TemplateUri 并提供存储模板的公开可用网址。