Which of these is correct?
The first two examples use this schema:
"settings" : {
"protectedSettings": {},
"publicSettings": {}
}
But then the rest of the document uses:
"settings" : {},
"protectedSettings": {}
⚠Do not edit this section. It is required for docs.microsoft.com ➟ GitHub issue linking.
@mjcarrabine Thanks for the question! We are investigating and will update you shortly.
It depends on what you are putting into the brackets.
If you look at this section: https://docs.microsoft.com/en-us/azure/virtual-machines/extensions/dsc-template#settings-vs-protectedsettings
It explains the difference between settings and protected settings.
@MicahMcKittrick-MSFT and @DCtheGeek.
In its current state, this article should have all of its examples removed until they are corrected and clarified as to which schema is being used for each. They do not support the words on the page, and the number of errors make them counter-productive.
@mjcarrabine thanks so much for those examples! I will work with the content author to review and ensure the doc is correct.
@DCtheGeek can you take a look?
This is correct:
"settings" : {},
"protectedSettings": {}
This is incorrect. It looks like the term publicSettings was copied from the C:PackagesPluginsMicrosoft.Powershell.DSC2.76.0.0RuntimeSettings0.settings file created on the target VM, but is not valid here.
"settings" : {
"protectedSettings": {},
"publicSettings": {}
}
In the end, I was able to successfully deploy the DSC Extension using the following template.json file. Note, I removed the dependsOn because my VM is already deployed in a different template.
{
"$schema": "https://schema.management.azure.com/schemas/2015-01-01/deploymentTemplate.json#",
"contentVersion": "1.0.0.0",
"parameters": {
"VMName": {
"type": "string"
},
"registrationUrl1": {
"type": "string"
},
"registrationKey1": {
"type": "securestring"
},
"nodeConfigurationName": {
"type": "string"
}
},
"variables": {
},
"resources": [
{
"type": "Microsoft.Compute/virtualMachines/extensions",
"name": "[concat(parameters('VMName'),'/Microsoft.Powershell.DSC')]",
"apiVersion": "2017-12-01",
"location": "[resourceGroup().location]",
"dependsOn": [
],
"properties": {
"publisher": "Microsoft.Powershell",
"type": "DSC",
"typeHandlerVersion": "2.76",
"autoUpgradeMinorVersion": true,
"settings": {
"configurationArguments": {
"RegistrationUrl": "[parameters('registrationUrl1')]",
"NodeConfigurationName": "[parameters('nodeConfigurationName')]"
}
},
"protectedSettings": {
"configurationArguments": {
"RegistrationKey": {
"UserName": "PLACEHOLDER_DONOTUSE",
"Password": "[parameters('registrationKey1')]"
}
}
}
}
}
],
"outputs": {
}
}
@mjcarrabine Sorry for the delay. The complete update to this article will get published tomorrow. If you feel something is still incorrect or missing, feel free to re-open this Issue or create a new one. Thank you again for your feedback!
Most helpful comment
To answer my original question:
This is correct:
This is incorrect. It looks like the term
publicSettingswas copied from the C:PackagesPluginsMicrosoft.Powershell.DSC2.76.0.0RuntimeSettings0.settings file created on the target VM, but is not valid here.Working Example:
In the end, I was able to successfully deploy the DSC Extension using the following template.json file. Note, I removed the
dependsOnbecause my VM is already deployed in a different template.