如果我尝试部署我的手臂模板(类似这样)
{
"$schema": "https://schema.management.azure.com/schemas/2015-01-01/deploymentTemplate.json#",
"contentVersion": "1.0.0.0",
"parameters": {},
"variables": {
"AAS": "TestAAS",
"AFU": "TestAFU",
},
"resources": [
//define some resource here
],
"outputs": {
"asName": {
"type": "string",
"value": "[variables('AAS')]"
},
"azureFunctionName": {
"type": "string",
"value": "[variables('AFU')]"
}}
}
如果出于任何原因运行不正常,我将无法在Powershell中读取输出。我收到以下消息:
Template output evaluation skipped: at least one resource deployment operation failed. Please list deployment operations for details
我应该怎么做,以便在执行错误的情况下将输出参数传递到powershell脚本中
我的Powershell代码:
//Standard PowerShell code for Deploying ARM Template
try
{
Stop-AzureRmWebApp -ResourceGroupName $ResourceGroupName -Name $deployment.Outputs.item("AFU").value
Suspend-AzureRmAnalysisServicesServer -Name $deployment.Outputs.item("AAS").value -ResourceGroupName $ResourceGroupName
}
catch
{
Write-Host "error here"
}
您在这里什么也不能做。仅当ARM模板流中没有错误时才生成输出。因此,您需要成功使用ARM模板才能检索到这些模板(无论使用哪种工具,这些模板背后的API始终相同)。