Azure / azure-powershell

Microsoft Azure PowerShell
Other
4.23k stars 3.83k forks source link

Add a switch for template validation in New-AzureResourceGroup* #808

Closed bmoore-msft closed 8 years ago

bmoore-msft commented 9 years ago

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.

robplank commented 9 years ago

Will the new-azureresourcegroup cmdelt also get this change?

bmoore-msft commented 9 years ago

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.

robplank commented 9 years ago

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

markcowl commented 8 years ago

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