Azure-docs: The first two template examples are incorrect

Created on 6 Mar 2018  Â·  17Comments  Â·  Source: MicrosoftDocs/azure-docs

I believe the first two template examples on this page are incorrect. To start they are not valid json (see the additional "{" within the configurationArguments property). Additionally the examples do not comply with the settings schema on this page. Specifically the configurationArguments object.


Document Details

⚠ Do not edit this section. It is required for docs.microsoft.com ➟ GitHub issue linking.

  • ID: 92491b1b-f7e2-c4d2-f136-9d7afcc1d186
  • Version Independent ID: a7b77b0e-ba18-9a49-639e-7e9a99cd4017
  • Content
  • Content Source
  • Service: virtual-machines-windows
assigned-to-author doc-bug triaged virtual-machines-windowsvc

Most helpful comment

I did using the default configuration script. I was going to submit a pull request for the updated docs but haven't had a chance yet. I believe the initial example should look like this:

             "name": "Microsoft.Powershell.DSC",
             "type": "extensions",
             "location": "[resourceGroup().location]",
             "apiVersion": "2015-06-15",
             "dependsOn": [
                  "[concat('Microsoft.Compute/virtualMachines/', variables('vmName'))]"
              ],
              "properties": {
                  "publisher": "Microsoft.Powershell",
                  "type": "DSC",
                  "typeHandlerVersion": "2.72",
                  "autoUpgradeMinorVersion": true,
                  "forceUpdateTag": "[parameters('dscExtensionUpdateTagVersion')]",
                  "settings": {
                       "configurationArguments": {
                            "RegistrationUrl" : "[parameters('registrationUrl1')]",
                            "NodeConfigurationName" : "nodeConfigurationNameValue1"
                       }
                  },
                  "protectedSettings": {
                       "configurationArguments": {
                            "RegistrationKey": {
                                 "userName": "PLACEHOLDER_DONOTUSE",
                                 "password": "[parameters('registrationKey1')]"
                            }
                       }
                  }
              }

The code formatting has not come out as expected. You can see it on my forked version of the docs here: https://github.com/chrisnewark/azure-docs/blob/master/articles/virtual-machines/windows/extensions-dsc-template.md

All 17 comments

Thanks for the feedback! I have assigned the issue to the content author to investigate further and update the document as appropriate.

On top of the obvious schema issue, this page does not elaborate on what members the "configurationArgument" object can have in the new schema version as opposed to what the "property" array was supporting in the old schema. It however suggests that configurationArgument is a like for like replacement for property... however property was clearly an array and from the ARM deploy error messages I get I assume configurationArgument is an object.

I was just about to report the same issue! Pretty frustrating :(

Did any of you manage to get it working?

@mgreenegit any progress on this issue?

I did using the default configuration script. I was going to submit a pull request for the updated docs but haven't had a chance yet. I believe the initial example should look like this:

             "name": "Microsoft.Powershell.DSC",
             "type": "extensions",
             "location": "[resourceGroup().location]",
             "apiVersion": "2015-06-15",
             "dependsOn": [
                  "[concat('Microsoft.Compute/virtualMachines/', variables('vmName'))]"
              ],
              "properties": {
                  "publisher": "Microsoft.Powershell",
                  "type": "DSC",
                  "typeHandlerVersion": "2.72",
                  "autoUpgradeMinorVersion": true,
                  "forceUpdateTag": "[parameters('dscExtensionUpdateTagVersion')]",
                  "settings": {
                       "configurationArguments": {
                            "RegistrationUrl" : "[parameters('registrationUrl1')]",
                            "NodeConfigurationName" : "nodeConfigurationNameValue1"
                       }
                  },
                  "protectedSettings": {
                       "configurationArguments": {
                            "RegistrationKey": {
                                 "userName": "PLACEHOLDER_DONOTUSE",
                                 "password": "[parameters('registrationKey1')]"
                            }
                       }
                  }
              }

The code formatting has not come out as expected. You can see it on my forked version of the docs here: https://github.com/chrisnewark/azure-docs/blob/master/articles/virtual-machines/windows/extensions-dsc-template.md

I am getting an error using the above template " The type property is invalid." for the line "type": "extensions",

@timlt can you take a look into this? @mgreenegit is listed as the author but appears to no longer be contributing here.

Similar to @chrisnewark , here is what I ended up going with:

{
                "name": "Microsoft.Powershell.DSC",
                "properties": {
                  "publisher": "Microsoft.Powershell",
                  "type": "DSC",
                  "typeHandlerVersion": "2.72",
                  "autoUpgradeMinorVersion": true,
                  "protectedSettings": {
                    "Items": {
                      "registrationKeyPrivate":
                        "[parameters('registrationKey')]"
                    }
                  },
                  "settings": {
                    "Properties": [
                      {
                        "Name": "RegistrationKey",
                        "Value": {
                          "UserName": "PLACEHOLDER_DONOTUSE",
                          "Password":
                            "PrivateSettingsRef:registrationKeyPrivate"
                        },
                        "TypeName": "System.Management.Automation.PSCredential"
                      },
                      {
                        "Name": "RegistrationUrl",
                        "Value": "[parameters('registrationUrl')]",
                        "TypeName": "System.String"
                      },
                      {
                        "Name": "NodeConfigurationName",
                        "Value": "[parameters('nodeConfigurationName')]",
                        "TypeName": "System.String"
                      }
                    ]
                  }
                }
              }

Getting the error that type is not defined and once type is defined as below
"type": "extensions",
Getting the error message as type invalid . Are people looking into this issue ?

We are working on getting this correct and will update everyone shortly.

Update
We are working on getting this fixed today.

Is there any update on the issue

Any updates?

@girishgoudar it is taking longer than expected to fix. The team is working on it.

Thank you for catching this. The fix for the example is merging soon. We are reviewing the extension for all schema changes and will update the table ASAP.

in-progress @MicahMcKittrick-MSFT can you swap the timlt tag for jpconnock?

please-close the fix merged and other fixes are in progress, closing. @chrisnewark @girishgouda @tonjohn @pekkaar thank you for your feedback!

Was this page helpful?
0 / 5 - 0 ratings

Related issues

ianpowell2017 picture ianpowell2017  Â·  3Comments

paulmarshall picture paulmarshall  Â·  3Comments

spottedmahn picture spottedmahn  Â·  3Comments

spottedmahn picture spottedmahn  Â·  3Comments

Ponant picture Ponant  Â·  3Comments