Skip to content

Commit 8feb889

Browse files
committed
edit
1 parent 6899a67 commit 8feb889

File tree

10 files changed

+10
-8
lines changed

10 files changed

+10
-8
lines changed
2.07 KB
Loading
6.4 KB
Loading
14.2 KB
Loading
Loading
10.8 KB
Loading
-363 Bytes
Loading
Loading
Loading
13.1 KB
Loading

articles/azure-resource-manager/bicep/quickstart-create-bicep-use-visual-studio-code.md

Lines changed: 10 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -23,9 +23,9 @@ To set up your environment for Bicep development, see [Install Bicep tools](inst
2323

2424
VS Code with the Bicep extension simplifies development by providing predefined snippets. In this quickstart, you add a snippet that creates a virtual network.
2525

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**.
2727

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].
2929

3030
:::image type="content" source="./media/quickstart-create-bicep-use-visual-studio-code/add-snippet.png" alt-text="Screenshot of adding snippet for virtual network.":::
3131

@@ -36,7 +36,7 @@ Your Bicep file now contains the following code:
3636

3737
```bicep
3838
resource virtualNetwork 'Microsoft.Network/virtualNetworks@2019-11-01' = {
39-
name: 'exampleVNet'
39+
name: 'name'
4040
location: location
4141
properties: {
4242
addressSpace: {
@@ -60,7 +60,6 @@ resource virtualNetwork 'Microsoft.Network/virtualNetworks@2019-11-01' = {
6060
]
6161
}
6262
}
63-
6463
```
6564

6665
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
9190

9291
:::image type="content" source="./media/quickstart-create-bicep-use-visual-studio-code/add-param.png" alt-text="Screenshot of adding string type to parameter.":::
9392

94-
You have the following parameter with a default value:
93+
Give the parameter a default value:
9594

9695
```bicep
9796
param location string = resourceGroup().location
9897
```
9998

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:
101102

102103
```bicep
103104
param storageAccountName string = 'store${uniqueString(resourceGroup().id)}'
104105
```
105106

107+
For more information, see [Interpolation](./data-types.md#strings) and [uniqueString()](./bicep-functions-string.md#uniquestring).
108+
106109
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.
107110

108111
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
144147

145148
:::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.":::
146149

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**.
148151

149152
:::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.":::
150153

@@ -240,7 +243,6 @@ The visualizer shows the resources defined in the Bicep file with the resource d
240243

241244
:::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.":::
242245

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.
244246
1. From **Create parameters file from values used in this deployment?**, select **No**.
245247

246248
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

Comments
 (0)