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/visual-studio-code.md
+39-1Lines changed: 39 additions & 1 deletion
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: Learn how to use Visual Studio Code to create Bicep files.
4
4
ms.topic: how-to
5
5
ms.custom: devx-track-bicep
6
-
ms.date: 12/06/2024
6
+
ms.date: 01/08/2025
7
7
---
8
8
9
9
# Create Bicep files by using Visual Studio Code
@@ -199,6 +199,44 @@ The Bicep Deployment Pane is an experimental feature. For more information, see
199
199
200
200
You can also open the deployment pane side-by-side with the Bicep file.
201
201
202
+
## Use quick fix suggestions
203
+
204
+
The light bulb in VS Code represents a quick fix suggestion. It appears when the editor detects an issue or an improvement opportunity in your code. Clicking on the light bulb displays a menu of actions that can address the issue or enhance the code.
205
+
206
+
:::image type="content" source="./media/visual-studio-code/visual-studio-code-bicep-context-quick-fix-suggestions.png" alt-text="Screenshot of Visual Studio Code quick fix suggestions.":::
207
+
208
+
For the extract commands, see [Extract parameters, variables, and types](#extract-parameters-variables-and-types). In **More Actions**, it suggests adding [decorators](./variables.md#use-decorators).
209
+
210
+
## Extract parameters, variables, and types
211
+
212
+
Extracting [variables](./variables.md), [parameters](./parameters.md), and [user-defined data types](./user-defined-data-types.md) involves isolating and defining these components from existing code to improve code structure, maintainability, and clarity.
213
+
214
+
The following screenshot shows a definition of an AKS cluster resource. You can extract a parameter or a variable, or a user-defined data type based of a property, such as `identity`.
215
+
216
+
Select the `identity` line from the code, and then select the yellow light bulb icon. The context windows shows the available extract options.
217
+
218
+
:::image type="content" source="./media/visual-studio-code/visual-studio-code-azure-variable-parameter-type-extraction.png" alt-text="Screenshot of variable, parameter, type extraction.":::
219
+
220
+
-**Extract variable**: creates a new variable, and give you an option to update the variable name:
221
+
222
+
:::image type="content" source="./media/visual-studio-code/visual-studio-code-azure-variable-parameter-type-extract-variable.png" alt-text="Screenshot of extracting variable.":::
223
+
224
+
-**Extract parameter of a simple data type**: create a new parameter with a simple data type, such as string, int, etc., and give you an option to update the parameter name:
225
+
226
+
:::image type="content" source="./media/visual-studio-code/visual-studio-code-azure-variable-parameter-type-extract-parameter.png" alt-text="Screenshot of extracting parameter.":::
227
+
228
+
-**Extract parameter of a user-defined data type**: create a new parameter with a user-defined data type, and give you an option to update the parameter name:
229
+
230
+
:::image type="content" source="./media/visual-studio-code/visual-studio-code-azure-variable-parameter-type-extract-parameter-with-allowed-values.png" alt-text="Screenshot of extracting parameter with allowed values.":::
231
+
232
+
After the extract, it requires some customization.
233
+
234
+
-**Create user-defined type**: create a new user-defined type, and give you an option to update the type name.
235
+
236
+
:::image type="content" source="./media/visual-studio-code/visual-studio-code-azure-variable-parameter-type-extract-type.png" alt-text="Screenshot of extracting user-defined data types.":::
237
+
238
+
Unlike the other options, it doesn't replace the selected code with a reference to the new type. In the preceding example, the value of `identity` remains as it is. To use the new type, you must incorporate it into your code.
239
+
202
240
## View documentation
203
241
204
242
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 Documentation**.
0 commit comments