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!
To specify individual tests to run, use the -Test parameter and provide the test name. For the test names, see ARM templates, parameter files, createUiDefinition. json, and all files.
In a web browser, go to the Azure portal and sign in. From the Azure portal search bar, search for deploy a custom template and then select it from the available options. For Template source, notice that Quickstart template is selected by default. You can keep this selection.
Azure Resource Manager is the deployment and management service for Azure. The format of an Azure Resource Template is JSON. So, the correct answer is option (c) Q.
I found my answer. There's a specially crafted URL that can be used to preview createUIDefinition.json. The format is like this:
<a href="https://portal.azure.com/#blade/Microsoft_Azure_Compute/CreateMultiVmWizardBlade/internal_bladeCallId/anything/internal_bladeCallerParams/{"initialData":{},"providerConfig":{"createUiDefinition":"URL_ENCODED_LINK TO_createUiDefinition.json"}}">[Preview createUiDefinition.json]</a>
So the steps to test are:
Note that you can't do a full deployment here, these steps are only for testing your UI, validating your regex, etc. You still need to test the output and make sure it works with your mainTemplate.json file with a separate deployment.
The Azure Portal now has a more intuitive way of testing. Go to aka.ms/createuidef/sandbox, paste your createUiDefinition.json, and click preview to see how it looks. This way you can make changes and see them in real-time without having to republish.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With