Azure / Azure/azure-powershell

New-AzStorageBlobSASToken should not print "?" removal warning with -FullUri option

Open
#22,882 2 comments 0 reactions 0 assignees View on GitHub
Azure PS Team bug needs-team-attention
Dominant language
C#
Stars
4.8k
Forks
4.3k
Avg merge
2d 17h
Merged PRs (30d)
51

Description

### Description

We use the `New-AzStorageBlobSASToken` cmdlet to generate fully qualified blob URLs with a SAS token included. Right now, this prints the warning:

```
WARNING: Upcoming breaking changes in the cmdlet 'New-AzStorageBlobSASToken' :
The leading question mark '?' of the created SAS token will be removed in a future release.
- The change is expected to take effect from Az version : '11.0.0'
- The change is expected to take effect from version : '6.0.0'
Note : Go to https://aka.ms/azps-changewarnings for steps to suppress this breaking change warning, and other information on breaking changes in Azure PowerShell.
```

This warning does not make sense if the `-FullUri` option is specified. I think this warning should be suppressed automatically in that case. Sure, it makes sense if `-FullUri` is not specified.

### Issue script & Debug output

Script:
```ps
New-AzStorageBlobSASToken -Container v3-index -Blob index.json -FullUri -Context $ctx -Permission "r"
```

Output:
```
DEBUG: 3:22:01 PM - Init Operation Context for 'NewAzureStorageBlobSasTokenCommand' with client request id
Azure-Storage-PowerShell-edf494a8-3cb4-4fb8-8a78-f2694a4ba715. If you want to get more details, please add "-Debug" to your command.
DEBUG: 3:22:01 PM - NewAzureStorageBlobSasTokenCommand begin processing with ParameterSet 'BlobNameWithPermission'.
WARNING: Upcoming breaking changes in the cmdlet 'New-AzStorageBlobSASToken' :
The leading question mark '?' of the created SAS token will be removed in a future release.
- The change is expected to take effect from Az version : '11.0.0'
- The change is expected to take effect from version : '6.0.0'
Note : Go to https://aka.ms/azps-changewarnings for steps to suppress this breaking change warning, and other information on breaking changes in Azure PowerShell.
DEBUG: 3:22:01 PM - Use storage account 'REDACTED' from storage context.
DEBUG: Request [ce595654-7071-477b-824e-c5be098cffaa] POST https://REDACTED.blob.core.windows.net/?restype=service&comp=userdelegationkey
x-ms-version:2023-01-03
Accept:application/xml
Content-Type:application/xml
User-Agent:AzurePowershell/v1.0.0,azsdk-net-Storage.Blobs/12.17.0 (.NET Framework 4.8.9181.0; Microsoft Windows 10.0.22621 )
x-ms-client-request-id:ce595654-7071-477b-824e-c5be098cffaa
x-ms-return-client-request-id:true
Authorization:REDACTED
client assembly: Azure.Storage.Blobs
DEBUG: Response [ce595654-7071-477b-824e-c5be098cffaa] 200 OK (00.1s)
Transfer-Encoding:chunked
x-ms-request-id:a1e620c5-201e-00ba-7041-f29a98000000
x-ms-client-request-id:ce595654-7071-477b-824e-c5be098cffaa
x-ms-version:2023-01-03
Content-Type:application/xml
Date:Thu, 28 Sep 2023 19:22:00 GMT
Server:Windows-Azure-Blob/1.0 Microsoft-HTTPAPI/2.0
https://REDACTED.blob.core.windows.net/v3-index/index.json?REDACTED
DEBUG: 3:22:01 PM - NewAzureStorageBlobSasTokenCommand end processing, Start 0 remote calls. Finish 0 remote calls. Elapsed time 414563.09 ms. Client operation id:
Azure-Storage-PowerShell-edf494a8-3cb4-4fb8-8a78-f2694a4ba715.
DEBUG: AzureQoSEvent: Module: Az.Storage:5.10.0; CommandName: New-AzStorageBlobSASToken; PSVersion: 5.1.22621.1778; IsSuccess: True; Duration: 00:00:00.1018222
DEBUG: 3:22:01 PM - NewAzureStorageBlobSasTokenCommand end processing.
```

### Environment data

```PowerShell
Name Value
---- -----
PSVersion 5.1.22621.1778
PSEdition Desktop
PSCompatibleVersions {1.0, 2.0, 3.0, 4.0...}
BuildVersion 10.0.22621.1778
CLRVersion 4.0.30319.42000
WSManStackVersion 3.0
PSRemotingProtocolVersion 2.3
SerializationVersion 1.1.0.1
```

### Module versions

```PowerShell
ModuleType Version Name ExportedCommands
---------- ------- ---- ----------------
Script 2.13.0 Az.Accounts {Add-AzEnvironment, Clear-AzConfig, Clear-AzContext, Clear-AzDefault...}
Script 5.10.0 Az.Storage {Add-AzRmStorageContainerLegalHold, Add-AzStorageAccountManagementPolicyAction, Add-AzStorageAccountNetwo...
```

### Error output

```PowerShell
DEBUG: 3:25:52 PM - ResolveError begin processing with ParameterSet 'AnyErrorParameterSet'.
DEBUG: 3:25:52 PM - using account id 'REDACTED'...
DEBUG: 3:25:52 PM - [ConfigManager] Got nothing from [DisplayBreakingChangeWarning], Module = [], Cmdlet = []. Returning default value [True].

DEBUG: 3:25:52 PM - [ConfigManager] Got nothing from [DisplayRegionIdentified], Module = [], Cmdlet = []. Returning default value [True].
DEBUG: 3:25:52 PM - [ConfigManager] Got nothing from [CheckForUpgrade], Module = [], Cmdlet = []. Returning default value [False].
DEBUG: AzureQoSEvent: Module: Az.Accounts:2.13.0; CommandName: Resolve-AzError; PSVersion: 5.1.22621.1778; IsSuccess: True; Duration: 00:00:00.0138107
DEBUG: 3:25:52 PM - [ConfigManager] Got [True] from [EnableDataCollection], Module = [], Cmdlet = [].
DEBUG: 3:25:52 PM - ResolveError end processing.
```

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.