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
12
votes
1 answer

How do I use Bicep (or ARM) to create an AD app registration and roles?

I'm using Terraform to create app registration and roles for our apps. But I cannot figure out how to do the same with Bicep. This is what's used today: Step 1. Register the app in Active Directory, effectively creating an "app…
11
votes
2 answers

Get the Service Bus SharedAccessKey Programatically Using Bicep

I am using bicep to create azure resources. One of these resources is a service bus and this is defined as follows: resource service_bus 'Microsoft.ServiceBus/namespaces@2021-01-01-preview' = { name:…
gatapia
  • 3,574
  • 4
  • 40
  • 48
9
votes
2 answers

Retrieve storage account access keys from a bicep module

is it possible to retrieve a Storage Account's Access Key when deploying the Storage Account via a Bicep module? My parent bicep creates a storage account using a module file, and it then needs an Access Key but I cannot get it working in a way…
9
votes
2 answers

How to delete bicep template and the resources it has deployed

How can I delete or update bicep template and all the resources it has deployed? just like we can delete or update cloudformation and terraform template az deployment commands don't have update option and while using az deployment delete it does not…
Jazib Humayun
  • 111
  • 1
  • 2
9
votes
2 answers

How to write a variable/parameter to stdout?

I'm trying to debug my first Bicep template. How can I just write a variable or parameter value to standard output? Something like: var hello = 'hello world!' write-host(hello)
Nathan
  • 6,095
  • 2
  • 35
  • 61
8
votes
1 answer

Create Azure Resource Group using Bicep

I'm trying to create an Azure Resource Group using a .bicep file: targetScope = 'subscription' param environment string param location string = deployment().location resource resourceGroup 'Microsoft.Resources/resourceGroups@2021-04-01' = { …
Sergiu Molnar
  • 865
  • 1
  • 11
  • 22
7
votes
1 answer

Is there a workaround to keep app settings which not defined in Bicep template?

main.bicep resource appService 'Microsoft.Web/sites@2020-06-01' = { name: webSiteName location: location properties: { serverFarmId: appServicePlan.id siteConfig: { linuxFxVersion: linuxFxVersion appSettings: [ { …
7
votes
1 answer

What is the difference between 'xml' and 'rawxml' formats when defining APIM policies in ARM/Bicep Templates

When defining an Azure API Management policy in a Bicep or ARM template, the format of the policy value may be set to rawxml (and rawxml-link) or xml (and xml-link). I know what the link formats are, however there is an unclear difference between…
Ijwu
  • 342
  • 1
  • 2
  • 8
7
votes
2 answers

Create Azure Connection API with Connection Runtime Url

I have a logic App (a standard logic app) that make a call to cosmos DB. I need to store the "Connection Runtime Url" under the configuration of the logic App. When I create the connection from the logic app designer, the connection have this…
6
votes
1 answer

Azure Bicep - Object reference not set to an instance

I'm trying to create a simple App Service Plan with the below code. param Location string = 'eastus' resource appServicePlan1 'Microsoft.Web/serverfarms@2020-12-01' = { name: 'myasp' location: Location sku: { name: 'S1' capacity: 1 …
Prawin
  • 1,158
  • 2
  • 12
  • 26
5
votes
2 answers

How can I add a custom domain to Azure container app via bicep?

I have a bicep template that creates several container apps. They shall have a custom sub domain in my private DNS zone. However, I have the problem that this leads to a circular dependency: To add the CName and verification TXT record to the DNS…
Thomas F.
  • 717
  • 3
  • 13
5
votes
2 answers

Why is 'dependsOn' not recommended in Bicep?

Microsoft documents the purpose of implicit and explicit dependencies. Where the explicit dependency uses 'dependsOn'. But it is mentioned that use cases for this approach are rare. Could use some clarification on the following: Example from…
givinUp__
  • 53
  • 1
  • 4
5
votes
2 answers

How can I adapt an existing resource with Azure Bicep?

I'm currently porting some infrastructure as code scripts from Azure CLI to Azure Bicep. Among many other things, the Bicep files should create a subnet and allow access from this subnet to an existing Azure SQL Server and an existing Storage…
Fabian Schmied
  • 3,885
  • 3
  • 30
  • 49
5
votes
1 answer

Setting Azure App Service server stack on a Bicep template

I'm trying to deploy a .NET Core 3.1 Azure App Service on Linux using a Bicep template from Azure CLI. The app service and corresponding app service plan are deployed correctly but the app service stack settings are empty on the Azure portal and I…
erionpc
  • 368
  • 3
  • 15
5
votes
1 answer

Azure Bicep multiple scopes in template

After using terraform for a very long time, I decided to start learning azure bicep. So far I am trying to have a grip on the logic. So far I have playing around on deployment of a storage account and keyvault. What I am doing here is the…
Nayden Van
  • 1,133
  • 1
  • 23
  • 70
1
2 3
45 46