Questions tagged [azure-bicep]

Bicep is a Domain Specific Language (DSL) for deploying Azure resources declaratively. It aims to drastically simplify the authoring experience with a cleaner syntax and better support for modularity and code re-use. Bicep compiles down to standard ARM Template JSON files, which means the ARM JSON is effectively being treated as an Intermediate Language (IL).

Bicep is an alternative to using terraform as Infrastructure-as-Code to programmatically create, modify or destroy Azure resources.

A productive aspect of Bicep is the ability to take a snapshot of an existing Azure resource then compile that snapshot into the Bicep language to be used as a template from which to manage such a resource.

A common usage pattern is to execute your Bicep code in an Azure pipeline to engage its definitions to manage resources

688 questions
0
votes
0 answers

Using resource Id and apiVersion in Azure Bicep modules

I currently have one large .bicep file called main.bicep that I am working on modularizing. Specifically I have been working on moving the Cosmos resources into a file of its own called cosmos-db.bicep and consuming it in…
agw2021
  • 266
  • 2
  • 22
0
votes
1 answer

Azure ARM policy deployment deny specific sku.name

I am extremely confused about arm deployment for policies, and I hope somebody can help me to solve this issue. I would like to have in place a policy which denies the database deployment based on their Sku.name. Right noe I would like to allow the…
0
votes
0 answers

Read metadata of resource through Azure policy

I want to read metadata of the resource which is deployed in Azure like eg: template.json and create Azure policy definition to traverse through this metadata for every resource being deployed to perform pre-flight checks on all deployments …
anuj khosla
  • 43
  • 1
  • 1
  • 6
0
votes
0 answers

Azure Bicep Error - Error while attempting to retrieve the latest Bicep version

I'm trying to deploy using bicep from a Powershell terminal in VSCode behind a corporate proxy. My command line is: az deployment sub create -f .\main.bicep -l uksouth If I'm joined to the VPN then I get the following error: Error while attempting…
Rob Bowman
  • 7,632
  • 22
  • 93
  • 200
0
votes
1 answer

BICEP module deploy virtual network, but not NSG based upon if statement

I have a basic BICEP module that deploys a virtual network with subnets and NSGs. 1 of the subnets is for an azure firewall. The azure firewall subnet cannot be attached to an NSG so I have put a condition to not deploy an nsg to the azure firewall…
user11455801
0
votes
1 answer

Reference object variable in Bicep template

I'm currently trying to manually convert an existing ARM template to bicep because the automated decompile method fails. The existing template contains the following variables: "environmentSize": { "dev": "small", "msdn": "small", …
Rob Bowman
  • 7,632
  • 22
  • 93
  • 200
0
votes
1 answer

Is there a way to connect an Azure firewall to a Front Door Premium Policy with Bicep?

I am trying to implement Azure Front Door Premium with a Web Application Firewall connection. I am able to create the Front Door both manually and through Bicep. However, when I try to connect to a WAF through Bicep, I'm not sure if it completely…
agw2021
  • 266
  • 2
  • 22
0
votes
1 answer

child resources in nested resource in Bicep

I am looking for solution where I can create multiple storage accounts and create child resources like blob for each storage accounts using loops in Bicep.I was able to deploy multiple storage accounts but not getting good examples or documentation…
0
votes
1 answer

Azure - Using bicep to set storage container access policy

Can Bicep be used to do what this Azure CLI script does? az storage container policy create \ --container-name $containerName \ --name $policyName \ --account-name $storageAccountName \ --account-key $accountKey \ --permissions…
Caad9Rider
  • 654
  • 1
  • 8
  • 16
0
votes
1 answer

How to define identity based data access in the bicep template

I have the below as the bicep template, I want to use the identity based connection, how can I build the template accordingly. https://learn.microsoft.com/en-us/azure/azure-functions/functions-reference#connecting-to-host-storage-with-an-identity I…
0
votes
2 answers

Bicep deletes "existing" key vault resource

In my Bicep file, I'm using an Azure KeyVault resource like so: resource kv 'Microsoft.KeyVault/vaults@2021-04-01-preview' existing = { name: kvName scope: resourceGroup(subscriptionId, resourceGroup().name) } module db 'modules/database.bicep'…
Alexander Skwar
  • 875
  • 1
  • 9
  • 20
0
votes
1 answer

Use @decorators in Bicep for params of type object?

With a "simple" param in Bicep, I can use @decorators for some sort of "validation", like so: @minLength(3) @maxLength(20) @description('Name of database administrator') param dbAdminUsername string = 'dbadmin' This would force the dbAdminUsername…
Alexander Skwar
  • 875
  • 1
  • 9
  • 20
0
votes
1 answer

Run bicep in Complete mode by default?

By default, when running something like az deployment group create --template-file xyz.bicep ..., bicep is in "Incremental" mode. Because of this, it might happen that things get added while they should've been simply changed. With --mode Complete,…
Alexander Skwar
  • 875
  • 1
  • 9
  • 20
0
votes
1 answer

Setting Administrator for AAD PostgreSQL

Bicep version Bicep CLI version 0.3.255 (589f037) Describe the bug I am trying to set an Active Directory Admin for an PostgreSQL server via Bicep. I am able to create the PostgreSQL server but there is no documentation regarding a type for example…
ScuffedCoder
  • 376
  • 1
  • 5
  • 21
0
votes
2 answers

Using secret variable in Azure CLI task in release pipeline

In my release pipeline I have two variables adminLogin and adminPassword that are marked as secret. I have a task of type Azure CLI@2 in the same release pipeline. It is an inline Powershell Core script running on a Ubuntu agent (I tried the windows…