azure-powershell icon indicating copy to clipboard operation
azure-powershell copied to clipboard

Add a switch for template validation in New-AzureResourceGroup*

Open bmoore-msft opened this issue 11 years ago • 4 comments

Capturing the results of an email thread...

Currently New-AzureResourceGroup* wraps the template validation (ala Test-AzureResourceGroupTemplate) before deploying the template. In the future, when we add more capabilities to the validate API we may want to separate validation and deployment. Here's the scenario:

We have a script that does template deployment which includes staging of artifacts into azure storage (nested templates, dsc scripts, web deploy packages, random build output) prior to deploying the template. If the template is not valid, we would not want to stage those bits, so we would end up with something like:

Test-AzureResourceGroupTemplate
azcopy stuff
New-AzureResourceGroupDeployment

If New-AzureResourceGroup* always runs validation, then we would run validation twice for every deployment when a template is valid. If we added a switch we could allow for:

New-AzureResourceGroupDeployment -SkipValidation

and then save the extra roundtrip.

bmoore-msft avatar Aug 27 '15 19:08 bmoore-msft

Will the new-azureresourcegroup cmdelt also get this change?

robplank avatar Aug 27 '15 19:08 robplank

New-AzureResourceGroup is an overloaded cmdlet (New-AzureResourceGroupDeployment more correctly models the service APIs and probably makes more sense for us to use) so that may be simplified in the future to deal only with group creation and not template deployment (which is just one engineer's opinion). That said, if it remains as is I would expect that it also honors such a switch.

bmoore-msft avatar Aug 27 '15 19:08 bmoore-msft

I agree that the template parameters should be removed from the new-azureresourcegroup cmdelt current design is confusing what the technical difference is between cadets do there is no help content to explain when your should use one over the other

robplank avatar Aug 27 '15 20:08 robplank

This should have been resolved by removing these parameters a few releases back. Please re-open if you see a recurrence

markcowl avatar Aug 08 '16 19:08 markcowl