0
votes

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)\" } }"?

1
for the moment, you need to use the Az CLI task.Thomas
That quickstart is actually showing you a release pipeline; it's not doing any building, just deploying azure resources.Vince Bowdren

1 Answers

2
votes

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.