Skip to content

Commit 4af65cf

Browse files
PowerShell update v2
Added in region supportability section and change some of the naming parameters.
1 parent 04a1eb3 commit 4af65cf

File tree

1 file changed

+35
-30
lines changed

1 file changed

+35
-30
lines changed

articles/storage/files/storage-how-to-create-file-share.md

Lines changed: 35 additions & 30 deletions
Original file line numberDiff line numberDiff line change
@@ -162,24 +162,38 @@ The final step to create the storage account is to select the **Create** button
162162

163163
# [PowerShell](#tab/azure-powershell)
164164
### Create a provisioned v2 storage account (PowerShell)
165+
Currently, provisioned v2 file shares are only available in a limited number of regions. To check the supported regions in PowerShell, write down the subscription ID when logging into the Azure account, and proceed with the following command.
166+
167+
```powershell
168+
# Login to Azure Account
169+
Connect-AzAccount
170+
171+
# Subscription ID in GUID Format
172+
$subscriptionID = "your-subscriptionID-number"
173+
174+
# Get Token
175+
$token = Get-AzAccessToken
176+
177+
# Invoke SRP List SKU API and Get the Returned SKU List
178+
$result = Invoke-RestMethod -Method Get -Uri "https://management.azure.com/subscriptions/$($subscriptionID)/providers/Microsoft.Storage/skus?api-version=2024-01-01" -Headers @{"Authorization" = "Bearer $($token.Token)"}
179+
180+
# Return with the Regions Currently Supporting Provisioned v2 Service
181+
$result | Select-Object -ExpandProperty Value | Where-Object { $_.kind -eq "FileStorage" -and $_.name -like "*StandardV2*" } | Select-Object -Property @{ Name = "sku"; Expression = { $_.name } }, @{ Name = "location"; Expression = { $_.locations } }
182+
```
183+
165184
To create a provisioned v2 storage account using PowerShell, use the `New-AzStorageAccount` cmdlet in the Az.Storage PowerShell module. This cmdlet has many options; only the required options are shown. To learn more about advanced options, see the [`New-AzStorageAccount` cmdlet documentation](/powershell/module/az.storage/new-azstorageaccount).
166185

167-
To create a storage account for provisioned v2 file shares, use the following command. Remember to replace the values for the variables `$resourceGroup`, `$accountName`, `$region`, and `$storageAccountSku` with the desired values for your storage account deployment.
186+
To create a storage account for provisioned v2 file shares, use the following command. Remember to replace the values for the variables `$resourceGroupName`, `$storageAccountName`, `$region`, and `$storageAccountSku` with the desired values for your storage account deployment.
168187

169188
```PowerShell
170-
$resourceGroup = "<my-resource-group>"
171-
$accountName = "<my-storage-account-name>"
189+
$resourceGroupName = "<my-resource-group>"
190+
$storageAccountName = "<my-storage-account-name>"
172191
$region = "<my-region>"
173192
$storageAccountKind = "FileStorage"
174-
# Valid SKUs for provision v2 HDD file share are 'StandardV2_LRS' (HDD Local Pv2),
175-
# 'StandardV2_GRS' (HDD Geo Pv2), 'StandardV2_ZRS' (HDD Zone Pv2), 'StandardV2_GZRS (HDD GeoZone Pv2)'
193+
# Valid SKUs for provisioned v2 HDD file share are 'StandardV2_LRS' (HDD Local Pv2), 'StandardV2_GRS' (HDD Geo Pv2), 'StandardV2_ZRS' (HDD Zone Pv2), 'StandardV2_GZRS' (HDD GeoZone Pv2).
176194
$storageAccountSku = "StandardV2_LRS"
177195
178-
New-AzStorageAccount -ResourceGroupName $resourceGroup `
179-
-AccountName $accountName `
180-
-SkuName $storageAccountSku `
181-
-Kind $storageAccountKind `
182-
-Location $region
196+
New-AzStorageAccount -ResourceGroupName $resourceGroupName -AccountName $storageAccountName -SkuName $storageAccountSku -Kind $storageAccountKind -Location $region
183197
```
184198

185199
### Create a provisioned v1 or pay-as-you-go storage account (PowerShell)
@@ -316,7 +330,7 @@ Follow these instructions to create a new Azure file share using the Azure porta
316330
5. Select **Review + create** and then **Create** to create the Azure file share.
317331

