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
3
votes
2 answers

How can I get Azure Functions keys from Bicep

I have the following code to create an Azure Function App with Bicep lang resource webSite 'Microsoft.Web/sites@2022-03-01' = { name: 'xxxxxx' location: resourceGroup().location kind: 'functionapp' properties: { serverFarmId: 'zzzzzz' …
Sergio
  • 175
  • 5
  • 21
3
votes
1 answer

How to check is a KeyVault secret already exists in bicep file

I have bicep files that contains a KeyVault module, and a SQL server module. In the SQL server bicep file, I run a deploymentScript which runs a PowerShell script to generator a password and adds it as a secret within the KeyVault. This password is…
Ross
  • 2,463
  • 5
  • 35
  • 91
3
votes
0 answers

Azure Bicep - Best practice with regards to noisy what-if output

I am creating a deployment on Azure from scratch consisting of various resources, e.g., Application Gateway, AKS cluster, Managed Identities. When checking az what-if after deploying, I can see some unexpected noise. I know that the team is working…
3
votes
1 answer

How to provide different param files depends on environment deployment in Bicep?

I am building new Bicep infrastructure, I want to split my resources into separate bicep files and use the module way to have a cleaner structure, this way I will only be deploying main.bicep, but I am having problems passing environment specific…
Mocas
  • 1,403
  • 13
  • 20
3
votes
1 answer

Add certificate from Azure Keyvault to Azure Container Environment with Bicep

I need a mechanism to download a .pfx certificate from Keyvault and to then upload it to an Azure Container Environment, all via Bicep. This will minimise any manual intervention when the certificate is updated. I am currently adding a certificate…
3
votes
1 answer

Get Log Analytics Workspace key from Bicep

In a bicep file for an App Service, I want to grab the id and key from an existing Log Analytic Workbench, created in another repo/bicep file. I see this is possible in Terraform, but cannot find any docs on how to achieve this with Bicep, which…
3
votes
1 answer

Bicep deploys a Linux App Service Plan regardless of Kind defined

I'm trying to deploy a windows app service plan through a BICEP script. It deploys successfully with no issues/warnings/error. Even though I have the 'Kind:' set to windows it still results in a Linux App plan. Below is my BICEP code. New to…
3
votes
0 answers

Create a resource ONLY IF that does not exist

I have the following bicep file to create an Azure Function App with a staging slot: module functionAppTemplate 'functionApp.bicep' = { name: 'functionAppTemplate' params: { name: '${functionAppName}' kind: functionAppKind location:…
user989988
  • 3,006
  • 7
  • 44
  • 91
3
votes
1 answer

How to create a nested resource based on a condition in a bicep file?

I have a bicep file that accepts a param topic object object that looks like this: name: 'topic name' subscriptions: [ { name: 'subscriptionName' ruleName: 'name of the rule' } ] Next I am going to create the resources: resource…
Martijn
  • 24,441
  • 60
  • 174
  • 261
3
votes
3 answers

Bicep module reference as a parent in another resource

I am trying to reference and existing bicep module as a parent of another resource. module vnethub 'modules/vnet/vnet.bicep' = { scope: resourceGroup(rg.name) name: 'hub-VNet' params: { vnetAddressSpace: { addressPrefixes:…
Lance Lyons
  • 31
  • 1
  • 2
3
votes
1 answer

Azure App Configuration Store - Setting label on keyvalues using Bicep

I'm trying to add values to an Azure App Configuration Store using Bicep. I have an issue where I add a label to a keyValue. This is my module: @description('Configuration Store Name') param configurationStoreName string @description('key…
3
votes
1 answer

Set the platform to 64 bit in ARM template

I have the following arm template: resource functionApp 'Microsoft.Web/sites@2018-02-01' = { name: name location: location kind: kind properties: { serverFarmId: resourceId('Microsoft.Web/serverfarms', servicePlanName) …
user989988
  • 3,006
  • 7
  • 44
  • 91
3
votes
1 answer

azure bicep template with module doing a union of web slot config appsettings

I am trying to get a list of my current sites/slot app config and then combining it with a union so I don't overwrite the current deployed configuration. I am able to do this with the sites config but cannot with the deploy slot. Here is an example…
3
votes
1 answer

How to reference an object in an array of objects using Bicep

I am trying to output the referenceId of each subnet in a module that creates a virtual network with 4 subnets. I can get the first one, [0], but when I try output the others, [1], [2], [3] the deployment fails and throws the error: The language…
phydeauxman
  • 1,432
  • 3
  • 26
  • 48
3
votes
2 answers

How to create Azure Front Door Standard/Premium with custom domain using Bicep?

In the classic Azure Front Door you can just point a DNS CNAME to your Front Door and validate it. In the new Azure Front Door Standard/Premium a CNAME must be validated using a TXT record on your DNS. When creating a domain with a Bicep script in a…
1 2
3
45 46