Azure / Azure/bicep

EPIC: Decouple Azure type information from a particular version of Bicep

Open
#5,453 7 comments 15 reactions 0 assignees View on GitHub
enhancement story: dynamic type loading
Dominant language
Bicep
Stars
3.6k
Forks
830
Avg merge
1d 21m
Merged PRs (30d)
79

Description

Currently Bicep types are embedded with a Bicep release - meaning there is often a lag between types being available, and usable in Bicep, and upgrading requires the user to upgrade their VSCode extension or Bicep CLI.

Now that Bicep has the ability to talk to OCI for the Bicep module registry, it would make sense to re-use this infrastructure to be able to deliver Bicep types on a shorter cadence, and avoid having to tie the types to a version of Bicep - meaning that upgrading/downgrading the Bicep version will not change the types that are used for validation.

We may want to use the import statement to lock Bicep to a particular set of types - e.g.:
```bicep
import 'az@0.1'
```
```[tasklist]
### Triage
- [ ] #11752
- [ ] Implement versioning detection strategy for az
- [ ] Determine course of action regarding https://github.com/Azure/bicep/pull/12267#discussion_r1381979265
```

```[tasklist]
### Todo
- [ ] #11610 Completions for available versions
```

```[tasklist]
### In Progress
- [ ] Propagate az ArmTemplateProviderVersion to backend, support reading / logging of version in backend
- [ ] #11307 Design caching strategy for providers
```
```[tasklist]
### Deprioritized
- [ ] {@majastrz} - We can have service connection to an OCI registry in an official OneBranch pipeline to publish directly from ADO
- [ ] Optimize decompressing of provider package - to file system or in memory
- [ ] Move function definitions to the provider package
```

```[tasklist]
### Done
- [ ] https://github.com/Azure/bicep/pull/12127
- [x] Discussion #11894
- [x] Get approval for https://github.com/Azure/bicep/discussions/12110
- [ ] https://github.com/Azure/bicep-types-az/pull/1553
- [x] #11598 Design for aliasing of registry module paths
- [x] Refactoring of registry classes to decouple module & provider
- [x] We want to create sufficient tests to assert that BEFORE we publish a new AZ package, this package will load properly in Bicep. And we have a clear strategy for compatibility testing (which bicep versions work with which packages)
- [x] #10662 Initial design
- [x] #10624 Support `import` syntax with loading versioned provider types from disk
- [x] #11458 Support restore for resource type providers
- [x] #11757
- [x] #11593 Versioning of provider packages
- [x] Document strategy for publishing to MCR (including naming / path conventions)
- [x] Document the OCI manifest format for providers
```
### Open questions/tasks

- [x] Implement publishing pipeline for providers
- [ ] Removal of feature flag
- [ ] Close on serialization format for types (types.json)
- [ ] Build in ability to version the contract (to support back/format compatibility wile being able to make changes)
- Old versions of Bicep need to be able to understand they don't support the new format (and show an error if the user is using an incompatible version of Bicep)
- New versions of Bicep need to be able to support N numbers of older versioned format
- [ ] Generalize to support other providers
- [ ] Ensure we have a plan for airgapped clouds (and have verified it)

Contributor guide

Open the contributing guide

Research direction

Start by reviewing the open task list, especially #11307, #11610, and #11752, along with the existing import syntax and versioned provider package work. Done requires resolving the remaining contract-format, provider generalization, feature-flag, and air-gapped-cloud questions described in the issue.

Written by the indexing model from the issue text.

Assessment

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

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.