【问题标题】:Deploy an Azrue VM from an ARM template via Powershell Runbook without downloading template通过 Powershell Runbook 从 ARM 模板部署 Azure VM,无需下载模板
【发布时间】:2019-03-11 14:52:15
【问题描述】:

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

你知道如何理解这一点,或者有没有更好的方法来达到目标​​?

【问题讨论】:

    标签: azure powershell templates arm runbook


    【解决方案1】:

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

    【讨论】:

    • 这些参数似乎解决了我的问题。不幸的是,我在 Azure 存储中的模板的 Uri 不起作用。我是否必须提供文件的原始链接,或者就像在本文中一样 (docs.microsoft.com/en-us/azure/azure-resource-manager/…) 好吧,我都试过了,没有人工作,所以我的问题还没有解决。
    • 这是一个不同的问题。我建议你接受这个答案并提出一个新问题
    猜你喜欢
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2019-02-11
    • 2020-06-13
    • 2019-08-02
    • 2020-09-28
    • 2019-06-29
    相关资源
    最近更新 更多