Skip to content

Commit b760c3e

Browse files
Merge pull request #298042 from VincentLiu777/main
Azure File SMB creation page.
2 parents 0e567a9 + 31d24e1 commit b760c3e

File tree

1 file changed

+121
-0
lines changed

1 file changed

+121
-0
lines changed

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

Lines changed: 121 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -178,6 +178,12 @@ $storageAccountSku = "StandardV2_LRS"
178178
New-AzStorageAccount -ResourceGroupName $resourceGroupName -AccountName $storageAccountName -SkuName $storageAccountSku -Kind $storageAccountKind -Location $region
179179
```
180180

181+
To view the settings and service usage for the Provisiond V2 storage account, use the following command.
182+
183+
```powershell
184+
Get-AzStorageFileServiceUsage -ResourceGroupName $resourceGroupName -StorageAccountName $storageAccountName
185+
```
186+
181187
### Create a provisioned v1 or pay-as-you-go storage account (PowerShell)
182188
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).
183189

@@ -227,6 +233,12 @@ storageAccountSku="StandardV2_LRS"
227233
az storage account create --resource-group $resourceGroupName --name $storageAccountName --location $region --kind $storageAccountKind --sku $storageAccountSku --output none
228234
```
229235

236+
To view the settings and service usage for the Provisiond V2 storage account, use the following command.
237+
238+
```bash
239+
az storage account file-service-usage --account-name $storageAccountName -g $resourceGroupName
240+
```
241+
230242
### Create a provisioned v1 or pay-as-you-go storage account (Azure CLI)
231243
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).
232244

@@ -814,6 +826,115 @@ az storage share-rm delete \
814826

815827
---
816828

829+
## Region supportability base on different billing models
830+
You can verify region supportability for various billing models using the following commands.
831+
# [Portal](#tab/azure-portal)
832+
To view region supportability based on different billing models, use Azure PowerShell or Azure CLI.
833+
834+
# [PowerShell](#tab/azure-powershell)
835+
```powershell
836+
# Login to Azure account
837+
Connect-AzAccount
838+
839+
# Track down the subscription ID in GUID format
840+
$subscriptionID = "your-subscription-id-number"
841+
842+
# Get Token
843+
$token = Get-AzAccessToken
844+
845+
# Invoke SRP list SKU API, and get the returned SKU list
846+
$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)"}
847+
848+
# Filter the SKU list to get the required information, customization requried here to get the best result.
849+
$filteredResult = $result | `
850+
Select-Object -ExpandProperty value | `
851+
Where-Object {
852+
$_.resourceType -eq "storageAccounts" -and
853+
# Filter based on your needs. FileStorage kind includes pv2, and pv1 file share, where StorageV2 kind include PayGO file shares.
854+
$_.kind -in @("FileStorage", "StorageV2") -and
855+
# Filter based on your needs. "Standard_" for PayGO file share, "StandardV2_" for Pv2 file share, "Premium_" for pv1 file shares.
856+
# $_.name.StartsWith("StandardV2_") -and
857+
# Change region based on your need to see if we currently support the region (all small cases, no space in between).
858+
# $_.locations -eq "italynorth" -and
859+
$_.name -notin @("Standard_RAGRS", "Standard_RAGZRS")
860+
}
861+
862+
if ($filteredResult.Count -eq 0) {
863+
Write-Output "No results found."
864+
} else {
865+
$filteredResult | `
866+
Select-Object `
867+
-Property `
868+
@{
869+
Name = "sku";
870+
Expression = { $_.name }
871+
}, `
872+
kind, `
873+
@{
874+
Name = "mediaTier";
875+
Expression = {
876+
if ($_.tier -eq "Premium") {
877+
"SSD"
878+
} elseif ($_.tier -eq "Standard") {
879+
"HDD"
880+
} else {
881+
"Unknown"
882+
}
883+
}
884+
}, `
885+
@{
886+
Name = "billingModel";
887+
Expression = {
888+
if ($_.name.StartsWith("StandardV2_") -or
889+
$_.name.StartsWith("PremiumV2_")
890+
) {
891+
"ProvisionedV2"
892+
} elseif ($_.name.StartsWith("Premium_")) {
893+
"ProvisionedV1"
894+
} else {
895+
"PayAsYouGo"
896+
}
897+
}
898+
}, `
899+
@{
900+
Name = "location";
901+
Expression = { $_.locations | Select-Object -First 1 }
902+
} | ft sku, kind, mediaTier, billingModel, location
903+
}
904+
```
905+
906+
# [Azure CLI](#tab/azure-cli)
907+
This script uses jq command line JSON processor. To download it, visit https://jqlang.org/download/
908+
```bash
909+
# Login to Azure account
910+
Az login
911+
912+
# Track down the subscription ID in GUID format and set subscription ID
913+
subscriptionID="your-subscription-id-number"
914+
915+
# Get Token
916+
token=$(az account get-access-token --query accessToken --output tsv)
917+
918+
# Invoke SRP list SKU API, and get the returned SKU list
919+
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")
920+
921+
# Filter the SKU list to get the required information, customization required here to get the best result.
922+
filteredResult=$(echo $result | jq '.value[] | select(.resourceType == "storageAccounts" and (.kind == "FileStorage" or .kind == "StorageV2") and (.name | test("^(?!Standard_RAGRS|Standard_RAGZRS)")))' )
923+
924+
if [ -z "$filteredResult" ]; then
925+
echo "No results found."
926+
else
927+
# Print the table header
928+
printf "%-30s %-15s %-10s %-20s %-15s\n" "SKU" "Kind" "MediaTier" "BillingModel" "Location"
929+
# Print the filtered results
930+
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
931+
printf "%-30s %-15s %-10s %-20s %-15s\n" "$sku" "$kind" "$mediaTier" "$billingModel" "$location"
932+
done
933+
fi
934+
```
935+
936+
---
937+
817938
## Next steps
818939
- [Planning for an Azure Files deployment](storage-files-planning.md) or [Planning for an Azure File Sync deployment](../file-sync/file-sync-planning.md).
819940
- [Azure Files networking overview](storage-files-networking-overview.md).

0 commit comments

Comments
 (0)