Skip to content

Commit a5b99c7

Browse files
Merge pull request #1 from VincentLiu777/VincentLiu777-patch-1
Update storage-how-to-create-file-share.md
2 parents be8a33d + 5b9809f commit a5b99c7

File tree

1 file changed

+117
-0
lines changed

1 file changed

+117
-0
lines changed

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

Lines changed: 117 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -53,6 +53,111 @@ Storage accounts have two properties, kind and SKU, which dictate the billing mo
5353

5454
If you're creating an HDD file share, you can choose between the provisioned v2 and pay-as-you-go billing models. Both models are fully supported, however, we recommend provisioned v2 for new file share deployments. Provisioned v2 file shares are currently available in a limited subset of regions; see [provisioned v2 availability](./understanding-billing.md#provisioned-v2-availability) for more information.
5555

56+
To view region supportability on different billing models on CLI, use the following command.
57+
# [PowerShell](#tab/azure-powershell)
58+
### To view Region supportability on different billing models (PowerShell)
59+
```powershell
60+
# Login to Azure account
61+
Connect-AzAccount
62+
63+
# Track down the subscription ID in GUID format
64+
$subscriptionID = "your-subscription-id-number"
65+
66+
# Get Token
67+
$token = Get-AzAccessToken
68+
69+
# Invoke SRP list SKU API, and get the returned SKU list
70+
$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)"}
71+
72+
# Filter the SKU list to get the required information, customization requried here to get the best result.
73+
$filteredResult = $result | `
74+
Select-Object -ExpandProperty value | `
75+
Where-Object {
76+
$_.resourceType -eq "storageAccounts" -and
77+
# Filter based on your needs. FileStorage kind includes pv2, and pv1 file share, where StorageV2 kind include PayGO file shares.
78+
$_.kind -in @("FileStorage", "StorageV2") -and
79+
# Filter based on your needs. "Standard_" for PayGO file share, "StandardV2_" for Pv2 file share, "Premium_" for pv1 file shares.
80+
# $_.name.StartsWith("StandardV2_") -and
81+
# Change region based on your need to see if we currently support the region (all small cases, no space in between).
82+
# $_.locations -eq "italynorth" -and
83+
$_.name -notin @("Standard_RAGRS", "Standard_RAGZRS")
84+
}
85+
86+
if ($filteredResult.Count -eq 0) {
87+
Write-Output "No results found."
88+
} else {
89+
$filteredResult | `
90+
Select-Object `
91+
-Property `
92+
@{
93+
Name = "sku";
94+
Expression = { $_.name }
95+
}, `
96+
kind, `
97+
@{
98+
Name = "mediaTier";
99+
Expression = {
100+
if ($_.tier -eq "Premium") {
101+
"SSD"
102+
} elseif ($_.tier -eq "Standard") {
103+
"HDD"
104+
} else {
105+
"Unknown"
106+
}
107+
}
108+
}, `
109+
@{
110+
Name = "billingModel";
111+
Expression = {
112+
if ($_.name.StartsWith("StandardV2_") -or
113+
$_.name.StartsWith("PremiumV2_")
114+
) {
115+
"ProvisionedV2"
116+
} elseif ($_.name.StartsWith("Premium_")) {
117+
"ProvisionedV1"
118+
} else {
119+
"PayAsYouGo"
120+
}
121+
}
122+
}, `
123+
@{
124+
Name = "location";
125+
Expression = { $_.locations | Select-Object -First 1 }
126+
} | ft sku, kind, mediaTier, billingModel, location
127+
}
128+
```
129+
130+
# [Azure CLI](#tab/azure-cli)
131+
### To view Region supportability on different billing models (Azure CLI)
132+
This script use jq command line JSON processor, to download, please visit https://jqlang.org/download/
133+
```bash
134+
# Login to Azure account
135+
Az login
136+
137+
# Track down the subscription ID in GUID format and set subscription ID
138+
subscriptionID="your-subscription-id-number"
139+
140+
# Get Token
141+
token=$(az account get-access-token --query accessToken --output tsv)
142+
143+
# Invoke SRP list SKU API, and get the returned SKU list
144+
result=$(az rest --method get --uri "https://management.azure.com/subscriptions/$subscriptionID/providers/Microsoft.Storage/skus?api-version=2024-01-01" --headers "Authorization=Bearer $token")
145+
146+
# Filter the SKU list to get the required information, customization required here to get the best result.
147+
filteredResult=$(echo $result | jq '.value[] | select(.resourceType == "storageAccounts" and (.kind == "FileStorage" or .kind == "StorageV2") and (.name | test("^(?!Standard_RAGRS|Standard_RAGZRS)")))' )
148+
149+
if [ -z "$filteredResult" ]; then
150+
echo "No results found."
151+
else
152+
# Print the table header
153+
printf "%-30s %-15s %-10s %-20s %-15s\n" "SKU" "Kind" "MediaTier" "BillingModel" "Location"
154+
# Print the filtered results
155+
echo $filteredResult | jq -r '. | "\(.name)\t\(.kind)\t\(.tier | if . == "Premium" then "SSD" elif . == "Standard" then "HDD" else "Unknown" end)\t\(.name | if test("^StandardV2_|^PremiumV2_") then "ProvisionedV2" elif test("^Premium_") then "ProvisionedV1" else "PayAsYouGo" end)\t\(.locations)"' | while IFS=$'\t' read -r sku kind mediaTier billingModel location; do
156+
printf "%-30s %-15s %-10s %-20s %-15s\n" "$sku" "$kind" "$mediaTier" "$billingModel" "$location"
157+
done
158+
fi
159+
```
160+
56161
# [Portal](#tab/azure-portal)
57162
To create a storage account via the Azure portal, use the search box at the top of the Azure portal to search for **storage accounts** and select the matching result.
58163

@@ -178,6 +283,12 @@ $storageAccountSku = "StandardV2_LRS"
178283
New-AzStorageAccount -ResourceGroupName $resourceGroupName -AccountName $storageAccountName -SkuName $storageAccountSku -Kind $storageAccountKind -Location $region
179284
```
180285

286+
To view the settings and statistics of the Provisiond V2 storage account, use the following command.
287+
288+
```powershell
289+
Get-AzStorageFileServiceUsage -ResourceGroupName $resourceGroupName -StorageAccountName $storageAccountName
290+
```
291+
181292
### Create a provisioned v1 or pay-as-you-go storage account (PowerShell)
182293
To create a provisioned v1 or pay-as-you-go 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).
183294

@@ -227,6 +338,12 @@ storageAccountSku="StandardV2_LRS"
227338
az storage account create --resource-group $resourceGroupName --name $storageAccountName --location $region --kind $storageAccountKind --sku $storageAccountSku --output none
228339
```
229340

341+
To view the settings and statistic of the Provisiond V2 storage account, use the following command.
342+
343+
```bash
344+
az storage account file-service-usage --account-name $storageAccountName -g $resourceGroupName
345+
```
346+
230347
### Create a provisioned v1 or pay-as-you-go storage account (Azure CLI)
231348
To create a provisioned v1 or pay-as-you-go storage account using Azure CLI, use the `az storage account create` command. This command has many options; only the required options are shown. To learn more about the advanced options, see the [`az storage account create` command documentation](/cli/azure/storage/account).
232349

0 commit comments

Comments
 (0)