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
With Bicep CLI version 0.27.1 or newer, you can publish a module with the Bicep source code in addition to the compiled JSON template. If a module is published with the Bicep source code to a registry, you can press `F12` ([Go to Definition](./visual-studio-code.md#go-to-definition)) from Visual Studio Code to see the Bicep Code. The Bicep extension version 0.27 or new is required to see the Bicep file.
To run this deployment command, you must have the [latest version](/cli/azure/install-azure-cli) of Azure CLI.
87
+
88
+
```azurecli
89
+
az bicep publish --file storage.bicep --target br:exampleregistry.azurecr.io/bicep/modules/storage:v1 --documentationUri https://www.contoso.com/exampleregistry.html --with-source
90
+
```
91
+
92
+
---
93
+
94
+
With the with source switch, you see an additional layer in the manifest:
95
+
96
+
:::image type="content" source="./media/private-module-registry/bicep-module-with-source-manifest.png" lightbox="./media/private-module-registry/bicep-module-with-source-manifest.png" alt-text="Screenshot of bicep module registry with source.":::
97
+
98
+
Note that if the Bicep module references a module in a Private Registry, the ACR endpoint will be visible. To hide the full endpoint, you can configure an alias for the private registry.
99
+
76
100
## View files in registry
77
101
78
102
To see the published module in the portal:
79
103
80
104
1. Sign in to the [Azure portal](https://portal.azure.com).
81
105
1. Search for **container registries**.
82
106
1. Select your registry.
83
-
1. Select **Repositories** from the left menu.
107
+
1. Select **Services** -> **Repositories** from the left menu.
84
108
1. Select the module path (repository). In the preceding example, the module path name is **bicep/modules/storage**.
85
109
1. Select the tag. In the preceding example, the tag is **v1**.
86
110
1. The **Artifact reference** matches the reference you'll use in the Bicep file.
Copy file name to clipboardExpand all lines: articles/azure-resource-manager/bicep/visual-studio-code.md
+6-2Lines changed: 6 additions & 2 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -3,7 +3,7 @@ title: Create Bicep files by using Visual Studio Code
3
3
description: Describes how to create Bicep files by using Visual Studio Code
4
4
ms.topic: conceptual
5
5
ms.custom: devx-track-bicep
6
-
ms.date: 06/05/2023
6
+
ms.date: 05/10/2024
7
7
---
8
8
9
9
# Create Bicep files by using Visual Studio Code
@@ -121,10 +121,14 @@ When your Bicep file uses modules that are published to a registry, the restore
121
121
122
122
## View type document
123
123
124
-
From Visual Studio Code, you can easily open the template reference for the resource type you're working on. To do so, hover your cursor over the resource symbolic name, and then select **View type document**.
124
+
From Visual Studio Code, you can open the template reference for the resource type you're working on. To do so, hover your cursor over the resource symbolic name, and then select **View type document**.
125
125
126
126
:::image type="content" source="./media/visual-studio-code/visual-studio-code-bicep-view-type-document.png" alt-text="Screenshot of Visual Studio Code Bicep view type document.":::
127
127
128
+
## Go to definition
129
+
130
+
When defining a [module](./modules.md), regardless of the types of the referenced file - whether it is a local file, module registry file, template spec, you can open the referenced file by selecting or highlighting the module path and then press **[F12]**. If the referenced file is an [Azure Verified Modules(AVM)](https://aka.ms/avm), you can toggle between compiled JSON or Bicep file. To be able 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). The Visual Studio Code Bicep extension version 0.27.1 or newer is required for opening Bicep file from private module registry.
131
+
128
132
## Paste as Bicep
129
133
130
134
You can paste a JSON snippet from an ARM template to Bicep file. Visual Studio Code automatically decompiles the JSON to Bicep. This feature is only available with the Bicep extension version 0.14.0 or newer. This feature is enabled by default. To disable the feature, see [VS Code and Bicep extension](./install.md#visual-studio-code-and-bicep-extension).
0 commit comments