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

Bicep Generate GUID

I am learning about bicep and how to use to deploy azure resources. I have been working on key vault deployment as follow: resource keyVault 'Microsoft.KeyVault/vaults@2021-06-01-preview' existing = { name: keyVaultName } // Create key vault…
Nayden Van
  • 1,133
  • 1
  • 23
  • 70
3
votes
3 answers

App Service Managed Identity and Key Vault the right way

I am currently trying to deploy out a resource group using azure bicep, however, I am running into an issue using key vault for my azure app service. I would like to know if I am actually doing this the correct way. I have a main bicep file that is…
3
votes
1 answer

How to access/cast the module output to spefic object in bicep?

I am having below bicep which is returning keyvault. I like to access the properties/functions in keyvault in parent bicep. But not sure how to achieve when using it as a module. I have keyvault.bicep resource kv…
3
votes
1 answer

Is there a way to generate a bicep file for an existing Azure resource?

I'm in the process of creating bicep files for our current Azure resources. Is there a way to generate a bicep file from an existing azure resource, say a storage account or an app service?
SamIAm
  • 2,241
  • 6
  • 32
  • 51
3
votes
1 answer

setting null value for defaultTTL for azure cosmos bicep

Hi I have tried to turn off the TTL for Azure cosmos. I know that it could be turn off by Not include defaultTtl in the code. However I have conditional deployment, I have a loop that check for tenant name to create cosmos container, if it equal to…
3
votes
0 answers

Application Gateway: ResourceNotFound during AKS provisioning (bicep)

When we deploy our environment with e.g. AKS and Application Gateway through bicep, we get sometimes this error during AKS provisioning: { "status": "Failed", "error": { "code": "ResourceNotFound", "message": "The Resource…
3
votes
1 answer

How to deploy App Service + Certificate + hostbinding at the same time with bicep?

I'm having trouble deployed an hostNameBinding with a certificate at the same time with this code: param appserviceplanId string param location string param appservicename string param domain string resource appservice…
Marcel
  • 954
  • 8
  • 22
3
votes
1 answer

Azure Bicep Modules: Can modules be referenced from a separate repo?

Functioning Code Using Terraform I am more familiar with Terraform, where I can do something like: module "storagemod" { source = "git::https://MyProj@dev.azure.com/MyProj/Dataplatform/_git/myrepo//storage-account?ref=v0.2.0" rg_name = "MyRG" …
Mike Williamson
  • 4,915
  • 14
  • 67
  • 104
3
votes
1 answer

Azure Bicep - Conditionally create a secret

I'm creating a KeyVault with Bicep and I want to create a secret in the vault, but only when there's no secret yet with the given name. Checking if the KeyVault exists wasn't working, so I'm checking now if certain tag exists. When creating the…
user15830778
  • 31
  • 1
  • 3
3
votes
5 answers

Azure Bicep comparison with ARM template

I read something about Azure Bicep, it is something new I feel - Azure Resource Manager and ARM Templates are written in a JSON syntax that can be cumbersome to work with. Azure Bicep is a Domain Specific Language (DSL) that offers a transparent…
Aatif Akhter
  • 2,126
  • 1
  • 25
  • 46
2
votes
1 answer

Azure bicep testing with terratest fails

I' having this kind of issue: This is my test case to test against azure resource created or no. package test import ( "testing" "github.com/gruntwork-io/terratest/modules/azure" "github.com/stretchr/testify/assert" ) func…
Hayk Mkhitaryan
  • 388
  • 9
  • 26
2
votes
1 answer

azure bicep to create a container app with an image from secure registry

I would like to create an azure container app that pulls its image from an existing azure container app registry that sits in a different subscription. My main bicep: creates a user assigned managed identity grants the ACR Pull RBAC role for the…
2
votes
1 answer

Cannot use bicepparam file in Azure deployment

I am trying to use a .bicepparam parameter file in my Azure CLI deployment and I get an error of unrecognized template parameter 'using './test.bicep'. My deployment does work if I use a traditional ARM parameter JSON file. Is this a problem with my…
2
votes
1 answer

Trying to get the IP address of an Azure DNS inbound endpoint through bicep

I'm currently working on an Azure deployment and running into a inconvenience. I need to get the IP address of an dns Inboud Endpoint. This resource already exists. I can reference the resource like this: param dnsInboundEndpointName string resource…
GetShifting
  • 461
  • 4
  • 12
2
votes
0 answers

Azure APIM: How to update apiRevision of an Api and set it to Current while deploying it through Bicep?

I need to deploy an API to APIM, update its revision and make it current. I am looking for best practices to do this (i.e., updating an api), and to achieve it using Azure DevOps. Also, I have below questions, My backing API service (Azure…
user527614
  • 465
  • 5
  • 19