Azure / Azure/bicep

Feature Request: Provide a "Quick fix" for BCP165

Open
#11,384 0 comments 0 reactions 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

For context, here is what BCP165 is:

`A resource's computed scope must match that of the Bicep file for it to be deployable. This resource's scope is computed from the "scope" property value assigned to ancestor resource "xxx". You must use modules to deploy resources to a different scope. bicep(BCP165)`

I run into this frequently in two scenarios:
- I want to grant permissions to an entity in another resource group
- I want to put a secret from the entity I am creating into a keyvault in another resource group.

This happens frequently enough that I am creating more module files than I would like. It's both more work and breaks up the bicep template more than I would like.

Since the fix is mechanical - move the resources to a module and reference the module with the scope you want - I'd like the compiler to do it for me. Then I can structure my files as I prefer and avoid the extra work of creating indirections.

I'd prefer bicep to handle naming of the module, though I'm ok needing to specify it in these cases.

Contributor guide

Open the contributing guide

Research direction

Start with the BCP165 diagnostic and the issue's two cross-resource-group scenarios. Determine how a quick fix could represent the mechanical move into a module while allowing the desired target scope and module naming. Done means the compiler offers this fix for BCP165 without requiring the user to create the module manually.

Written by the indexing model from the issue text.

Assessment

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

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.