|
2 | 2 | title: CI/CD with Azure Pipelines and Bicep files
|
3 | 3 | description: In this quickstart, you learn how to configure continuous integration in Azure Pipelines by using Bicep files. It shows how to use an Azure CLI task to deploy a Bicep file.
|
4 | 4 | ms.topic: quickstart
|
5 |
| -ms.date: 02/23/2022 |
| 5 | +ms.date: 08/03/2022 |
6 | 6 | ---
|
7 | 7 |
|
8 | 8 | # Quickstart: Integrate Bicep with Azure Pipelines
|
@@ -39,7 +39,50 @@ You need a [Bicep file](./quickstart-create-bicep-use-visual-studio-code.md) tha
|
39 | 39 |
|
40 | 40 | 
|
41 | 41 |
|
42 |
| -## Azure CLI task |
| 42 | +## Deploy Bicep files |
| 43 | + |
| 44 | +You can use Azure Resource Group Deployment task or Azure CLI task to deploy a Bicep file. |
| 45 | + |
| 46 | +### Use Azure Resource Group Deployment task |
| 47 | + |
| 48 | +Replace your starter pipeline with the following YAML. It creates a resource group and deploys a Bicep file by using an [Azure Resource Group Deployment task](/azure/devops/pipelines/tasks/deploy/azure-resource-group-deployment): |
| 49 | + |
| 50 | +```yml |
| 51 | +trigger: |
| 52 | +- master |
| 53 | + |
| 54 | +name: Deploy Bicep files |
| 55 | + |
| 56 | +variables: |
| 57 | + vmImageName: 'ubuntu-latest' |
| 58 | + |
| 59 | + azureServiceConnection: '<your-connection-name>' |
| 60 | + resourceGroupName: 'exampleRG' |
| 61 | + location: '<your-resource-group-location>' |
| 62 | + templateFile: './main.bicep' |
| 63 | +pool: |
| 64 | + vmImage: $(vmImageName) |
| 65 | + |
| 66 | +steps: |
| 67 | +- task: AzureResourceManagerTemplateDeployment@3 |
| 68 | + inputs: |
| 69 | + deploymentScope: 'Resource Group' |
| 70 | + azureResourceManagerConnection: '$(azureServiceConnection)' |
| 71 | + action: 'Create Or Update Resource Group' |
| 72 | + resourceGroupName: '$(resourceGroupName)' |
| 73 | + location: '$(location)' |
| 74 | + templateLocation: 'Linked artifact' |
| 75 | + csmFile: '$(templateFile)' |
| 76 | + overrideParameters: '-storageAccountType Standard_LRS' |
| 77 | + deploymentMode: 'Incremental' |
| 78 | + deploymentName: 'DeployPipelineTemplate' |
| 79 | +``` |
| 80 | +
|
| 81 | +For the descriptions of the task inputs, see [Azure Resource Group Deployment task](/azure/devops/pipelines/tasks/deploy/azure-resource-group-deployment). |
| 82 | +
|
| 83 | +Select **Save**. The build pipeline automatically runs. Go back to the summary for your build pipeline, and watch the status. |
| 84 | +
|
| 85 | +### Use Azure CLI task |
43 | 86 |
|
44 | 87 | Replace your starter pipeline with the following YAML. It creates a resource group and deploys a Bicep file by using an [Azure CLI task](/azure/devops/pipelines/tasks/deploy/azure-cli):
|
45 | 88 |
|
@@ -71,12 +114,7 @@ steps:
|
71 | 114 | az deployment group create --resource-group $(resourceGroupName) --template-file $(templateFile)
|
72 | 115 | ```
|
73 | 116 |
|
74 |
| -The Azure CLI task takes the following inputs: |
75 |
| -
|
76 |
| -* `azureSubscription`, provide the name of the service connection that you created. See [Prerequisites](#prerequisites). |
77 |
| -* `scriptType`, use **bash**. |
78 |
| -* `scriptLocation`, use **inlineScript**, or **scriptPath**. If you specify **scriptPath**, you'll also need to specify a `scriptPath` parameter. |
79 |
| -* `inlineScript`, specify your script lines. The script provided in the sample deploys a Bicep file called *main.bicep*. |
| 117 | +For the descriptions of the task inputs, see [Azure CLI task](/azure/devops/pipelines/tasks/deploy/azure-cli). |
80 | 118 |
|
81 | 119 | Select **Save**. The build pipeline automatically runs. Go back to the summary for your build pipeline, and watch the status.
|
82 | 120 |
|
|
0 commit comments