Azure / Azure/bicep

Consider --verbose level logging on bicep.exe

Open
#4,841 1 comment 1 reaction 0 assignees View on GitHub
enhancement
Dominant language
Bicep
Stars
3.6k
Forks
830
Avg merge
1d 2h
Merged PRs (30d)
79

Description

when performing bicep.exe actions, we currently follow a **no news is good news** approach
- bicep build
- bicep decompile
- bicep publish
- bicep restore

**Describe the solution you'd like**
It would be good to consider meaningful --verbose output for the alternate scenarios

Currently tracing is available via Env variable: BICEP_TRACING_ENABLED = true

Example tracing statement:
https://github.com/Azure/bicep/blob/ef598ba2a64e9dca8ec858b188e1618eaf4bf9e3/src/Bicep.Core/Semantics/ArmTemplateSemanticModel.cs#L28

Example of tracing logging output:

1)
```
bicep build D:\bicep\foo2.bicep
TRACE: Building semantic model for file:///D:/bicep/foo2.bicep
```
2)
```
bicep decompile D:\bicep\foo2.json --outfile D:\bicep\foo2_1.bicep
TRACE: Building semantic model for file:///D:/bicep/foo2_1.bicep
TRACE: Building semantic model for file:///D:/bicep/foo2_1.bicep
TRACE: Building semantic model for file:///D:/bicep/foo2_1.bicep
TRACE: Building semantic model for file:///D:/bicep/foo2_1.bicep
TRACE: Building semantic model for file:///D:/bicep/foo2_1.bicep
```

- Action will be to consider a list of desired output for each of the: `build`, `decompile`, `publish` & `restore`

Things to consider:
- When doing Bicep Build in VSCode, there are some Bicep Operations output:
- e.g. `Build succeeded. Created file y.disks.json`
- Currently during a publish or build, the linter rules warnings are displayed, however no information beyond that.

Example for publish:
```powershell
bicep publish $bicepfile --target $mytarget --verbose
VERBOSE: ImageName: [sub-rg] published to: [acu1brwaoat5registry01.azurecr.io] with tag: [1.0]
VERBOSE: Digest: [sha256:8a4eab840f2953d325f462d0022902b7270f3dfaf9e008781bf68757fa23bf50]
```

Example for build:
```powershell
bicep build $bicep file --verbose
VERBOSE: Bicep File: [file:///D:/bicep/foo2.bicep] successfully built to: [file:///D:/bicep/foo2.json]
VERBOSE: templateHash: ["15887230102002981425"]
```

Example for decompile:
```powershell
bicep decompile $jsonfile $Bicep file --verbose
VERBOSE: Template File: [file:///D:/bicep/foo2.json] successfully decompiled to: [file:///D:/bicep/foo2.bicep]
```

Contributor guide

Open the contributing guide

Research direction

Start by reviewing the CLI entry points for build, decompile, publish, and restore, along with the existing tracing statement in ArmTemplateSemanticModel.cs and the BICEP_TRACING_ENABLED behavior. Define the desired --verbose output for each action, using the issue’s build, decompile, and publish examples as acceptance criteria; the work is done when those messages are agreed and consistently reported.

Written by the indexing model from the issue text.

Assessment

Tech stack
azure
Domain
cli, cloud
Issue type
Feature
Difficulty
5/5
Estimated time
Over a week
Activity status
Stale
Clarity
Needs clarification
Newbie friendliness
25/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.