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/deploy-vscode.md
+5-3Lines changed: 5 additions & 3 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -2,19 +2,21 @@
2
2
title: Deploy Bicep files with Visual Studio Code
3
3
description: Learn how to use Visual Studio Code to deploy Bicep files.
4
4
ms.topic: how-to
5
-
ms.date: 01/10/2025
5
+
ms.date: 03/19/2025
6
6
ms.custom: devx-track-bicep
7
7
---
8
8
9
9
# Deploy Bicep files with Visual Studio Code
10
10
11
-
You can use [Visual Studio Code with the Bicep extension](./visual-studio-code.md#deploy-bicep-file-command) to deploy a Bicep file. You can deploy to any scope. This article shows how to deploy to a resource group.
11
+
You can use [Visual Studio Code with the Bicep extension](./visual-studio-code.md#deploy-bicep-file-command) to deploy a Bicep file. Additionally, Bicep files can also be deployed from deployment pane. For more information, see [Deployment pane](./visual-studio-code.md#deployment-pane).
12
+
13
+
You can deploy to any scope. This article shows how to deploy to a resource group.
12
14
13
15
There are three ways you can find the command from an open Bicep file in Visual Studio Code:
14
16
15
17
- Right-click the Bicep file name from the Explorer pane instead of the one under **OPEN EDITORS**:
16
18
17
-
:::image type="content" source="./media/deploy-vscode/bicep-deploy-from-explorer.png" alt-text="Screenshot of Deploying Bicep File in the Context menu from the explore pane.":::
19
+
:::image type="content" source="./media/deploy-vscode/bicep-deploy-from-explorer.png" alt-text="Screenshot of Deploying Bicep File in the Context menu from the explorer pane.":::
18
20
19
21
- Right-click anywhere inside a Bicep file, and then select **Deploy Bicep File**.
Copy file name to clipboardExpand all lines: articles/azure-resource-manager/bicep/deploy-what-if.md
+1-1Lines changed: 1 addition & 1 deletion
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -10,7 +10,7 @@ ms.date: 09/26/2024
10
10
11
11
Before deploying a Bicep file, you can preview the changes that will happen. Azure Resource Manager provides the what-if operation to let you see how resources will change if you deploy the Bicep file. The what-if operation doesn't make any changes to existing resources. Instead, it predicts the changes if the specified Bicep file is deployed.
12
12
13
-
You can use the what-if operation with Azure PowerShell, Azure CLI, or REST API operations. What-if is supported for resource group, subscription, management group, and tenant level deployments.
13
+
You can use the what-if operation with [Visual Studio Code](./visual-studio-code.md#deployment-pane), Azure PowerShell, Azure CLI, or REST API operations. What-if is supported for resource group, subscription, management group, and tenant level deployments.
14
14
15
15
During What-If operations, the evaluation and expansion of `templateLink` aren't supported. As a result, any resources deployed using template links within nested deployments, including template spec references, won't be visible in the What-If operation results.
-[Show Deployment Pane to the Side](#show-deployment-pane-command)
41
41
42
42
These commands are also shown in the context menu when you right-click a Bicep file:
43
43
@@ -191,13 +191,11 @@ You can undo the decompilation by pressing **<kbd>Ctrl+Z</kbd>**. The original J
191
191
192
192
### Restore Bicep Modules command
193
193
194
-
When your Bicep file uses modules that are published to a registry, the `restore` command gets copies of all the required modules from the registry. It stores those copies in a local cache. See [restore](./bicep-cli.md#restore) for more information and an example.
194
+
When your Bicep file uses modules that are published to a registry, the `restore` command gets copies of all the required modules from the registry. It stores those copies in a local cache. For more information and an example, see [restore](./bicep-cli.md#restore).
195
195
196
196
### Show Deployment Pane command
197
197
198
-
The Deployment Pane is an experimental feature in Visual Studio Code. See [Using the Deployment Pane (Experimental!)](https://github.com/Azure/bicep/blob/main/docs/experimental/deploy-ui.md) to learn more.
199
-
200
-
You can open the Deployment Pane side by side with the Bicep file.
198
+
See [Deployment pane](#deployment-pane).
201
199
202
200
## Use quick fix suggestions
203
201
@@ -245,6 +243,74 @@ From Visual Studio Code, you can open the template reference for the resource ty
245
243
246
244
When defining a [module](./modules.md) and regardless of the type of file that's being referenced - a local file, module registry file, or a template spec - you can open the file by selecting or highlighting the module path and pressing **[F12]**. If the referenced file is an [Azure Verified Module, an AVM](https://aka.ms/avm), then you can toggle between the compiled JSON or Bicep file. To open the Bicep file of a private registry module, ensure that the module is published to the registry with the `WithSource` switch enabled. For more information, see [Publish files to registry](./private-module-registry.md#publish-files-to-registry). Visual Studio Code Bicep extension version 0.27.1 or newer is required for opening Bicep files from a private module registry.
247
245
246
+
## Deployment pane
247
+
248
+
The Deployment Pane is a UI panel that lets you connect to your Azure subscription and perform validate, deploy, and what-if operations, providing instant feedback without leaving the editor.
249
+
250
+
To use deployment pane:
251
+
252
+
1. Open a `.bicep` or `.bicepparam` file in VS Code.
253
+
1. There are two ways to open the deployment pane:
254
+
255
+
- Select the show deployment pane button on the upper right corner as shown in the following screenshot:
256
+
257
+
:::image type="content" source="./media/visual-studio-code/visual-studio-code-open-deployment-pane.png" alt-text="Sceenshot of the open deployment pane button.":::
258
+
259
+
By default, VS Code opens the deployment pane on the side. To open it in a new tab, hold <kbd>Alt</kbd> while selecting the button.
260
+
261
+
- Another way to open the deployment pane is through the command palette. Press <kbd>Ctrl</kbd>+<kbd>Shift</kbd>+<kbd>P</kbd>, then select either **Show Deployment Pane** or **Show Deployment Pane to the Side**.
262
+
263
+
:::image type="content" source="./media/visual-studio-code/visual-studio-code-show-deployment-pane.png" alt-text="Sceenshot of show deployment pane in command palette.":::
264
+
265
+
The following screenshot shows a successful deployment with the Bicep file validation results.
266
+
267
+
:::image type="content" source="./media/visual-studio-code/visual-studio-code-deployment-pane.png" alt-text="Sceenshot of deployment pane in Visual Studio Code.":::
268
+
269
+
1. Select **Change Scope** to define the deployment scope. After authentication, you're able to select the subscription and the resource group of your desired deployment.
270
+
1. Select **Pick JSON Parameters File** to select a JSON parameter file.
271
+
1. Select your desired action - **Deploy**, **Validate**, or **What-if**.
272
+
273
+
-**Deploy**: deploys to Azure, and the result including the defined output are shown in the deployment pane.
274
+
-**Validate**: performs a runtime validation of the Bicep file against Azure, ensuring that the resources, parameters, and policies are correct in the actual deployment environment. Unlike a [linter](./linter.md), which only checks for syntax errors, this validation interacts with Azure to detect potential deployment issues. It's equivalent to the validate command in Azure CLI and the Test command in Azure PowerShell. For example:
275
+
276
+
# [Azure CLI](#tab/azure-cli)
277
+
278
+
```azurecli
279
+
az deployment group validate --resource-group <resource-group-name> --template-file <template-file-path>
- **What-if**: executes a **What-If** analysis directly from the deployment pane. The pane displays the results, showing any planned changes. This performs the same function as the what-if command in Azure PowerShell and Azure CLI. For example:
291
+
292
+
# [Azure CLI](#tab/azure-cli)
293
+
294
+
```azurecli
295
+
az deployment group what-if --resource-group <resource-group-name> --template-file <template-file-path>
0 commit comments