跳过模板输出评估
Template output evaluation skipped
如果我尝试部署我的 arm 模板(类似这样的东西)
{
"$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 后面的总是相同的)。
如果我尝试部署我的 arm 模板(类似这样的东西)
{
"$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 后面的总是相同的)。