-
Notifications
You must be signed in to change notification settings - Fork 3.9k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Improve display and processing of errors in Test-AzureRmResourceGroupDeployment and New-AzureRmResourceGroupDeployment #6856
Comments
@ohadschn For (1) this is by design. Resolve-AzureRmError is specifically designed for dealing with errors written by the cmdlets. I would expect Resolve-AzureRmError to handle errors from an actual (rather than test) deployment. For (2) This is an unfortunate side-effect of how the underlying API works. Seems like the cmdlet should be a little more intellegent at handling this, (and invalid or missing template or template parameters) For (3) I think the right option to avoid this is buy using -TemplateParameterObject or -TemplateParameterFile parameters. If you don't use these parameter sets, you are essentially tellign the cmdlet you want to use dynamic parameters to resolve template parameters. |
|
So for (1) Agreed that the display of actual template deployment results from the test cmdlet should be sensible and readable from the cmdlet output. |
DescriptionMake the following changes to Test-Deployment cmdlets (1) Catch resourceGroup not found errors and return a valid error message in a format compatible with the rest of the depolyment errors (2) Update default display and documentation / examples for processing resource deployment errors (3) Determine if dynamic parameters can be omitted if a TemplateParameterObject or TeplateParamaterFiel are provided Cost: 6 |
Thanks! I think you switched (1) and (2) though :) Regarding catching errors and returning them as |
A fix for this has been merged and will be available in the next release of |
I have experienced three different ways ARM configuration issues are reported by
Test-AzureRmResourceGroupDeployment
PSResourceManagerError
as expected. The problem here is thatResolve-AzureRmError
doesn't work (I guess because noErrorRecord
was created), so I had to write my own method for extracting the errors: https://stackoverflow.com/a/51713155/67824. Example:Test-AzureRmResourceGroupDeployment
is to detect ARM configuration issues and return them asPSResourceManagerError
objects as documented. Example:Wait-Job
will fail withThe Wait-Job cmdlet cannot finish working, because one or more jobs are blocked waiting for user interaction
and you'll have to jump through some extra hoops to even determine which job caused the issue. An easy workaround would be a-NoDynamic
flag or some such. Example:Most of the comments above are relevant for
New-AzureRmResourceGroupDeployment
as well.The text was updated successfully, but these errors were encountered: