Closed jikuja closed 3 years ago
@jikuja , thanks for your detailed steps.
@BethanyZhou , please look into this issue.
Hi @jikuja , thank you for reporting.
I have reproduced this issue. In New-AzResourceGroupDeployment, it parses the exit code of bicep as 0 in this case and treats the build result as success. That's why this command is unable to report exact error message.
We will fix this issue in next release (about 11/2). By far, you can obtain detailed error message by turning on -Verbose like New-AzResourceGroupDeployment -TemplateFile main.bicep -Verbose
. Thank you again for making our module better!
Hi @jikuja ,
The fix would be available in Az.Resources 4.4.1.
Looks like AZ-104 hands-on lab materials involve this as well. I am especially talking about the URL below. The same verb, the same error message. Effectively, I cannot create resources for this lab exercise... https://github.com/MicrosoftLearning/AZ-104-MicrosoftAzureAdministrator/blob/master/Instructions/Labs/LAB_04-Implement_Virtual_Networking.md
Hi @yamakenrc5 , what's your Az.Resources version? You can get it by 'Get-Module'
Description
New-AzResourceGroupDeployment prints misleading error message when bicep build fails
Steps to reproduce
create main.bicep
then running command
gives misleading error message
New-AzResourceGroupDeployment: Cannot retrieve the dynamic parameters for the cmdlet. Cannot find path '/var/folders/xy/kd548pyn3bjbzp70k88x680sqt9mmj/T/353d2738-f052-49cc-87cd-faf61bc7637b/main.json' because it does not exist.
No hints about bicep build being failed because of linked file not being found.Identical behavior happens with Azure Devops with 6.4.0 Az module locked.
Running
bicep build main.bicep
returns the following:with return code 0
Environment data
Module versions
Debug output
Error output