Skip to content

Bicep module files for policy definition versus using the File Function #17

Discussion options

You must be logged in to vote

Hi @mcdrm - great question!

Having custom policy definitions stored in .JSON format instead of .BICEP format allows me to quickly copy + paste + create custom policies directly from the Azure Portal, or any public repo containing .JSON policies, without doing any modifications to the new .JSON file.

Some modifications you can avoid by using this pattern would be:

  • adding targetscope = 'xyz'
  • changing " to ' for values
  • removing " from keys
  • removing , at the end of lines
  • escaping ' within values using \

There are disadvantages to using this pattern such as:

  • inability to use Bicep vscode extension features (e.g. intellisense) when working with .JSON files
  • cannot take advantage of Bicep-spec…

Replies: 1 comment 1 reply

Comment options

You must be logged in to vote
1 reply
@MilesCameron-DMs
Comment options

Answer selected by MilesCameron-DMs
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants