bicep icon indicating copy to clipboard operation
bicep copied to clipboard

When "viewing definition" of module, support a way to view the decompiled bicep instead of the ARM JSON.

Open Manbearpiet opened this issue 3 years ago • 2 comments

Is your feature request related to a problem? Please describe. For our engineers working with our customers, it's sometimes unclear what the source code is in an ACR-hosted template. This unfortunately leads us to a scenario in which we have to share the source code from our internal repos, while the template code is already present in the ACR. All our engineers have access to the ACR containing our bicep templates.

Describe the solution you'd like We're very fond of snippets, and since we can reference templates and their properties in resource statements, we'd like to be able to expand templates stored in our ACR, from within our VSCode editor. For example:

Type !acrname:path-in-acr-to-our-template in your vscode, and via intellisense it auto-discovers which templates are stored with that name. When pressing enter, it will replace the statement (similar to resource or res-app-plan, for example) with the template file content. So if you'd have done that you'd see the whole stored template, instead of just a resource statement referring to the template in the ACR.

I understand it's not the way to use an ACR in a template, but knowing what the template content actually is would help our colleagues a lot. And prevents our colleagues from sharing repo access.

Manbearpiet avatar Jul 08 '22 15:07 Manbearpiet

Is the goal to use/edit that code or just to view it? We support "Go to definition" for templates stored in ACR. You can right-click and select "go to definition" to see the code for that module reference. Does that solve the problem for you?

The only caveat is that you are going to see ARM template JSON, not the bicep code because that is what we actually store in ACR to avoid bicep versioning inconsistencies.

alex-frankel avatar Jul 20 '22 17:07 alex-frankel

Is the goal to use/edit that code or just to view it? We support "Go to definition" for templates stored in ACR. You can right-click and select "go to definition" to see the code for that module reference. Does that solve the problem for you?

The only caveat is that you are going to see ARM template JSON, not the bicep code because that is what we actually store in ACR to avoid bicep versioning inconsistencies.

Hey Alex, nice tip on the "View Definition"! The goal is just to view the code. While I wouldn't have any issue with reading the ARM-template, my co-workers don't have any experience with ARM-templates. So viewing it in Bicep seems the only solution to their challenges. Maybe an option: Show decompiled definition? So viewing the same definition file, but it being decompiled to bicep-content?

Manbearpiet avatar Aug 03 '22 15:08 Manbearpiet