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/quickstart-create-bicep-use-visual-studio-code.md
+10-8Lines changed: 10 additions & 8 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -23,9 +23,9 @@ To set up your environment for Bicep development, see [Install Bicep tools](inst
23
23
24
24
VS Code with the Bicep extension simplifies development by providing predefined snippets. In this quickstart, you add a snippet that creates a virtual network.
25
25
26
-
Launch Visual Studio Code and create a new file named main.bicep.
26
+
Launch Visual Studio Code and create a new file named **main.bicep**.
27
27
28
-
In *main.bicep*, type **vnet**, and then select **res-vnet** from the list, and then press [TAB] or [ENTER]Enter.
28
+
In *main.bicep*, type **vnet**, and then select **res-vnet** from the list, and then press [TAB] or [ENTER].
29
29
30
30
:::image type="content" source="./media/quickstart-create-bicep-use-visual-studio-code/add-snippet.png" alt-text="Screenshot of adding snippet for virtual network.":::
31
31
@@ -36,7 +36,7 @@ Your Bicep file now contains the following code:
Within this snippet, you find all the necessary values for defining a virtual network. You may notice two curly underlines. A yellow one denotes a warning related to an outdated API version, while a red curly underline signals an error caused by a missing parameter definition.
@@ -91,18 +90,22 @@ When you add a space after **location**, notice that intellisense offers the dat
91
90
92
91
:::image type="content" source="./media/quickstart-create-bicep-use-visual-studio-code/add-param.png" alt-text="Screenshot of adding string type to parameter.":::
93
92
94
-
You have the following parameter with a default value:
93
+
Give the parameter a default value:
95
94
96
95
```bicep
97
96
param location string = resourceGroup().location
98
97
```
99
98
100
-
Add a parameter for the storage account name with a default value:
99
+
For more information about the function used in the default value, see [resourceGroup()](./bicep-functions-scope.md#resourcegroup).
100
+
101
+
Add another parameter for the storage account name with a default value:
For more information, see [Interpolation](./data-types.md#strings) and [uniqueString()](./bicep-functions-string.md#uniquestring).
108
+
106
109
This parameter works fine, but storage accounts have limits on the length of the name. The name must have at least three characters and no more than 24 characters. You can specify those requirements by adding decorators to the parameter.
107
110
108
111
Add a line above the parameter, and type **@**. You see the available decorators. Notice there are decorators for both **minLength** and **maxLength**.
@@ -144,7 +147,7 @@ When you add a space after the symbolic name, a list of resource types is displa
144
147
145
148
:::image type="content" source="./media/quickstart-create-bicep-use-visual-studio-code/select-resource-type.png" alt-text="Screenshot of selecting storage accounts for resource type.":::
146
149
147
-
After selecting **Microsoft.Storage/storageAccounts**, you're presented with the available API versions. Select the newest version. For the following screenshot, it is **2023-01-01**.
150
+
After selecting **Microsoft.Storage/storageAccounts**, you're presented with the available API versions. Select the latest version. For the following screenshot, it is **2023-01-01**.
148
151
149
152
:::image type="content" source="./media/quickstart-create-bicep-use-visual-studio-code/select-api-version.png" alt-text="Screenshot of select API version for resource type.":::
150
153
@@ -240,7 +243,6 @@ The visualizer shows the resources defined in the Bicep file with the resource d
240
243
241
244
:::image type="content" source="./media/quickstart-create-bicep-use-visual-studio-code/vscode-bicep-select-parameter-file.png" alt-text="Screenshot of Select parameter file.":::
242
245
243
-
1. Enter a unique storage account name, and then press **[ENTER]**. If you get an error message indicating the storage account is already taken, the storage name you provided is in use. Provide a name that is more likely to be unique.
244
246
1. From **Create parameters file from values used in this deployment?**, select **No**.
245
247
246
248
It takes a few moments to create the resources. For more information, see [Deploy Bicep files with Visual Studio Code](./deploy-vscode.md).
0 commit comments