-
Notifications
You must be signed in to change notification settings - Fork 3.4k
Closed
Labels
ARMaz resource/group/lock/tag/deployment/policy/managementapp/account management-groupaz resource/group/lock/tag/deployment/policy/managementapp/account management-groupService AttentionThis issue is responsible by Azure service team.This issue is responsible by Azure service team.
Description
az feedbackauto-generates most of the information requested below, as of CLI version 2.0.62
Describe the bug
When deploying a bicep file using az cli without having the bicep executable installed, the bicep auto install feature sends installation result messages to stdout. This breaks the ability to read and parse the expected json output from the deployment.
To Reproduce
$output = az deployment sub create -f ./main.bicep -l centralus --subscription mysub --output json | Out-String | ConvertFrom-JSON
Error:
ConvertFrom-JSON : Invalid JSON primitive: Installing.
At line:1 char:128
+ ... tion mysub --output json | Out-String | ConvertFrom-JSON
+ ~~~~~~~~~~~~~~~~
+ CategoryInfo : NotSpecified: (:) [ConvertFrom-Json], ArgumentException
+ FullyQualifiedErrorId : System.ArgumentException,Microsoft.PowerShell.Commands.ConvertFromJsonCommand
Expected behavior
When bicep installation occurs in the background through the auto install, send installation messages to the az cli logger facility instead of stdout.
Environment summary
azure-cli 2.20.0
Additional context
Workaround:
To avoid this issue, run the 'az bicep install' command before 'az deployment' to avoid the auto install messages being sent to stdout.
az bicep install
$output = az deployment sub create -f ./main.bicep -l centralus --subscription mysub --output json | Out-String | ConvertFrom-JSON
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
ARMaz resource/group/lock/tag/deployment/policy/managementapp/account management-groupaz resource/group/lock/tag/deployment/policy/managementapp/account management-groupService AttentionThis issue is responsible by Azure service team.This issue is responsible by Azure service team.