Search code examples
azureazure-deploymentazure-automation

Azure, automation script and the "SecureObject" type usage


I'm having an issue with automation script feature in Azure and deployment of automations and the type "SecureObject". Hopefully someone can point me in the right direction here.

My scenario is that I've developed a set of features in a resourcegroup in Azure and now I want to use an automation script to deploy the whole thing in to another resourcegroup for acceptance testing by another team.

The resource group consists of various features and generally all is good apart from an Automation which expects a "secureObject" as an input parameter for the "sku" section which I beleive is some kind of unique identifier, however these are normally just strings but not in this particular case.

My question is, what am I supposed to type into that parameter field at the deployment? I find basically no information regarding this anywhere so I'd be gratefull for any help here, a solution or just a hint to point me in the right direction.

If I leave it blank (null) I am getting the error message:

"The value of deployment parameter 'automationAccounts_MyAutomation_sku' is null. Please specify the value or use the parameter reference. See https://aka.ms/arm-deploy/#parameter-file for details. (Code: InvalidDeploymentParameterValue)"

If I just type something (which I didnt actually expect would work anyway) I'll get the error message:

"Unable to parse the value into type 'secureobject'"

To clarify further, here's a screenshot of the actual generated script

enter image description here

Which at deployment expects an input of "secureObject", and here I am stuck...

enter image description here

Same thing goes for using the Visual Studio resource Group template project without any actual point in the right direction.

Any ideas here, anyone?

EDIT: Big thanks to 4c74356b41 for coming up with a solution which works for deployments inside the Azure portal. However when using the same script in Visual Studio 2015 and a Resource Group Template the problem unfortunately persists. Am investigating this issue but if anyone has a good answer on why it doesnt accept secureObjects (even though that is listen in the options for selectable datatypes in the editor), please let me know

Thanks, JFM

enter image description here


Solution

  • So if you go to the https://resources.azure.com/ you could examine the actual Automation Account and its "schema":

    "sku": {
          "name": "Free",
          "family": null,
          "capacity": null
        }
    

    So would you need to pass the expected object to that parameter. It accept JSON input, for example.