You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: articles/azure-resource-manager/bicep/add-template-to-azure-pipelines.md
+23-23Lines changed: 23 additions & 23 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -1,36 +1,36 @@
1
1
---
2
-
title: CI/CD with Azure Pipelines, Bicep, and bicepparam files
3
-
description: In this quickstart, you learn how to configure continuous integration in Azure Pipelines by using Bicep and bicepparam files. It shows how to use an Azure CLI task to deploy a bicepparam file.
2
+
title: 'Quickstart: Integrate Bicep with Azure Pipelines'
3
+
description: This quickstart explains how to use Bicep and `.bicepparam` files to configure continuous integration and continuous deployments in Azure Pipelines, plus how to use an Azure CLI task to deploy a `.bicepparam` file.
4
4
ms.topic: quickstart
5
5
ms.custom: devx-track-bicep, devx-track-azurecli
6
-
ms.date: 09/26/2024
6
+
ms.date: 03/25/2025
7
7
---
8
8
9
9
# Quickstart: Integrate Bicep with Azure Pipelines
10
10
11
-
This quickstart shows you how to integrate Bicep files with Azure Pipelines for continuous integration and continuous deployment (CI/CD).
11
+
This quickstart shows you how to integrate Bicep files with Azure Pipelines for continuous integration and continuous deployment.
12
12
13
-
It provides a short introduction to the pipeline task you need for deploying a Bicep file. If you want more detailed steps on setting up the pipeline and project, see [Deploy Azure resources by using Bicep and Azure Pipelines](/training/paths/bicep-azure-pipelines/).
13
+
It provides a short introduction to the pipeline task you need for deploying a Bicep file. For more detailed steps on setting up the pipeline and project, see the [Deploy Azure resources by using Bicep and Azure Pipelines](/training/paths/bicep-azure-pipelines/) Microsoft Learn module.
14
14
15
15
## Prerequisites
16
16
17
17
If you don't have an Azure subscription, [create a free account](https://azure.microsoft.com/free/) before you begin.
18
18
19
-
You need an Azure DevOps organization. If you don't have one, [create one for free](/azure/devops/pipelines/get-started/pipelines-sign-up). If your team already has an Azure DevOps organization, make sure you're an administrator of the Azure DevOps project that you want to use.
19
+
You also need an Azure DevOps organization. If you don't have one, [create one for free](/azure/devops/pipelines/get-started/pipelines-sign-up). If your team already has an Azure DevOps organization, make sure you're an administrator of the Azure DevOps project that you want to use.
20
20
21
21
You need to have configured a [service connection](/azure/devops/pipelines/library/connect-to-azure) to your Azure subscription. The tasks in the pipeline execute under the identity of the service principal. For steps to create the connection, see [Create a DevOps project](../templates/deployment-tutorial-pipeline.md#create-a-devops-project).
22
22
23
23
You need a [Bicep file](./quickstart-create-bicep-use-visual-studio-code.md) that defines the infrastructure for your project. This file is in a repository.
24
24
25
-
You need a [bicepparam file](/azure/azure-resource-manager/bicep/parameter-files) that defines the parameters used by your bicep file. This file is in a repository.
25
+
You need a ['.bicepparam' file](/azure/azure-resource-manager/bicep/parameter-files) that defines the parameters that your Bicep file uses. This file is in a repository.
26
26
27
27
## Create pipeline
28
28
29
29
1. From your Azure DevOps organization, select **Pipelines** and **Create pipeline**.
30
30
31
31
:::image type="content" source="./media/add-template-to-azure-pipelines/new-pipeline.png" alt-text="Screenshot of creating new pipeline.":::
32
32
33
-
1. Specify where your code is stored. This quickstart uses Azure Repos Git.
33
+
1. Specify where your code is stored. This quickstart uses Azure Repos Git repos.
34
34
35
35
:::image type="content" source="./media/add-template-to-azure-pipelines/select-source.png" alt-text="Screenshot of selecting code source.":::
36
36
@@ -44,17 +44,17 @@ You need a [bicepparam file](/azure/azure-resource-manager/bicep/parameter-files
44
44
45
45
## Deploy Bicep files
46
46
47
-
You can use Azure Resource Group Deployment task or Azure CLI task to deploy a Bicep file.
47
+
You can use an Azure Resource Group deployment task or an Azure CLI task to deploy a Bicep file.
48
48
49
-
### Use Azure Resource Manager Template Deployment task
49
+
### Use Azure Resource Manager template deployment task
50
50
51
51
> [!NOTE]
52
-
> As of version 3.235.0 of the [Azure Resource Manager Template Deployment task](/azure/devops/pipelines/tasks/reference/azure-resource-manager-template-deployment-v3), usage of [bicepparam](/azure/azure-resource-manager/bicep/parameter-files) files is supported.
52
+
> As of [Azure Resource Manager template deployment task](/azure/devops/pipelines/tasks/reference/azure-resource-manager-template-deployment-v3) version 3.235.0, usage of ['.bicepparam'](/azure/azure-resource-manager/bicep/parameter-files) files is supported.
53
53
54
54
> [!NOTE]
55
-
> The `AzureResourceManagerTemplateDeployment@3` task requires both Bicep and bicepparam files be provided when using bicepparam. The Bicep file can reference all supported locations for module references. The bicepparam file must reference the local Bicep file in the `using` statement.
55
+
> The `AzureResourceManagerTemplateDeployment@3` task requires both Bicep and `.bicepparam` files to be provided when using `.bicepparam`. The Bicep file can reference all supported locations for module references. The `.bicepparam` file must reference the local Bicep file in the `using` statement.
56
56
57
-
1. Replace your starter pipeline with the following YAML. It creates a resource group and deploys a Bicep and bicepparam file by using the Azure Resource Manager Template Deployment task.
57
+
1. Replace your starter pipeline with the following YAML. It uses the Azure Resource Manager template deployment task to create a resource group and deploy a Bicep and `.bicepparam` file.
58
58
59
59
```yml
60
60
trigger:
@@ -95,18 +95,18 @@ You can use Azure Resource Group Deployment task or Azure CLI task to deploy a B
95
95
96
96
1. Update the values of `azureServiceConnection` and `location`.
97
97
1. Verify you have a valid `main.bicep` file in your repo.
98
-
1. Verify you have a valid `main.bicepparam` file in your repo that contains a [using](/azure/azure-resource-manager/bicep/bicep-using) statement.
99
-
1. Select **Save**. The build pipeline automatically runs. Go back to the summary for your build pipeline, and watch the status.
98
+
1. Verify you have a valid `main.bicepparam` file in your repo that contains a [`using`](/azure/azure-resource-manager/bicep/bicep-using) statement.
99
+
1. Select **Save**. The build pipeline runs automatically. Go back to the summary for your build pipeline, and watch the status.
100
100
101
101
### Use Azure CLI task
102
102
103
103
> [!NOTE]
104
-
> The [az deployment group create](/cli/azure/deployment/group?view=azure-cli-latest#az-deployment-group-create&preserve-view=true) command requires only a bicepparam file. The `using` statement in the bicepparam file can target any supported location to reference the Bicep file. A Bicep file is only required in your repository when `using` from a local disk path with Azure CLI.
104
+
> The [`az deployment group create`](/cli/azure/deployment/group?view=azure-cli-latest#az-deployment-group-create&preserve-view=true) command requires only a `bicepparam.` file. The `using` statement in the `.bicepparam` file can target any supported location to reference the Bicep file. A Bicep file is only required in your repository when `using` from a local disk path with the Azure CLI.
105
105
106
106
> [!NOTE]
107
-
> When you use a *[bicepparam](/azure/azure-resource-manager/bicep/parameter-files)* file with the [az deployment group create](/cli/azure/deployment/group?view=azure-cli-latest#az-deployment-group-create&preserve-view=true) command, you can't override parameters.
107
+
> When you use a [`.bicepparam`](/azure/azure-resource-manager/bicep/parameter-files) file with the [`az deployment group create`](/cli/azure/deployment/group?view=azure-cli-latest#az-deployment-group-create&preserve-view=true) command, you can't override parameters.
108
108
109
-
1. Replace your starter pipeline with the following YAML. It creates a resource group and deploys a [bicepparam](/azure/azure-resource-manager/bicep/parameter-files) file by using an [Azure CLI task](/azure/devops/pipelines/tasks/reference/azure-cli-v2):
109
+
1. Replace your starter pipeline with the following YAML. It creates a resource group and deploys a [`.bicepparam`](/azure/azure-resource-manager/bicep/parameter-files) file by using an [Azure CLI task](/azure/devops/pipelines/tasks/reference/azure-cli-v2):
110
110
111
111
```yml
112
112
trigger:
@@ -142,23 +142,23 @@ You can use Azure Resource Group Deployment task or Azure CLI task to deploy a B
142
142
--name DeployPipelineTemplate
143
143
```
144
144
145
-
For the descriptions of the task inputs, see [Azure CLI task](/azure/devops/pipelines/tasks/reference/azure-cli-v2). When using the task on air-gapped cloud, you must set the `useGlobalConfig` property of the task to `true`. The default value is `false`.
145
+
For the descriptions of the task inputs, see [Azure CLI v2 task](/azure/devops/pipelines/tasks/reference/azure-cli-v2). When using the task on air-gapped cloud, you must set the `useGlobalConfig` property of the task to `true`. The default value is `false`.
146
146
147
147
1. Update the values of `azureServiceConnection` and `location`.
148
-
1. Verify you have a valid `main.bicepparam` file in your repo that contains a [using](/azure/azure-resource-manager/bicep/bicep-using) statement.
149
-
1. Select **Save**. The build pipeline automatically runs. Go back to the summary for your build pipeline, and watch the status.
148
+
1. Verify you have a valid `main.bicepparam` file in your repo that contains a [`using`](/azure/azure-resource-manager/bicep/bicep-using) statement.
149
+
1. Select **Save**. The build pipeline runs automatically. Go back to the summary for your build pipeline, and watch the status.
150
150
151
151
## Clean up resources
152
152
153
153
When the Azure resources are no longer needed, use the Azure CLI or Azure PowerShell to delete the quickstart resource group.
# Decompile a JSON Azure Resource Manager template to Bicep
@@ -32,9 +32,9 @@ This command creates a file named _main.bicep_ in the same directory as _main.js
32
32
You can also decompile ARM template JSON to Bicep from Visual Studio Code by using the `Decompile into Bicep` command in Visual Studio Code. For more information, see [Decompile into Bicep](./visual-studio-code.md#decompile-into-bicep-command).
33
33
34
34
> [!CAUTION]
35
-
> Decompilation attempts to convert the file, but there is no guaranteed mapping from JSON ARM templates to Bicep. You might need to fix warnings and errors in the generated Bicep file. Or, decompilation can fail if an accurate conversion isn't possible. [Create an issue](https://github.com/Azure/bicep/issues) to report any issues or inaccurate conversions.
35
+
> Decompilation attempts to convert the file, but there is no guaranteed mapping from JSON ARM templates to Bicep. You might need to fix warnings and errors in the generated Bicep file. Otherwise, decompilation can fail if an accurate conversion isn't possible. [Create an issue](https://github.com/Azure/bicep/issues) to report any issues or inaccurate conversions.
36
36
37
-
The decompile and [build](bicep-cli.md#build) commands produce templates that are functionally equivalent. However, they might not be exactly the same during implementation. Converting a template from JSON to Bicep and then back to JSON might produce a template with different syntax than the original template. When deployed, the converted templates produce the same results.
37
+
The decompile and [build](bicep-cli.md#build) commands produce templates that are functionally equivalent. However, they might not be exactly the same during implementation. Converting a template from JSON to Bicep and then back to JSON can produce a template with different syntax than the original template. When deployed, the converted templates produce the same results.
> You can export Bicep files by using the Azure portal. For more information, see [Use Azure portal to export a Bicep file](./export-bicep-portal.md).
171
+
> You can use the Azure portal to export Bicep files. For more information, see [Use Azure portal to export a Bicep file](./export-bicep-portal.md).
172
172
173
173
You can export the template for a resource group and then pass it directly to the `decompile` command. The following examples show how to decompile an exported template:
Copy file name to clipboardExpand all lines: articles/azure-resource-manager/bicep/existing-resource.md
+5-5Lines changed: 5 additions & 5 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -1,16 +1,16 @@
1
1
---
2
2
title: Reference existing resource in Bicep
3
-
description: Describes how to reference a resource that already exists.
3
+
description: Learn how to reference resources that exist.
4
4
ms.topic: conceptual
5
5
ms.custom: devx-track-bicep
6
-
ms.date: 07/11/2024
6
+
ms.date: 03/25/2025
7
7
---
8
8
9
-
# Existing resources in Bicep
9
+
# Reference existing resources in Bicep
10
10
11
11
To reference an existing resource that isn't deployed in your current Bicep file, declare the resource with the `existing` keyword. Use the `existing` keyword when you're deploying a resource that needs to get a value from an existing resource. You access the existing resource's properties through its symbolic name.
12
12
13
-
The resource isn't redeployed when referenced with the `existing` keyword.
13
+
The resource doesn't deploy again when the `existing` keyword references it.
Set the `scope` property to access a resource in a different scope. The following example references an existing storage account in a different resource group.
29
+
Set the `scope` property to access a resource in a different scope. The following example references an existing storage account in a different resource group:
0 commit comments