执行从Azure生成的自动脚本时出错

时间:2017-07-16 12:12:50

标签: azure routes iot servicebus endpoints

我正在尝试执行从Azure为iothub端点生成的自动脚本,但是出现以下错误:

static_assert

请在下面找到模板文件的代码:

New-AzureRmResourceGroupDeployment : 12:25:25 AM - Error: 
Code=InvalidTemplate; Message=Deployment template validation failed: 'The 
template resource 'ServiceBus1/Topic1/iothubroutes_tst-IOTHUB' at line '216' 
and column '10' is not valid: Unable to evaluate template language function 
'resourceId': function requires exactly one multi-segmented argument which 
must be resource type including resource provider namespace. Current function 
arguments 'Microsoft.ServiceBus/namespaces/topics,ServiceBus1/Topic1'. Please 
see https://aka.ms/arm-template-expressions/#resourceid for usage details.. 
Please see https://aka.ms/arm-template-expressions for usage details.'.
At C:\Users\user\Desktop\testEndpoints\CIMS-ResourceGrp\deplo
y.ps1:104 char:5
+     New-AzureRmResourceGroupDeployment -ResourceGroupName $resourceGr ...
+     ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
    + CategoryInfo          : NotSpecified: (:) [New-AzureRmResourceGroupDeplo 
   yment], Exception
    + FullyQualifiedErrorId : Microsoft.Azure.Commands.ResourceManager.Cmdlets 
   .Implementation.NewAzureResourceGroupDeploymentCmdlet

1 个答案:

答案 0 :(得分:0)

建议不要直接部署从Azure门户生成的ARM模板。由于您从Azure门户复制的ARM模板将包含当前资源组中的所有资源,因此部分资源无法导出到模板。

要使用Azure Resource Manager模板创建IoT中心,建议您使用以下文章中包含的模板。

Create an IoT hub using Azure Resource Manager template (PowerShell)