我正在尝试使用 Azure 蓝图工件中的嵌套模板将主题部署到 Azure 服务总线。此总线是在与蓝图的其余部分不同的订阅中创建的。我一直在关注这篇文章:https ://docs.microsoft.com/en-us/azure/azure-resource-manager/resource-manager-cross-resource-group-deployment
我的工件定义为:
{
"kind": "template",
"properties": {
"template": {
"$schema": "https://schema.management.azure.com/schemas/2015-01-01/deploymentTemplate.json#",
"contentVersion": "1.0.0.0",
"parameters": {
"servicebusNamespace": {
"type": "string"
},
"topicName": {
"type": "string"
}
},
"resources": [
{
"apiVersion": "2019-05-01",
"name": "nestedTemplate",
"type": "Microsoft.Resources/deployments",
"resourceGroup": "myResourceGroup",
"subscriptionId": "mySubscriptionId",
"properties": {
"mode": "Incremental",
"template": {
"$schema": "https://schema.management.azure.com/schemas/2015-01-01/deploymentTemplate.json#",
"contentVersion": "1.0.0.0",
"parameters": {},
"variables": {},
"resources": [
{
"type": "Microsoft.ServiceBus/namespaces/topics",
"apiVersion": "2017-04-01",
"name": "[concat(parameters('servicebusNamespace'), '/', parameters('topicName'))]",
"location": "North Europe",
"properties": {
"defaultMessageTimeToLive": "P14D",
"maxSizeInMegabytes": 1024,
"requiresDuplicateDetection": false,
"duplicateDetectionHistoryTimeWindow": "PT10M",
"enableBatchedOperations": true,
"status": "Active",
"supportOrdering": true,
"autoDeleteOnIdle": "P10675199DT2H48M5.4775807S",
"enablePartitioning": false,
"enableExpress": false
}
}
]
},
"parameters": {}
}
}
]
},
"parameters": {
"servicebusNamespace": {
"value": "[parameters('BP_servicebusNamespace')]"
},
"topicName": {
"value": "[parameters('BP_topicName')]"
}
}
},
"type": "Microsoft.Blueprint/blueprints/artifacts"
}
使用导入蓝图时Import-AzBlueprintWithArtifact -Name $blueprintName -ManagementGroupId $managementGroupId -InputPath $blueprintFolder -Force
收到以下错误:
“错误!此工件无效。错误:'13' 行和'5' 列的模板资源'nestedTemplate' 无效。订阅范围内的部署内的嵌套部署不支持'SubscriptionId' 属性。请参阅https ://aka.ms/arm-template/#resources了解使用详情。'"