318332
# [PowerShell](#tab/azure-powershell)
319-
You can create a provisioned v2 Azure file share with the `New-AzRmStorageShare` cmdlet. The following PowerShell commands assume you set the variables `$resourceGroup` and `$accountName` as defined in the "Create Storage Account" section.
333+
You can create a provisioned v2 Azure file share with the `New-AzRmStorageShare` cmdlet. The following PowerShell commands assume you set the variables `$resourceGroupName` and `$storageAccountName` as defined in the "Create Storage Account" section.
320334

321335
To create a provisioned v2 file share, use the following command. Remember to replace the values for the variables `$shareName` and `$provisionedStorageGib` with the desired selections for your file share deployment.
322336

@@ -326,18 +340,13 @@ $shareName = "<name-of-the-file-share>"
326340
# The provisioned storage size of the share in GiB. Valid range is 32 to 262,144.
327341
$provisionedStorageGib = 1024
328342
329-
# If you do not specify on the ProvisionedBandwidthMibps and ProvisionedIops,
330-
# the deployment will use the recommended provisioning.
343+
# If you do not specify on the ProvisionedBandwidthMibps and ProvisionedIops, the deployment will use the recommended provisioning.
331344
$provisionedIops = 3000
332345
$provisionedThroughputMibPerSec = 130
333346
334-
New-AzRmStorageShare -ResourceGroupName $resourceGroup `
335-
-AccountName $accountName `
336-
-ShareName $shareName `
337-
-QuotaGiB $provisionedStorageGib;
338-
347+
New-AzRmStorageShare -ResourceGroupName $resourceGroupName -AccountName $storageAccountName -ShareName $shareName -QuotaGiB $provisionedStorageGib;
339348
# -ProvisionedBandwidthMibps $provisionedThroughputMibPerSec -ProvisionedIops $provisionedIops
340-
$f = Get-AzRmStorageShare -ResourceGroupName $resourceGroup -AccountName $accountName -ShareName $shareName;
349+
$f = Get-AzRmStorageShare -ResourceGroupName $resourceGroupName -AccountName $storageAccountName -ShareName $shareName;
341350
$f | fl
342351
```
343352

@@ -568,27 +577,23 @@ Follow these instructions to update the provisioning for your file share.
568577
5. Select **Save** to save provisioning changes. Storage, IOPS, and throughput changes are effective within a few minutes after a provisioning change.
569578

570579
# [PowerShell](#tab/azure-powershell)
571-
You can modify a provisioned v2 file share with the `Update-AzRmStorageShare` cmdlet. Remember to replace the values for the variables `$resourceGroup`, `$accountName`, `$shareName`, `$provisionedMibps`, `$provisionedIops`, and `$provisionedStorageGib` with the desired values for your file share.
580+
You can modify a provisioned v2 file share with the `Update-AzRmStorageShare` cmdlet. Remember to replace the values for the variables `$resourceGroupName`, `$storageAccountName`, `$shareName`, `$provisionedMibps`, `$provisionedIops`, and `$provisionedStorageGib` with the desired values for your file share.
572581

573582
```powershell
574583
# The path to the file share resource to be modified.
575-
$resourceGroup = "<my-resource-group>"
576-
$accountName = "<my-storage-account-name>"
584+
$resourceGroupName = "<my-resource-group>"
585+
$storageAccountName = "<my-storage-account-name>"
577586
$shareName = "<name-of-the-file-share>"
578587
579-
# The provisioning desired on the file share. Delete the parameters if no change is desired.
588+
# The provisioning desired on the file share. Delete the parameters if no
589+
# change is desired.
580590
$provisionedStorageGib = 10240
581591
$provisionedIops = 10000
582592
$provisionedThroughputMibPerSec = 2048
583593
584594
# Update the file share provisioning.
585-
Update-AzRmStorageShare -ResourceGroupName $resourceGroup `
586-
-AccountName $accountName `
587-
-ShareName $shareName `
588-
-ProvisionedBandwidthMibps $provisionedThroughputMibPerSec `
589-
-ProvisionedIops $provisionedIops `
590-
-QuotaGiB $provisionedStorageGib;
591-
$f = Get-AzRmStorageShare -ResourceGroupName $resourceGroup -AccountName $accountName -ShareName $shareName;
595+
Update-AzRmStorageShare -ResourceGroupName $resourceGroupName -AccountName $storageAccountName -ShareName $shareName -ProvisionedBandwidthMibps $provisionedThroughputMibPerSec -ProvisionedIops $provisionedIops -QuotaGiB $provisionedStorageGib;
596+
$f = Get-AzRmStorageShare -ResourceGroupName $resourceGroupName -AccountName $storageAccountName -ShareName $shareName;
592597
$f | fl
593598
```
594599

0 commit comments

Comments
 (0)