powershell - Can't Add Azure DSC Extension to VM in ARM mode -


i need create vm based on image (sql server 2016 on windows server 2016) , add dsc extension powershell. have template.json , it's parameters.json files saved when creating vm(sql2016 server on windows 2016 server) in portal(in parameters file define url published sdc zip , admin password). zip file withconfiguration located on github public repository. , created powershell publish commandlet. after next steps are:

login-azurermaccount # create resource group new-azurermresourcegroup -name orsql1 -location 'north europe' # succeed  # define deployment variables $deployment = @{     resourcegroupname = 'orsqllast';     mode = 'complete';     templatefile = 'template.json';     templateparameterfile = 'parameters.json';     force = $true; } new-azurermresourcegroupdeployment @deployment  -deploymentdebugloglevel 

dsc1.ps1 contents:

configuration iisinstall {     node ("localhost")     {         windowsfeature iis         {             ensure = "present"             name = "web-server"         }     } } 

after lot of time errors:

new-azurermresourcegroupdeployment : 14:02:10 - resource microsoft.resources/deployments 'microsoft.dsc-20161 010122604' failed message '{   "status": "failed",   "error": {     "code": "resourcedeploymentfailure",     "message": "the resource operation completed terminal provisioning state 'failed'.",     "details": [       {         "code": "deploymentfailed",         "message": "at least 1 resource deployment operation failed. please list deployment operations  details. please see https://aka.ms/arm-debug usage details.",         "details": [           {             "code": "conflict",             "message": "{\r\n  \"status\": \"failed\",\r\n  \"error\": {\r\n    \"code\": \"resourcedeploymen tfailure\",\r\n    \"message\": \"the resource operation completed terminal provisioning state 'failed'. \",\r\n    \"details\": [\r\n      {\r\n        \"code\": \"vmextensionprovisioningerror\",\r\n        \"mess age\": \"vm has reported failure when processing extension 'microsoft.powershell.dsc'. error message: \\\"e rror unpacking 'dsc1.ps1.zip'; verify valid zip package.\\nerror details: exception calling \\\"ext racttodirectory\\\" \\\"2\\\" argument(s): \\\"end of central directory record not found.\\\"\\ \".\"\r\n      }\r\n    ]\r\n  }\r\n}"           }         ]       }     ]   } }' @ line:14 char:1 + new-azurermresourcegroupdeployment @deployment  -deploymentdebuglogle ... + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~     + categoryinfo          : notspecified: (:) [new-azurermresourcegroupdeployment], exception     + fullyqualifiederrorid : microsoft.azure.commands.resourcemanager.cmdlets.implementation.newazureresour     cegroupdeploymentcmdlet  new-azurermresourcegroupdeployment : 14:02:10 - @ least 1 resource deployment operation failed. please lis t deployment operations details. please see https://aka.ms/arm-debug usage details. @ line:14 char:1 + new-azurermresourcegroupdeployment @deployment  -deploymentdebuglogle ... + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~     + categoryinfo          : notspecified: (:) [new-azurermresourcegroupdeployment], exception     + fullyqualifiederrorid : microsoft.azure.commands.resourcemanager.cmdlets.implementation.newazureresour     cegroupdeploymentcmdlet  new-azurermresourcegroupdeployment : 14:02:10 - template output evaluation skipped: @ least 1 resource dep loyment operation failed. please list deployment operations details. please see https://aka.ms/arm-debug  usage details. @ line:14 char:1 + new-azurermresourcegroupdeployment @deployment  -deploymentdebuglogle ... + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~     + categoryinfo          : notspecified: (:) [new-azurermresourcegroupdeployment], exception     + fullyqualifiederrorid : microsoft.azure.commands.resourcemanager.cmdlets.implementation.newazureresour     cegroupdeploymentcmdlet  new-azurermresourcegroupdeployment : 14:02:10 - template output evaluation skipped: @ least 1 resource dep loyment operation failed. please list deployment operations details. please see https://aka.ms/arm-debug  usage details. @ line:14 char:1 + new-azurermresourcegroupdeployment @deployment  -deploymentdebuglogle ... + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~     + categoryinfo          : notspecified: (:) [new-azurermresourcegroupdeployment], exception     + fullyqualifiederrorid : microsoft.azure.commands.resourcemanager.cmdlets.implementation.newazureresour     cegroupdeploymentcmdlet 

the zip valid , use anouther 1 - same error. part of parameters.json

"ex0_vmname": { "value": "node1" }, "ex0_location": { "value": "northeurope" }, "ex0_modulesurl": { "value": "https://github.com/myname/mydsc/blob/master/dsc1.ps1.zip" }, "ex0_configurationfunction": { "value": "dsc1.ps1\\iisinstall" }, "ex0_wmfversion": { "value": "latest" }, "ex0_privacy": { "value": "enable" }, "ex0_version": { "value": "2.8" } 

i suggest consult logs in vm in c:\windowsazure\logs. under c:\extensions (now c:\packages\plugins) can find zip package , dsc extension files.

the easiest way troubleshoot create dsc extension using portal. if fails same error want recreate zip file. i've had same errors zip package , solved them recreating it.

i suggest move azure automation. depending on scope, might okay 500 free minutes monthly , can upload mof's azure automation. , i've found azure automation more consistent dsc extension.


Comments

Popular posts from this blog

aws api gateway - SerializationException in posting new Records via Dynamodb Proxy Service in API -

asp.net - Problems sending emails from forum -