Azure / Azure/azure-quickstart-templates

Problems deploying DSC Extension for Azure Resource Manager template

Open
#3,605 1 comment 0 reactions 0 assignees View on GitHub
Dominant language
Bicep
Stars
14.9k
Forks
16.2k
Avg merge
6d 21h
Merged PRs (30d)
6

Description

I'm trying to deploy the Azure Resource Manager template for Windows Virtual Machines' provisioning.

Currently, I'm bootstrapping the IIS Powershell script to the DSC Module to set up IIS for a Windows virtual machine provisioned through ARM.

I keep getting this error related to WinRM:

```
New-AzureRmResourceGroupDeployment : 5:04:53 PM - Resource Microsoft.Compute/virtualMachines/extensions 'vmSVX-TESTAU-SQL1/dscExtension' 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 'dscExtension'. Error message: \"DSC Configuration 'vmDSC' completed with error(s).
Following are the first few: The WinRM client cannot process the request. If the authentication scheme is different from Kerberos, or if the client computer is not joined to a domain, then HTTPS transport must be used or the destination machine must be added to the TrustedHosts configuration setting. Use winrm.cmd to
configure TrustedHosts. Note that computers in the TrustedHosts list might not be authenticated. You can get more information about that by running the following command: winrm help config.\"."
}
]
}
}'
```

The ARM Template related to the provisioning of this VM:

```
{
"apiVersion": "2016-03-30",
"type": "Microsoft.Compute/virtualMachines/extensions",
"name": "[concat(variables('vmNameSQL'), '/', 'dscExtension')]",
"location": "[variables('location')]",
"dependsOn": [
"[concat('Microsoft.Compute/virtualMachines/', variables('vmNameSQL'))]"
],
"properties": {
"publisher": "Microsoft.Powershell",
"type": "DSC",
"typeHandlerVersion": "2.9",
"autoUpgradeMinorVersion": true,
"settings": {
"configuration": {
"url": "[variables('dscModulesUrl')]",
"script": "[concat(variables('dscFunction'),'.ps1')]",
"function": "[variables('dscFunction')]"
},
"configurationArguments": {
"nodeName": "[variables('vmNameSQL')]"
}
},
"protectedSettings": {
"configurationUrlSasToken": "[parameters('_artifactsLocationSasToken')]"
}
}
}
```

As for the IIS powershell script that has been bootstrapped:

```
Configuration WindowsFeatures
{
param ([string[]]$NodeName = 'localhost')

Node $NodeName
{
#Install the IIS Role
WindowsFeature IIS
{
Ensure = “Present”
Name = “Web-Server”
}

}
}
```

Contributor guide

No contributing guide indexed for this repository

Research direction

Start with the Microsoft.Compute/virtualMachines/extensions ARM resource and the WindowsFeatures DSC PowerShell script shown in the issue. Reproduce the deployment and inspect the DSC extension's WinRM error; done means the DSC extension provisions the Windows VM successfully without the reported failure.

Written by the indexing model from the issue text.

Assessment

Tech stack
azure, powershell
Domain
cloud, infrastructure
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Needs clarification
Newbie friendliness
25/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.