Azure / Azure/bicep

Paste parsing of ARM template with languageVersion 2.0 fails in VS Code Bicep extension

Open
#14,469 3 comments 0 reactions 0 assignees View on GitHub
devdiv investigate story: decompiler
Dominant language
Bicep
Stars
3.6k
Forks
830
Avg merge
1d 21m
Merged PRs (30d)
79

Description

**Bicep version**
Bicep extension version: `v0.28.1`
Azure CLI bicep version: `Bicep CLI version 0.28.1 (ba1e9f8c1e)`

**Describe the bug**
Earlier we could just copy the ARM template from a deployment in Azure Portal and paste that in a bicep file and we got a
bicep script based on the ARM template to work with. But now it seems that Azure Portal has switched to a new format with `languageVersion` set to `2.0` and these templates fails with the error `Could not convert pasted text into Bicep: [13:16]: Decompilation of symbolic name templates is not currently supported`.

**To Reproduce**
Steps to reproduce the behavior:
- Go to a resource group in Azure Portal and Deployments
- Take one of the deployments and go to the Template section
- Copy the template content
- Create a bicep file in Visual Studio Code
- Paste the template content

The error occurs as described above.

**Additional context**
Investigation has revealed that it is because the `languageVersion` `2.0` uses a new format on the resources field that isn't supported as the message states, but the problem is that this is now the default format for template provided by Azure Portal, so the bicep module should support it.

Contributor guide

Open the contributing guide

Research direction

Reproduce the failure by copying a languageVersion 2.0 template from an Azure Portal deployment into a Bicep file in VS Code. Investigate the decompilation path for the unsupported symbolic-name resources format; done means the pasted template converts into usable Bicep without the reported error.

Written by the indexing model from the issue text.

Assessment

Tech stack
azure, json, vscode
Domain
cloud, tooling
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.