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

How to output resource id in bicep

How to output resource id in bicep, while creating the subnet how do we get the output string, virtual network syntax s shown below resource virtualNetwork 'Microsoft.Network/virtualNetworks@2019-11-01' = { name: vnetName location:…
5
votes
1 answer

Output newly created function app key using Bicep

I have a bicep template that creates a function app in a dedicated module. I would like out the function app key from the module. Anyone know how I can get the function key? I can't find it in the list of properties:
Rob Bowman
  • 7,632
  • 22
  • 93
  • 200
5
votes
2 answers

Arm Template (Bicep): Circular Dependency when merging appsettings (list function)

I'm trying to update the AppSettings of an App Service through a bicep file. When doing this in my bicep template: var currentAppSettings = list('Microsoft.Web/sites/appServiceName/config/appsettings', '2018-11-01') var newAppSettings = { test:…
4
votes
0 answers

Azure RunCommand exit with -1

I am deploying a RunCommand to an azure vm (ubuntu) using ARM (bicep). I can see my script never completes, and this is the output from the log that the waaagent keeps: sudo cat /var/log/azure/run-command-handler/handler.log Writing a placeholder…
4
votes
2 answers

How to reference System Assigned Identity in Bicep when deploying Key Vault Access Policy

For a project I want to deploy three related resources to Azure through Bicep templates: 1) App Service with System Assigned Managed Identity, 2) Key Vault and 3) Access policy for the App Service (step 1) to the Key Vault (step 2). The AppService…
JJuice
  • 1,015
  • 2
  • 12
  • 21
4
votes
1 answer

get output from module called in a loop in bicep

How can I retrieve the output variable from a module called in a loop? I like to add subnets in the next step to the vnet. Main.bicep module vnet01 'vNet.bicep' = [ for vnet in vnets : { name: vnet.name scope: virtualNetworkRg …
Stefan
  • 555
  • 5
  • 18
4
votes
2 answers

How to get the host url of a linux app service in azure bicep deployment templates

I've created an app service using a bicep resource shown below name: '${appName}' location: location kind: 'linux,container,fnapp' properties: { serverFarmId: servicePlan.id siteConfig: { linuxFxVersion:…
4
votes
1 answer

Bicep template create containers within a storage account

I have created a bicep template to create two storage accounts. How to create a container within the storage accounts. param rgLocation string = resourceGroup().location param storageNames array = [ 'storage1' 'storage2' ] resource…
tommyt
  • 309
  • 5
  • 15
4
votes
1 answer

Azure App Configuration - Conditionally create feature flag using bicep

I plan to use the Feature Management functionality within Azure App Configuration service. Using bicep I create the configuration store. Template:…
4
votes
1 answer

How can I combine dynamic settings and static settings in a Function App using Bicep?

I am trying to defines settings (static and dynamic) for a Function App using Bicep. The following is the module that generates the Function App itself. This module contains a loop that creates a collection of dynamic settings (which does…
Kzryzstof
  • 7,688
  • 10
  • 61
  • 108
4
votes
4 answers

netFrameworkVersion in Azure App Services Api App

I'm configuring a api app in azure with bicep. This is a dotnet core 3.1 app. For netFrameworkVersion i provide 'v3.1', this however doesn't work. The deployment of the Bicep template does work, but my application does not. The value of .NET version…
4
votes
1 answer

Azure Bicep - Conditionally adding elements to an array

I am trying to create a bicep template to deploy a VM with either 1 or 2 NICs depending on a conditional. Anyone know if there is a way to deploy a VM NIC using conditional statements inside a property definition? Seems an if function is not…
Mark Bez
  • 53
  • 1
  • 3
4
votes
2 answers

How can I create an array of subnets on an existing vnet using Bicep?

In my bicep file I obtain a reference to the existing vnet like this: resource existingVNET 'Microsoft.Network/virtualNetworks@2021-02-01' existing = { name: 'the-existing-vnet' } I have tried to include multiple (four to be exact) resource…
Caad9Rider
  • 654
  • 1
  • 8
  • 16
4
votes
4 answers

Bicep: Creating random string

I'm coming from a Terraform background and AWS. Now I'm using Bicep with Azure, so please bear with me :) In Terraform, we create random passwords with the random_password resource. We then stored this as a value in the AWS Systems Manager Parameter…
Alexander Skwar
  • 875
  • 1
  • 9
  • 20
4
votes
3 answers

Creating several roles definition and assignment with Bicep template for Azure Cosmos DB

I try to create two role definitions and two role assignments to one Azure CosmosDB SQL API account using Bicep template. I decompiled below arm template with az bicep…
gorrch
  • 521
  • 3
  • 16
1
2
3
45 46