Reputation: 25989
I am working on an ARM template for deploying resources in Azure, and I would like to add some validation in the parameters the user can specify.
In my deployment, the user can specify that he wants to deploy the resources in a certain virtual network and in a certain subnet.
Right now, it is possible to specify a subnet which does not exist and the deployment of the resources will launch, only to fail afterwards.
Is there any way to validate that the subnet is indeed within that virtual network, so that the validation occurs straightaway and the deployment does not start in the first place?
In AWS, this can be achieved with the Constraints rule: https://docs.aws.amazon.com/servicecatalog/latest/adminguide/reference-template_constraint_rules.html
Is there an equivalent for ARM templates? I didn't find anything in the docs for ARM.
Upvotes: 0
Views: 753
Reputation: 72151
no, there is nothing like that in the ARM Template syntax, you need to create a script and run it before invoking the template to check that. alternatively you can create a list of possible values and define all the subnets the person can deploy his stuff using the allowedvalues
property of a parameter.
Upvotes: 1