Deploying the template
You are now ready to add the final step to deploy your template.
Adding the deployment step
You will need the following step for the deployment. It is your choice to either add this as a separate step or simply put it at the end of the validation step as an additional command:
- task: AzureCLI@2 displayName: Validate deployment inputs: azureSubscription: $(azureServiceConnection) scriptType: bash scriptLocation: inlineScript inlineScript: | az deployment group create --name BicepDeployment --resource-group $(resourceGroupName) --template-file $(templateFile)
Note that we just had to replace what-if
with create
to be able to deploy our template in our step. You need to commit your new changes and push them to your repository.
You can also merge the steps to make your template a bit cleaner:
...