Azure / deployment-stacks

Contains Deployment Stacks CLI scripts and releases
MIT License
87 stars 7 forks source link

az stack --template-uri doesn't work for bicep template #186

Open alefred opened 2 weeks ago

alefred commented 2 weeks ago

Describe the bug --template-uri parameter on deployment stack command only allow to use json arm file.

To Reproduce Steps to reproduce the behavior:

  1. Try to deploy any bicep file from remote uri using az cli stack commands for resource group, subscription and mg:

    az stack group validate \
    --name stack-armor \
    --resource-group rg-experiments-01 \
    --action-on-unmanage deleteResources \
    --deny-settings-mode none \
    --template-uri https://raw.githubusercontent.com/alefred/armor-greave/ft/stacks/demo-1/deploygroup.bicep
  2. Error received:

    Failed to parse 'https://raw.githubusercontent.com/alefred/armor-greave/ft/stacks/demo-1/deploygroup.bicep', please check whether it is a valid JSON format

Expected behavior Template uri support bicep file deployment as ARM json file deployment

Screenshots image

Repro Environment Host OS: Ubuntu 22.04.3 LTS, Linux 5.15.153.1-microsoft-standard-WSL2 Azure-cli version: 2.63.0

dantedallag commented 2 weeks ago

Hey @alefred, bicep files are currently not supported as a template uri, so I'm going to mark this as a feature request. I do think we could give a better error on the failure though rather than outputting it can't be parsed.

alefred commented 2 weeks ago

Thanks @dantedallag indeed a message indicating Bicep template are unsupported for now , could be the best.

dantedallag commented 2 weeks ago

@alefred Thanks for closing, but we would be happy to keep open if this a feature that you would like to see implemented in the future. If not though, no problem.