tmaj
tmaj

Reputation: 34987

Azure Bicep in DevOps release pipeline

I have an existing Azure DevOps release pipeline that deploys resources using Azure CLI to multiple environments DEV, TEST, PROD.

enter image description here

I'd like to switch gradually to using Bicep files.

Microsoft's Quickstart: Integrate Bicep with Azure Pipelines shows how to build a build pipeline using an inline CLI scipt, but I wasn't able to find help on how to setup a bicep task in a release pipeline.

There are no official bicep tasks for release pipelines like there are for ARM files.

Do I need to use a Azure CLI script task type to run something like az deployment group create --resource-group $(resourceGroupName) --template-file $(templateFile) --parameters "{ \"someparameter1\": { \"value\": \"$(someparameter1)\" } }"?

Upvotes: 0

Views: 2941

Answers (2)

Andres Namm
Andres Namm

Reputation: 309

Here is a really good tutorial that provides an answer to your question https://learn.microsoft.com/en-us/learn/paths/bicep-azure-pipelines/ It's also very well written.

Upvotes: 0

JukkaK
JukkaK

Reputation: 1175

Bicep is a domain-specific language that compiles into ARM-templates, so you have (at least) two possible approaches here:

either you deploy bicep templates with the az deployment group create -command without building them (in which case the az -command compiles Bicep into an ARM-template and deploys that)

OR

you compile the bicep template yourself with bicep build (or az bicep build) and deploy the ARM-template it creates like you have deployed them before.

The first approach is more straightforward, the latter might fit better to your existing approach if you have, for example, existing separate build and release pipelines or utilize some kind of testing for the ARM-templates before deploying them.

Upvotes: 4

Related Questions