@@ -13,7 +13,7 @@ ms.workload: storage
13
13
ms.tgt_pltfrm : na
14
14
ms.devlang : na
15
15
ms.topic : quickstart
16
- ms.date : 4/16 /2019
16
+ ms.date : 9/11 /2019
17
17
ms.author : b-juche
18
18
# Customer intent: As an IT admin new to Azure NetApp Files, I want to quickly set up Azure NetApp Files and create a volume.
19
19
---
@@ -35,24 +35,46 @@ If you don't have an Azure subscription, create a [free account](https://azure.m
35
35
> [ !IMPORTANT]
36
36
> You need to be granted access to the Azure NetApp Files service. To request access to the service, see the [ Azure NetApp Files waitlist submission page] ( https://forms.office.com/Pages/ResponsePage.aspx?id=v4j5cvGGr0GRqy180BHbR8cq17Xv9yVBtRCSlcD_gdVUNUpUWEpLNERIM1NOVzA5MzczQ0dQR1ZTSS4u ) . You must wait for an official confirmation email from the Azure NetApp Files team before continuing.
37
37
38
+ [ !INCLUDE [ cloud-shell-try-it.md] ( ../../includes/cloud-shell-try-it.md )]
39
+
40
+ ---
41
+
38
42
## Register for Azure NetApp Files and NetApp Resource Provider
39
43
40
- 1 . From the Azure portal, click the Azure Cloud Shell icon on the upper right-hand corner.
44
+ > [ !NOTE]
45
+ > The registration process can take some time to complete.
46
+ >
41
47
42
- ![ Azure Cloud Shell icon ] ( ../media/ azure-netapp-files/azure-netapp-files-azure-cloud-shell-window.png )
48
+ # [ Portal ] ( #tab/ azure-portal )
43
49
44
- 2 . Specify the subscription that has been whitelisted for Azure NetApp Files:
45
-
46
- az account set --subscription <subscriptionId >
50
+ For registration steps using Portal, open a Cloud Shell session as indicated above and follow these Azure CLI steps:
47
51
48
- 3 . Register the Azure Resource Provider:
49
-
50
- az provider register --namespace Microsoft.NetApp --wait
52
+ [ !INCLUDE [ azure-netapp-files-cloudshell-include] ( ../../includes/azure-netapp-files-azure-cloud-shell-window.md )]
53
+
54
+ # [ PowerShell] ( #tab/azure-powershell )
55
+
56
+ This how-to article requires the Azure PowerShell module Az version 2.6.0 or later. Run ` Get-Module -ListAvailable Az ` to find your current version. If you need to install or upgrade, see [ Install Azure PowerShell module] ( /powershell/azure/install-Az-ps ) . If you prefer, you can use Cloud Shell console in a PowerShell session instead.
57
+
58
+ 1 . In a PowerShell command prompt (or PowerShell Cloud Shell session), specify the subscription that has been whitelisted for Azure NetApp Files:
59
+ ``` powershell-interactive
60
+ Select-AzSubscription -Subscription <subscriptionId>
61
+ ```
62
+
63
+ 2. Register the Azure Resource Provider:
64
+ ```powershell-interactive
65
+ Register-AzResourceProvider -ProviderNamespace Microsoft.NetApp
66
+ ```
51
67
52
- The registration process can take some time to complete.
68
+ # [Azure CLI](#tab/azure-cli)
69
+
70
+ [!INCLUDE [azure-netapp-files-cloudshell-include](../../includes/azure-netapp-files-azure-cloud-shell-window.md)]
71
+
72
+ ---
53
73
54
74
## Create a NetApp account
55
75
76
+ # [Portal](#tab/azure-portal)
77
+
56
78
1. In the Azure portal’s search box, enter **Azure NetApp Files** and then select **Azure NetApp Files** from the list that appears.
57
79
58
80

@@ -73,8 +95,70 @@ If you don't have an Azure subscription, create a [free account](https://azure.m
73
95
74
96
4. Click **Create** to create your new NetApp account.
75
97
98
+ # [PowerShell](#tab/azure-powershell)
99
+
100
+ 1. Define some variables so we can refer to them throughout the rest of the examples:
101
+
102
+ ```powershell-interactive
103
+ $resourceGroup = "myRG1"
104
+ $location = "eastus"
105
+ $anfAccountName = "myaccount1"
106
+ ```
107
+
108
+ > [!NOTE]
109
+ > Please refer to [Products available by region](https://azure.microsoft.com/en-us/global-infrastructure/services/?products=netapp®ions=all) for a list of supported regions.
110
+ > To obtain the region name that is supported by our command line tools, please use `Get-AzLocation | select Location`
111
+ >
112
+
113
+ 1. Create a new resource group by using the [New-AzResourceGroup](/powershell/module/az.resources/new-azresourcegroup) command:
114
+
115
+ ```powershell-interactive
116
+ New-AzResourceGroup -Name $resourceGroup -Location $location
117
+ ```
118
+
119
+ 2. Create Azure NetApp Files account with [New-AzNetAppFilesAccount](/powershell/module/az.netappfiles/New-AzNetAppFilesAccount) command:
120
+
121
+ ```powershell-interactive
122
+ New-AzNetAppFilesAccount -ResourceGroupName $resourceGroup -Location $location -Name $anfAccountName
123
+ ```
124
+
125
+ # [Azure CLI](#tab/azure-cli)
126
+
127
+ 1. Define some variables so we can refer to them throughout the rest of the examples:
128
+
129
+ ```azurecli-interactive
130
+ RESOURCE_GROUP="myRG1"
131
+ LOCATION="eastus"
132
+ ANF_ACCOUNT_NAME="myaccount1"
133
+ ```
134
+
135
+ > [!NOTE]
136
+ > Please refer to [Products available by region](https://azure.microsoft.com/en-us/global-infrastructure/services/?products=netapp®ions=all) for a list of supported regions.
137
+ > To obtain the region name that is supported by our command line tools, please use `az account list-locations -query "[].{Region:name}" --out table`
138
+ >
139
+
140
+ 2. Create a new resource group by using the [az group create](/cli/azure/group#az-group-create) command:
141
+
142
+ ```azurecli-interactive
143
+ az group create \
144
+ --name $RESOURCE_GROUP \
145
+ --location $LOCATION
146
+ ```
147
+
148
+ 3. Create Azure NetApp Files account with [az netappfiles account create](/cli/azure/netappfiles/account#az-netappfiles-account-create) command:
149
+
150
+ ```azurecli-interactive
151
+ az netappfiles account create \
152
+ --resource-group $RESOURCE_GROUP \
153
+ --location $LOCATION \
154
+ --account-name $ANF_ACCOUNT_NAME
155
+ ```
156
+ ---
157
+
76
158
## Set up a capacity pool
77
159
160
+ # [Portal](#tab/azure-portal)
161
+
78
162
1. From the Azure NetApp Files management blade, select your NetApp account (**myaccount1**).
79
163
80
164

@@ -94,7 +178,49 @@ If you don't have an Azure subscription, create a [free account](https://azure.m
94
178
95
179
5. Click **OK**.
96
180
97
- ## Create an NFS volume for Azure NetApp Files
181
+ # [PowerShell](#tab/azure-powershell)
182
+
183
+ 1. Defining some new variables for future reference
184
+
185
+ ```powershell-interactive
186
+ $poolName = "mypool1"
187
+ $poolSizeBytes = 4398046511104 # 4TiB
188
+ $serviceLevel = "Premium" # Valid values are Standard, Premium and Ultra
189
+ ```
190
+
191
+ 1. Create a new capacity pool by using the [New-AzNetAppFilesPool](/powershell/module/az.netappfiles/new-aznetappfilespool)
192
+
193
+ ```powershell-interactive
194
+ New-AzNetAppFilesPool -ResourceGroupName $resourceGroup -Location $location -AccountName $anfAccountName -Name $poolName -PoolSize $poolSizeBytes -ServiceLevel $serviceLevel
195
+ ```
196
+
197
+ # [Azure CLI](#tab/azure-cli)
198
+
199
+ 1. Defining some new variables for future reference
200
+
201
+ ```azurecli-interactive
202
+ POOL_NAME="mypool1"
203
+ POOL_SIZE_TiB=4 # Size in Azure CLI needs to be in TiB unit (minimum 4 TiB)
204
+ SERVICE_LEVEL="Premium" # Valid values are Standard, Premium and Ultra
205
+ ```
206
+
207
+ 2. Create a new capacity pool by using the [az netappfiles pool create](/cli/azure/netappfiles/pool#az-netappfiles-pool-create)
208
+
209
+ ```azurecli-interactive
210
+ az netappfiles pool create \
211
+ --resource-group $RESOURCE_GROUP \
212
+ --location $LOCATION \
213
+ --account-name $ANF_ACCOUNT_NAME \
214
+ --pool-name $POOL_NAME \
215
+ --size $POOL_SIZE_TiB \
216
+ --service-level $SERVICE_LEVEL
217
+ ```
218
+
219
+ ---
220
+
221
+ ## Create NFS volume for Azure NetApp Files
222
+
223
+ # [Portal](#tab/azure-portal)
98
224
99
225
1. From the Azure NetApp Files management blade of your NetApp account, click **Volumes**.
100
226
@@ -106,16 +232,16 @@ If you don't have an Azure subscription, create a [free account](https://azure.m
106
232
107
233
3. In the Create a Volume window, provide information for the volume:
108
234
1. Enter **myvol1** as the volume name.
109
- 3 . Select your capacity pool (** mypool1** ).
110
- 4 . Use the default value for quota.
111
- 5 . Under virtual network, click ** Create new** to create a new Azure virtual network (Vnet). Then fill in the following information:
235
+ 2 . Select your capacity pool (**mypool1**).
236
+ 3 . Use the default value for quota.
237
+ 4 . Under virtual network, click **Create new** to create a new Azure virtual network (Vnet). Then fill in the following information:
112
238
* Enter **myvnet1** as the Vnet name.
113
239
* Specify an address space for your setting, for example, 10.7.0.0/16
114
240
* Enter **myANFsubnet** as the subnet name.
115
241
* Specify the subnet address range, for example, 10.7.0.0/24. Note that you cannot share the dedicated subnet with other resources.
116
242
* Select **Microsoft.NetApp/volumes** for subnet delegation.
117
243
* Click **OK** to create the Vnet.
118
- 6 . In subnet, select the newly created Vnet (** myvnet1** ) as the delegate subnet.
244
+ 5 . In subnet, select the newly created Vnet (**myvnet1**) as the delegate subnet.
119
245
120
246

121
247
@@ -131,13 +257,108 @@ If you don't have an Azure subscription, create a [free account](https://azure.m
131
257
132
258

133
259
134
- 5 . Review information for the volume, then click ** Create** .
260
+ 6 . Review information for the volume, then click **Create**.
135
261
The created volume appears in the Volumes blade.
136
262
137
263

138
264
265
+ # [PowerShell](#tab/azure-powershell)
266
+
267
+ 1. Create a subnet delegation to "Microsoft.NetApp/volumes" with [New-AzDelegation](/powershell/module/az.network/new-azdelegation) command.
268
+
269
+ ```powershell-interactive
270
+ $anfDelegation = New-AzDelegation -Name ([guid]::NewGuid().Guid) -ServiceName "Microsoft.NetApp/volumes"
271
+ ```
272
+
273
+ 2. Create a subnet configuration by using [New-AzVirtualNetworkSubnetConfig](/powershell/module/az.network/new-azvirtualnetworksubnetconfig) command.
274
+
275
+ ```powershell-interactive
276
+ $subnet = New-AzVirtualNetworkSubnetConfig -Name "myANFSubnet" -AddressPrefix "10.7.0.0/24" -Delegation $anfDelegation
277
+ ```
278
+
279
+ 3. Create the virtual network by using the [New-AzVirtualNetwork](/powershell/module/az.network/new-azvirtualnetwork) command.
280
+
281
+ ```powershell-interactive
282
+ $vnet = New-AzVirtualNetwork -Name "myvnet1" -ResourceGroupName $resourceGroup -Location $location -AddressPrefix "10.7.0.0/16" -Subnet $subnet
283
+ ```
284
+
285
+ 4. Create the volume by using the [New-AzNetAppFilesVolume](/powershell/module/az.netappfiles/new-aznetappfilesvolume) command.
286
+
287
+ ```powershell-interactive
288
+ $volumeSizeBytes = 1099511627776 # 100GiB
289
+ $subnetId = $vnet.Subnets[0].Id
290
+
291
+ New-AzNetAppFilesVolume -ResourceGroupName $resourceGroup `
292
+ -Location $location `
293
+ -AccountName $anfAccountName `
294
+ -PoolName $poolName `
295
+ -Name "myvol1" `
296
+ -UsageThreshold $volumeSizeBytes `
297
+ -SubnetId $subnetId `
298
+ -CreationToken "myfilepath1" `
299
+ -ServiceLevel $serviceLevel `
300
+ -ProtocolType NFSv3
301
+ ```
302
+
303
+ # [Azure CLI](#tab/azure-cli)
304
+
305
+ 1. Defining some variables for later usage.
306
+
307
+ ```azurecli-interactive
308
+ VNET_NAME="myvnet1"
309
+ SUBNET_NAME="myANFSubnet"
310
+ ```
311
+
312
+ 1. Create virtual network without subnet by using the [az network vnet create](/cli/azure/network/vnet#az-network-vnet-create) command.
313
+
314
+ ```azurecli-interactive
315
+ az network vnet create \
316
+ --resource-group $RESOURCE_GROUP \
317
+ --name $VNET_NAME \
318
+ --location $LOCATION \
319
+ --address-prefix "10.7.0.0/16"
320
+
321
+ ```
322
+
323
+ 2. Create a delegated subnet by using [az network vnet subnet create](/cli/azure/network/vnet/subnet#az-network-vnet-subnet-create) command.
324
+
325
+ ```azurecli-interactive
326
+ az network vnet subnet create \
327
+ --resource-group $RESOURCE_GROUP \
328
+ --vnet-name $VNET_NAME \
329
+ --name $SUBNET_NAME \
330
+ --address-prefixes "10.7.0.0/24" \
331
+ --delegations "Microsoft.NetApp/volumes"
332
+ ```
333
+
334
+ 3. Create the volume by using the [az netappfiles volume create](/cli/azure/netappfiles/volume#az-netappfiles-volume-create) command.
335
+
336
+ ```azurecli-interactive
337
+ VNET_ID=$(az network vnet show --resource-group $RESOURCE_GROUP --name $VNET_NAME --query "id" -o tsv)
338
+ SUBNET_ID=$(az network vnet subnet show --resource-group $RESOURCE_GROUP --vnet-name $VNET_NAME --name $SUBNET_NAME --query "id" -o tsv)
339
+ VOLUME_SIZE_GiB=100 # 100 GiB
340
+ UNIQUE_FILE_PATH="myfilepath2" # Please note that creation token needs to be unique within all ANF Accounts
341
+
342
+ az netappfiles volume create \
343
+ --resource-group $RESOURCE_GROUP \
344
+ --location $LOCATION \
345
+ --account-name $ANF_ACCOUNT_NAME \
346
+ --pool-name $POOL_NAME \
347
+ --name "myvol1" \
348
+ --service-level $SERVICE_LEVEL \
349
+ --vnet $VNET_ID \
350
+ --subnet $SUBNET_ID \
351
+ --usage-threshold $VOLUME_SIZE_GiB \
352
+ --creation-token $UNIQUE_FILE_PATH \
353
+ --protocol-types "NFSv3"
354
+ ```
355
+
356
+ ---
357
+
139
358
## Clean up resources
140
359
360
+ # [Portal](#tab/azure-portal)
361
+
141
362
When you are done and if you want to, you can delete the resource group. The action of deleting a resource group is irreversible.
142
363
143
364
> [!IMPORTANT]
@@ -160,6 +381,34 @@ When you are done and if you want to, you can delete the resource group. The act
160
381
161
382

162
383
384
+ # [PowerShell](#tab/azure-powershell)
385
+
386
+ When you are done and if you want to, you can delete the resource group. The action of deleting a resource group is irreversible.
387
+
388
+ > [!IMPORTANT]
389
+ > All resources within the resource groups will be permanently deleted and cannot be undone.
390
+
391
+ 1. Delete resource group by using the [Remove-AzResourceGroup](/powershell/module/az.resources/remove-azresourcegroup) command.
392
+
393
+ ```powershell-interactive
394
+ Remove-AzResourceGroup -Name $resourceGroup
395
+ ```
396
+
397
+ # [Azure CLI](#tab/azure-cli)
398
+
399
+ When you are done and if you want to, you can delete the resource group. The action of deleting a resource group is irreversible.
400
+
401
+ > [!IMPORTANT]
402
+ > All resources within the resource groups will be permanently deleted and cannot be undone.
403
+
404
+ 1. Delete resource group by using the [az group delete](/cli/azure/group#az-group-delete) command.
405
+
406
+ ```azurecli-interactive
407
+ az group delete \
408
+ --name $RESOURCE_GROUP
409
+ ```
410
+ ---
411
+
163
412
## Next steps
164
413
165
414
> [!div class="nextstepaction"]
0 commit comments