Skip to content

Commit 9f514ba

Browse files
author
Maddie Clayton
authored
Merge pull request #6028 from dragav/preview
updating breaking changes to reflect changes in the Set-SAS definitio…
2 parents 0ec490f + ea7ad12 commit 9f514ba

File tree

1 file changed

+21
-2
lines changed

1 file changed

+21
-2
lines changed

src/ResourceManager/KeyVault/documentation/upcoming-breaking-changes.md

Lines changed: 21 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -26,14 +26,33 @@
2626
-->
2727

2828
# Upcoming Breaking Changes
29-
3029
The following cmdlets were affected this release:
3130

3231
**Add-AzureKeyVaultCertificate**
3332
- The -Certificate parameter has become mandatory.
3433

3534
**Set-AzureKeyVaultManagedStorageSasDefinition**
36-
- The -Parameter parameter has been removed and replaced by -TemplateUri and -SasType
35+
- The cmdlet no longer accepts individual parameters that compose the access token; instead, the cmdlet replaces explicit token parameters such as Service or Permissions with a generic 'TemplateUri' parameter, corresponding to a sample access token defined elsewhere (presumably using Storage PowerShell cmdlets, or composed manually according to the Storage documentation.) The cmdlet retains the 'ValidityPeriod' parameter.
36+
37+
For more information on composing shared access tokens for Azure Storage, please refer to the documentation pages, respectively:
38+
- [Constructing a Service SAS] (https://docs.microsoft.com/en-us/rest/api/storageservices/Constructing-a-Service-SAS)
39+
- [Constructing an Account SAS] (https://docs.microsoft.com/en-us/rest/api/storageservices/constructing-an-account-sas)
40+
41+
```powershell
42+
# Old
43+
44+
$sas = Set-AzureKeyVaultManagedStorageSasDefinition -VaultName myVault -Name myKey -Service Blob -Permissions 'rcw' -ValidityPeriod 180d
45+
46+
47+
# New
48+
49+
$sctx=New-AzureStorageContext -StorageAccountName $sa.StorageAccountName -Protocol Https -StorageAccountKey Key1
50+
$start=[System.DateTime]::Now.AddDays(-1)
51+
$end=[System.DateTime]::Now.AddMonths(1)
52+
$at=New-AzureStorageAccountSasToken -Service blob -ResourceType Service,Container,Object -Permission "racwdlup" -Protocol HttpsOnly -StartTime $start -ExpiryTime $end -Context $sctx
53+
$sas=Set-AzureKeyVaultManagedStorageSasDefinition -AccountName $sa.StorageAccountName -VaultName $kv.VaultName -Name accountsas -TemplateUri $at -SasType 'account' -ValidityPeriod ([System.Timespan]::FromDays(30))
54+
55+
```
3756

3857
**Set-AzureKeyVaultCertificateIssuer**
3958
- The -IssuerProvider parameter has become mandatory.

0 commit comments

Comments
 (0)