Azure / Azure/azure-quickstart-templates
Travis CI validation for templates with client VM resources will fail
- Dominant language
- Bicep
- Stars
- 14.9k
- Forks
- 16.2k
- Avg merge
- 6d 21h
- Merged PRs (30d)
- 6
Description
Travis CI validation for templates with client VM resources fail with VM agent communication errors. After many hours of troubleshooting, I discovered that the actual cause of failure is that the Travis CI test subscription it not an "eligible" subscription for deploying client VMs (https://docs.microsoft.com/en-us/azure/virtual-machines/windows/client-images#subscription-eligibility). It would be useful to call this out in the contribution guide, and ideally to also add support in the validation log for an error message that offers this information.
My solution to this issue was to revise the azuredeploy.json file in my template with the following:
- Added a parameter to make the client VM deployment optional, with a default value of "No" like so:
` "deployClientVm": {
"type": "string",
"allowedValues": [
"No", "Yes"
],
"metadata": {
"description": "Choose 'No' to deploy no client VM, or 'Yes' if you want to deploy a client VM from a custom generalized VHD that you have uploaded to an accessible storage account."
},
"defaultValue": "No"
},`
- Added a "condition" element to the client VM deployment resource like so:
` "name": "Client",
"condition": "[equals(parameters('deployClientVm'),'Yes')]",
"type": "Microsoft.Resources/deployments",
"apiVersion": "2015-01-01",`
- Added parameters for specifying the location of a manually uploaded custom VHD if the user chooses to deploy a client VM
Contributor guide
No contributing guide indexed for this repository
Research direction
Start with the contribution guide and the affected template's azuredeploy.json, then trace how Travis CI validation reports client VM deployment failures. Done means the guide explains the subscription eligibility requirement and the validation log gives a useful indication when an ineligible subscription causes the failure.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- azure
- Domain
- ci-cd, cloud, documentation
- Issue type
- Feature
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 35/100