Skip to content

Commit 8e050ef

Browse files
Update date and PowerShell commands in redundancy article
Updated the date and modified PowerShell commands for Azure authentication and SKU listing.
1 parent 5994ff2 commit 8e050ef

1 file changed

Lines changed: 22 additions & 8 deletions

File tree

articles/storage/files/files-redundancy.md

Lines changed: 22 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ description: Understand the data redundancy options available for Azure file sha
44
author: khdownie
55
ms.service: azure-file-storage
66
ms.topic: concept-article
7-
ms.date: 09/10/2025
7+
ms.date: 03/09/2026
88
ms.author: kendownie
99
ms.custom: references_regions
1010
# Customer intent: "As a data engineer, I want to select the appropriate data redundancy option for Azure file shares, so that I can ensure optimal availability and disaster recovery tailored to my organization's needs."
@@ -211,19 +211,33 @@ To view region supportability based on different billing models, use Azure Power
211211
# [PowerShell](#tab/azure-powershell)
212212

213213
```powershell
214-
# Login to Azure account
214+
Powershell:
215+
216+
# Login
215217
Connect-AzAccount
218+
# (Optional but recommended if you have multiple subs)
219+
# Set-AzContext -Subscription $subscriptionID
216220
217-
# Track down the subscription ID in GUID format
218221
$subscriptionID = "your-subscription-id-number"
219222
220-
# Get Token
221-
$token = Get-AzAccessToken
223+
# Get token (now SecureString by default)
224+
$secureToken = (Get-AzAccessToken).Token # SecureString now [1](https://learn.microsoft.com/en-us/powershell/module/az.accounts/get-azaccesstoken?view=azps-15.3.0)
222225
223-
# Invoke SRP list SKU API, and get the returned SKU list
224-
$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)"}
226+
# Convert SecureString -> plaintext (Az 14 migration pattern)
227+
$ssPtr = [System.Runtime.InteropServices.Marshal]::SecureStringToBSTR($secureToken)
228+
try {
229+
$plainToken = [System.Runtime.InteropServices.Marshal]::PtrToStringBSTR($ssPtr)
230+
}
231+
finally {
232+
[System.Runtime.InteropServices.Marshal]::ZeroFreeBSTR($ssPtr)
233+
}
234+
235+
# Call List SKUs
236+
$uri = "https://management.azure.com/subscriptions/$subscriptionID/providers/Microsoft.Storage/skus?api-version=2024-01-01"
237+
$headers = @{ Authorization = "Bearer $plainToken" }
238+
239+
$result = Invoke-RestMethod -Method Get -Uri $uri -Headers $headers
225240
226-
# Filter the SKU list to get the required information, customization required here to get the best result.
227241
$filteredResult = $result | `
228242
Select-Object -ExpandProperty value | `
229243
Where-Object {

0 commit comments

Comments
 (0)