2017-02-17 124 views
-1

我有ARM部署模板,其中包含与DSC扩展虚拟机资源ARM部署失败不正确的DSC扩展模板错误

"resources": [ 
     { 
      "name": "Microsoft.Powershell.DSC", 
      "type": "extensions", 
      "location": "[resourceGroup().location]", 
      "apiVersion": "2015-06-15", 
      "dependsOn": [ 
      "[resourceId('Microsoft.Compute/virtualMachines', parameters('appVMName'))]" 
      ], 
      "tags": { 
      "displayName": "appDSC" 
      }, 
      "properties": { 
      "publisher": "Microsoft.Powershell", 
      "type": "DSC", 
      "typeHandlerVersion": "2.9", 
      "autoUpgradeMinorVersion": true, 
      "forceUpdateTag": "[parameters('appDSCUpdateTagVersion')]", 
        "settings": { 
         "configuration": { 
          "url": "[parameters('dscArchiveUrl')]", 
          "script": "appDSC.ps1", 
          "function": "Main" 
         }, 
        "configurationArguments": { 
         "nodeName": "[parameters('appVMName')]", 
         "webDeployPackage": "[parameters('appWebPackage')]", 
         "backgroundServicePackage": "[parameters('backgroundServicePackage')]" 
        } 
      } 
      } 
     } 
     ] 

我设法让这项工作我第一次执行,但现在它响应错误:

15:37:17 - Resource Microsoft.Compute/virtualMachines 'Unique-InApp' failed with message '{ 
    "status": "Failed", 
    "error": { 
    "code": "ResourceDeploymentFailure", 
    "message": "The resource operation completed with terminal provisioning state 'Failed'.", 
    "details": [ 
     { 
     "code": "VMExtensionProvisioningError", 
     "message": "VM has reported a failure when processing extension 'Microsoft.Powershell.DSC'. Error message: \"The 
DSC Extension received an incorrect input: Configuration.url requires that configuration.script is specified.\nPlease c 
orrect the input and retry executing the extension.\"." 
     } 
    ] 
    } 
}' 

正如你所看到的,我明明把scriptconfiguration,但由于某种原因它不是由ARM部署脚本的认可。 我想,这只是错误的错误信息,我有不同的问题,但没有正确的诊断信息,我无法理解它。 那么问题是怎么解决的?

+1

你为什么要使用2.9版本的任何原因? latets是2.22 ...你试过卸载扩展,然后重新部署? – Kiran

+0

它帮助,谢谢 – Sovent

+0

它不可能帮助,有autoupgrademinorversion标志设置为true @Kiran – 4c74356b41

回答

0

看着this的例子和在schema好像你在做错了。

我看不到DSC扩展scriptfunction性质,代替我看到configurationFunction属性,据称采用类似于此的值:

ContosoWebsite.ps1\\ContosoWebsite 

第二斜线用于转义的第一个;)

+0

问题仍然存在,即使在我更改了模板之后仍然存在相同的错误: '“modulesUrl”:“[parameters('dscArchiveUrl')]”' ''configurationFunction“ :“appDSC.ps1 \\ Main”' – Sovent

+0

我建议你把现有的quickstart模板与我联系起来,并用它测试你的dsc扩展名。 – 4c74356b41

+0

我不需要这个快速启动模板来工作,我需要用我的模板部署我的应用程序。无论这个快速入门产生什么结果,它都不会帮助我解决我的问题。 – Sovent

相关问题