I'm new for Azure ARM template, what I want to do is quickly build a testing environment from existing resource like web application, SQL server, etc. While I trying deploy from existing resources' ARM template, got some problem , and not sure if there is a good way to test template is going work or not work.
For practice template deploy, I use Azure portal, and created some resources from the
Web app + SQL
Azure template first.(1) Create a resource
(2) input
Web App + SQL
(3) setting resource names and something, and done.
Then go to source group and export these resources' ARM template.
(1) Go to Resource group
(2) click selected all checkbox
(3) Export template
(4) Download
Finally, use this template.json to deploy.
(1) Create a resource
(2) input
template
and choseTemplate deployment (deploy using custom template)
(3) Build your own template in the editor
(4) Load file
(5) upload template.json that downloaded before
(6) Save
(7) Select resource group and set resource name without duplicate to resource created before.
(8) Check "I agree" checkbox and click Purchase button.
So basically I didn't change any resource, just export and deploy, and the deploy failed.
Here is error message:
{
"code": "DeploymentFailed",
"message": "At least one resource deployment operation failed. Please list deployment operations for details. Please see https://aka.ms/arm-debug for usage details.",
"details": [
{
"code": "Conflict",
"message": "{\r\n \"status\": \"Failed\",\r\n \"error\": {\r\n \"code\": \"ResourceDeploymentFailure\",\r\n \"message\": \"The resource operation completed with terminal provisioning state 'Failed'.\",\r\n \"details\": [\r\n {\r\n \"code\": \"InvalidParameterValue\",\r\n \"message\": \"Invalid value given for parameter Password. Specify a valid parameter value.\"\r\n }\r\n ]\r\n }\r\n}"
}
]
}
After some research, I find out that if I deploy a SQL Server, I need to set admin password parameter into template too.
What I want to ask is, is there a good way to build ARM template, that you don't need actually go to deploy and get error message to tell you which parameter is missing or something?
Or you just build json file, deploy, and do try & error... :S