Azure / Azure/bicep

Function to compile bicep into ARM and use as object

Open
#14,835 1 comment 1 reaction 0 assignees View on GitHub
enhancement Needs: Upvote
Dominant language
Bicep
Stars
3.6k
Forks
830
Avg merge
1d 21m
Merged PRs (30d)
79

Description

**Is your feature request related to a problem? Please describe.**
Template Specs and Azure policies with deployifnotexists effect take ARM template as one of their properties. Building bicep into ARM templates requires additional CI/CD steps, git-hooks or to remember to compile bicep before committing to your IaC repository.

**Describe the solution you'd like**
I would like to have a function called `build` that as an argument takes path to a bicep file and as an output returns compiled ARM template. i.e.

```bicep
resource res_templateSpec 'Microsoft.Resources/templateSpecs@2022-02-01' = {
name: name
location: location
properties: {
displayName: 'Service Template'
}

resource version 'versions' = {
name: '1.0.0'
location: location
properties: {
mainTemplate: build('service.bicep') //current way is to use loadJsonContent('service.json')
}
}
}
```

Contributor guide

Open the contributing guide

Research direction

Start by tracing the existing `loadJsonContent('service.json')` usage and the proposed `build('service.bicep')` entry point. Define done as allowing a Bicep path to produce an ARM template object suitable for the `mainTemplate` property of a template spec or Azure policy.

Written by the indexing model from the issue text.

Assessment

Domain
cloud, compilers, infrastructure
Issue type
Feature
Difficulty
5/5
Estimated time
Over a week
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.