Search code examples
jsonazureazure-marketplace

What's the easiest way to test a createUIDefinion.json file for Azure solution templates?


I'm in the process of publishing my solution template in the Azure marketplace.

My mainTemplate.json file, for example, is easy to test without publishing because I can deploy from Git. But I can't seem to test the UI file via Git deployment.

So the problem is getting my createUIdefinition.json file tested in a timely fashion. It seems like every time I made a change to the createUIdefinition.json file, I have to upload a new package to the publishing portal, which means I have to wait for Microsoft certification before I can stage a test. It's a 24-hour process.

Is there an easier way to test my createUIdefinition.json changes without going through that process?

For example, I have a bug somewhere in the regex that validates one of my user inputs:

 {
        "name": "EmailUser",
        "type": "Microsoft.Common.TextBox",
        "label": "Email Address",
        "toolTip": "The email address for your account",
        "defaultValue": "",
        "constraints": {
          "required": true,
          "regex": "\\w+([-+.']\\w+)*@\\w+([-.]\\w+)*\\.\\w+([-.]\\w+)*",
          "validationMessage": "Must be a valid email address."
  }

(Side note, if anyone can spot my bug -- maybe when escaping the characters? -- please let me know! No email address validates properly.)

And it's driving me a bit batty having to wait a day just to test my supposed fixes. There must be a better way, thanks!


Solution

  • Azure have now a sandbox to test the createUiDefinition file.

    https://portal.azure.com/?feature.customPortal=false#view/Microsoft_Azure_CreateUIDef/SandboxBlade

    Just copy and paste your createUiDefinition.json content and click preview, it will generate all the ui so you can test your configuration.

    You can also view a few examples or get the fields definitions from there.

    Create UI Definition Sandbox

    Create UI Definition Sandbox