Azure / azure-powershell

Microsoft Azure PowerShell
Other
4.24k stars 3.84k forks source link

Az.Storage - New-AzStorageContext for SasToken contains extra '?' in ConnectionString SharedAccessSignature #15309

Closed felickz closed 11 months ago

felickz commented 3 years ago

Description

ConnectionString returned from New-AzStorageContext -StorageAccountName $storageAccountName -SasToken $SASToken contains an erroneous '?' in: ;SharedAccessSignature=?

BlobEndpoint=https://xyz.blob.core.windows.net/;QueueEndpoint=https://xyz.queue.core.windows.net/;TableEndpoint=https://xyz.table.core.windows.net/;FileEndpoint=https://xyz.file.core.windows.net/;SharedAccessSignature=?sv=2019-07-07&sig=<sig-goes-here>&spr=https&se=2021-12-18T19%3A41%3A31Z&srt=co&ss=f&sp=rcwl

Azure portal does not create with the ? image

Further, when passing this Connection String into the .NET package Azure.Storage.Files.Shares (and also tested 12.7)

Receive error (removing the ? fixes this error):

Azure.RequestFailedException: 'Server failed to authenticate the request. Make sure the value of Authorization header is formed correctly including the signature.
RequestId:bec50d35-e01a-0086-4f63-642749000000
Time:2021-06-18T17:04:10.4037319Z
Status: 403 (Server failed to authenticate the request. Make sure the value of Authorization header is formed correctly including the signature.)
ErrorCode: AuthenticationFailed

Additional Information:
AuthenticationErrorDetail: sr is mandatory. Cannot be empty

Content:
<?xml version="1.0" encoding="utf-8"?><Error><Code>AuthenticationFailed</Code><Message>Server failed to authenticate the request. Make sure the value of Authorization header is formed correctly including the signature.
RequestId:bec50d35-e01a-0086-4f63-642749000000
Time:2021-06-18T17:04:10.4037319Z</Message><AuthenticationErrorDetail>sr is mandatory. Cannot be empty</AuthenticationErrorDetail></Error>

Headers:
x-ms-request-id: bec50d35-e01a-0086-4f63-642749000000
x-ms-error-code: AuthenticationFailed
Content-Length: 407
Content-Type: application/xml
Date: Fri, 18 Jun 2021 17:04:09 GMT
Server: Microsoft-HTTPAPI/2.0

Steps to reproduce


#Connect-AzAccount 

$storageAccountResourceGroup  = "xyz-rg"
$storageAccountName = "xyz"
$storageServiceType = "File"
$storageResourceType = "Container,Object"
$storageAccountPermissions = "rwlc"
$KeyType = "key1"
$LifetimeInMonths = 6

$expires = (Get-Date).AddMonths($LifetimeInMonths).ToUniversalTime()

$storageAdminAccessKey = Get-AzStorageAccountKey -AccountName $storageAccountName -ResourceGroupName $storageAccountResourceGroup | Where-Object KeyName -eq $KeyType | Select-Object -ExpandProperty Value

$contextKEY = New-AzStorageContext -StorageAccountName $storageAccountName -StorageAccountKey $storageAdminAccessKey

$SASToken = New-AzStorageAccountSASToken -Context $contextKEY -Service $storageServiceType -ResourceType $storageResourceType -Permission $storageAccountPermissions -Protocol HttpsOnly -ExpiryTime $expires                     

$contextSAS = New-AzStorageContext -StorageAccountName $storageAccountName -SasToken $SASToken            

#see `;SharedAccessSignature=?sv=`
Write-Host $contextSAS.ConnectionString

Workaround

$contextSAS.ConnectionString.Replace("SharedAccessSignature=?", "SharedAccessSignature=")

Environment data

Name                           Value
----                           -----
PSVersion                      7.1.3
PSEdition                      Core
GitCommitId                    7.1.3
OS                             Microsoft Windows 10.0.18363
Platform                       Win32NT
PSCompatibleVersions           {1.0, 2.0, 3.0, 4.0…}
PSRemotingProtocolVersion      2.3
SerializationVersion           1.1.0.1
WSManStackVersion              3.0

Module versions

ModuleType Version    PreRelease Name                                PSEdition ExportedCommands
---------- -------    ---------- ----                                --------- ----------------
Script     5.7.0                 Az                                  Core,Desk
Script     5.1.0                 Az                                  Core,Desk
Script     5.0.0                 Az                                  Core,Desk
Script     4.2.0                 Az                                  Core,Desk
Script     2.7.0                 Az                                  Core,Desk
Script     2.2.7                 Az.Accounts                         Core,Desk {Disable-AzDataCollection, Disable-AzCo…
Script     2.2.6                 Az.Accounts                         Core,Desk {Disable-AzDataCollection, Disable-AzCo…
Script     2.2.1                 Az.Accounts                         Core,Desk {Disable-AzDataCollection, Disable-AzCo…
Script     2.1.0                 Az.Accounts                         Core,Desk {Disable-AzDataCollection, Disable-AzCo…
Script     1.8.1                 Az.Accounts                         Core,Desk {Disable-AzDataCollection, Disable-AzCo…
Script     1.6.3                 Az.Accounts                         Core,Desk {Disable-AzDataCollection, Disable-AzCo…
Script     1.0.1                 Az.Advisor                          Core,Desk {Get-AzAdvisorRecommendation, Enable-Az…
Script     2.0.2                 Az.Aks                              Core,Desk {Get-AzAksCluster, New-AzAksCluster, Re…
Script     2.0.1                 Az.Aks                              Core,Desk {Get-AzAksCluster, New-AzAksCluster, Re…
Script     2.0.0                 Az.Aks                              Core,Desk {Get-AzAksCluster, New-AzAksCluster, Re…
Script     1.1.1                 Az.Aks                              Core,Desk {Get-AzAks, New-AzAks, Remove-AzAks, Im…
Script     1.0.2                 Az.Aks                              Core,Desk {Get-AzAks, New-AzAks, Remove-AzAks, Im…
Script     1.1.4                 Az.AnalysisServices                 Core,Desk {Resume-AzAnalysisServicesServer, Suspe…
Script     1.1.3                 Az.AnalysisServices                 Core,Desk {Resume-AzAnalysisServicesServer, Suspe…
Script     1.1.1                 Az.AnalysisServices                 Core,Desk {Resume-AzAnalysisServicesServer, Suspe…
Script     2.2.0                 Az.ApiManagement                    Core,Desk {Add-AzApiManagementApiToGateway, Add-A…
Script     2.1.0                 Az.ApiManagement                    Core,Desk {Add-AzApiManagementApiToGateway, Add-A…
Script     2.0.1                 Az.ApiManagement                    Core,Desk {Add-AzApiManagementApiToProduct, Add-A…
Script     1.3.1                 Az.ApiManagement                    Core,Desk {Add-AzApiManagementApiToProduct, Add-A…
Script     1.0.0                 Az.AppConfiguration                 Core,Desk {Get-AzAppConfigurationStore, Get-AzApp…
Script     1.1.0                 Az.ApplicationInsights              Core,Desk {Get-AzApplicationInsights, New-AzAppli…
Script     1.0.2                 Az.ApplicationInsights              Core,Desk {Get-AzApplicationInsights, New-AzAppli…
Script     1.5.2                 Az.Automation                       Core,Desk {Get-AzAutomationHybridWorkerGroup, Rem…
Script     1.4.0                 Az.Automation                       Core,Desk {Get-AzAutomationHybridWorkerGroup, Rem…
Script     1.3.3                 Az.Automation                       Core,Desk {Get-AzAutomationHybridWorkerGroup, Rem…
Script     3.1.0                 Az.Batch                            Core,Desk {Remove-AzBatchAccount, Get-AzBatchAcco…
Script     3.0.0                 Az.Batch                            Core,Desk {Remove-AzBatchAccount, Get-AzBatchAcco…
Script     1.1.1                 Az.Batch                            Core,Desk {Remove-AzBatchAccount, Get-AzBatchAcco…
Script     2.0.0                 Az.Billing                          Core,Desk {Get-AzBillingInvoice, Get-AzBillingPer…
Script     1.0.3                 Az.Billing                          Core,Desk {Get-AzBillingInvoice, Get-AzBillingPer…
Script     1.0.1                 Az.Billing                          Core,Desk {Get-AzBillingInvoice, Get-AzBillingPer…
Script     1.6.0                 Az.Cdn                              Core,Desk {Get-AzCdnProfile, Get-AzCdnProfileSsoU…
Script     1.4.3                 Az.Cdn                              Core,Desk {Get-AzCdnProfile, Get-AzCdnProfileSsoU…
Script     1.3.1                 Az.Cdn                              Core,Desk {Get-AzCdnProfile, Get-AzCdnProfileSsoU…
Script     1.8.0                 Az.CognitiveServices                Core,Desk {Get-AzCognitiveServicesAccount, Get-Az…
Script     1.4.0                 Az.CognitiveServices                Core,Desk {Get-AzCognitiveServicesAccount, Get-Az…
Script     1.2.1                 Az.CognitiveServices                Core,Desk {Get-AzCognitiveServicesAccount, Get-Az…
Script     4.10.0                Az.Compute                          Core,Desk {Remove-AzAvailabilitySet, Get-AzAvaila…
Script     4.6.0                 Az.Compute                          Core,Desk {Remove-AzAvailabilitySet, Get-AzAvaila…
Script     4.1.0                 Az.Compute                          Core,Desk {Remove-AzAvailabilitySet, Get-AzAvaila…
Script     2.6.0                 Az.Compute                          Core,Desk {Remove-AzAvailabilitySet, Get-AzAvaila…
Script     1.0.1                 Az.ContainerInstance                Core,Desk {New-AzContainerGroup, Get-AzContainerG…
Script     2.2.1                 Az.ContainerRegistry                Core,Desk {New-AzContainerRegistry, Get-AzContain…
Script     2.0.0                 Az.ContainerRegistry                Core,Desk {New-AzContainerRegistry, Get-AzContain…
Script     1.1.0                 Az.ContainerRegistry                Core,Desk {New-AzContainerRegistry, Get-AzContain…
Script     1.1.0                 Az.CosmosDB                         Core,Desk {Get-AzCosmosDBSqlContainer, Get-AzCosm…
Script     1.1.0                 Az.Databricks                       Core,Desk {Get-AzDatabricksVNetPeering, Get-AzDat…
Script     1.0.1                 Az.Databricks                       Core,Desk {Get-AzDatabricksVNetPeering, Get-AzDat…
Script     1.11.5                Az.DataFactory                      Core,Desk {Set-AzDataFactoryV2, Update-AzDataFact…
Script     1.11.1                Az.DataFactory                      Core,Desk {Set-AzDataFactoryV2, Update-AzDataFact…
Script     1.11.0                Az.DataFactory                      Core,Desk {Set-AzDataFactoryV2, Update-AzDataFact…
Script     1.8.1                 Az.DataFactory                      Core,Desk {Set-AzDataFactoryV2, Update-AzDataFact…
Script     1.3.0                 Az.DataFactory                      Core,Desk {Set-AzDataFactoryV2, Update-AzDataFact…
Script     1.0.1                 Az.DataLakeAnalytics                Core,Desk {Get-AzDataLakeAnalyticsDataSource, New…
Script     1.3.0                 Az.DataLakeStore                    Core,Desk {Get-AzDataLakeStoreTrustedIdProvider, …
Script     1.2.8                 Az.DataLakeStore                    Core,Desk {Get-AzDataLakeStoreTrustedIdProvider, …
Script     1.2.2                 Az.DataLakeStore                    Core,Desk {Get-AzDataLakeStoreTrustedIdProvider, …
Script     1.0.0                 Az.DataShare                        Core,Desk {New-AzDataShareAccount, Get-AzDataShar…
Script     1.0.1                 Az.DeploymentManager                Core,Desk {Get-AzDeploymentManagerArtifactSource,…
Script     2.1.1                 Az.DesktopVirtualization            Core,Desk {Disconnect-AzWvdUserSession, Expand-Az…
Script     2.0.1                 Az.DesktopVirtualization            Core,Desk {Disconnect-AzWvdUserSession, Expand-Az…
Script     2.0.0                 Az.DesktopVirtualization            Core,Desk {Disconnect-AzWvdUserSession, Get-AzWvd…
Script     1.0.0                 Az.DesktopVirtualization            Core,Desk {Disconnect-AzWvdUserSession, Get-AzWvd…
Script     1.0.0                 Az.DevTestLabs                      Core,Desk {Get-AzDtlAllowedVMSizesPolicy, Get-AzD…
Script     1.1.1                 Az.Dns                              Core,Desk {Get-AzDnsRecordSet, New-AzDnsRecordCon…
Script     1.3.0                 Az.EventGrid                        Core,Desk {New-AzEventGridTopic, Get-AzEventGridT…
Script     1.2.2                 Az.EventGrid                        Core,Desk {New-AzEventGridTopic, Get-AzEventGridT…
Script     1.7.2                 Az.EventHub                         Core,Desk {New-AzEventHubNamespace, Get-AzEventHu…
Script     1.7.1                 Az.EventHub                         Core,Desk {New-AzEventHubNamespace, Get-AzEventHu…
Script     1.7.0                 Az.EventHub                         Core,Desk {New-AzEventHubNamespace, Get-AzEventHu…
Script     1.4.0                 Az.EventHub                         Core,Desk {New-AzEventHubNamespace, Get-AzEventHu…
Script     1.7.0                 Az.FrontDoor                        Core,Desk {New-AzFrontDoor, Get-AzFrontDoor, Set-…
Script     1.6.1                 Az.FrontDoor                        Core,Desk {New-AzFrontDoor, Get-AzFrontDoor, Set-…
Script     1.5.0                 Az.FrontDoor                        Core,Desk {New-AzFrontDoor, Get-AzFrontDoor, Set-…
Script     1.1.1                 Az.FrontDoor                        Core,Desk {New-AzFrontDoor, Get-AzFrontDoor, Set-…
Script     2.0.0                 Az.Functions                        Core,Desk {Get-AzFunctionApp, Get-AzFunctionAppAv…
Script     1.0.0                 Az.Functions                        Core,Desk {Get-AzFunctionApp, Get-AzFunctionAppAv…
Script     4.2.0                 Az.HDInsight                        Core,Desk {Get-AzHDInsightJob, New-AzHDInsightSqo…
Script     4.1.0                 Az.HDInsight                        Core,Desk {Get-AzHDInsightJob, New-AzHDInsightSqo…
Script     4.0.0                 Az.HDInsight                        Core,Desk {Get-AzHDInsightJob, New-AzHDInsightSqo…
Script     3.2.0                 Az.HDInsight                        Core,Desk {Get-AzHDInsightJob, New-AzHDInsightSqo…
Script     2.0.2                 Az.HDInsight                        Core,Desk {Get-AzHDInsightJob, New-AzHDInsightSqo…
Script     1.2.0                 Az.HealthcareApis                   Core,Desk {New-AzHealthcareApisService, Remove-Az…
Script     1.1.0                 Az.HealthcareApis                   Core,Desk {New-AzHealthcareApisService, Remove-Az…
Script     1.0.2                 Az.HealthcareApis                   Core,Desk {New-AzHealthcareApisService, Remove-Az…
Script     2.7.3                 Az.IotHub                           Core,Desk {Add-AzIotHubKey, Get-AzIotHubEventHubC…
Script     2.7.0                 Az.IotHub                           Core,Desk {Add-AzIotHubKey, Get-AzIotHubEventHubC…
Script     2.6.0                 Az.IotHub                           Core,Desk {Add-AzIotHubKey, Get-AzIotHubEventHubC…
Script     2.5.0                 Az.IotHub                           Core,Desk {Add-AzIotHubKey, Get-AzIotHubEventHubC…
Script     1.3.0                 Az.IotHub                           Core,Desk {Add-AzIotHubKey, Get-AzIotHubEventHubC…
Script     3.4.1                 Az.KeyVault                         Core,Desk {Add-AzKeyVaultCertificate, Update-AzKe…
Script     3.1.0                 Az.KeyVault                         Core,Desk {Add-AzManagedHsmKey, Get-AzManagedHsmK…
Script     3.0.0                 Az.KeyVault                         Core,Desk {Add-AzManagedHsmKey, Get-AzManagedHsmK…
Script     2.0.0                 Az.KeyVault                         Core,Desk {Add-AzKeyVaultCertificate, Update-AzKe…
Script     1.3.1                 Az.KeyVault                         Core,Desk {Add-AzKeyVaultCertificate, Update-AzKe…
Script     1.0.1                 Az.Kusto                            Core,Desk {Add-AzKustoClusterLanguageExtension, A…
Script     1.0.0                 Az.Kusto                            Core,Desk {Add-AzKustoClusterLanguageExtension, A…
Script     1.5.0                 Az.LogicApp                         Core,Desk {Get-AzIntegrationAccountAgreement, Get…
Script     1.4.0                 Az.LogicApp                         Core,Desk {Get-AzIntegrationAccountAgreement, Get…
Script     1.3.1                 Az.LogicApp                         Core,Desk {Get-AzIntegrationAccountAgreement, Get…
Script     1.1.1                 Az.MachineLearning                  Core,Desk {Move-AzMlCommitmentAssociation, Get-Az…
Script     1.1.0                 Az.Maintenance                      Core,Desk {Get-AzApplyUpdate, Get-AzConfiguration…
Script     1.0.0                 Az.Maintenance                      Core,Desk {Get-AzApplyUpdate, Get-AzConfiguration…
Script     2.0.0                 Az.ManagedServices                  Core,Desk {Get-AzManagedServicesAssignment, New-A…
Script     1.0.1                 Az.ManagedServices                  Core,Desk {Get-AzManagedServicesAssignment, New-A…
Script     1.0.1                 Az.MarketplaceOrdering              Core,Desk {Get-AzMarketplaceTerms, Set-AzMarketpl…
Script     1.1.0                 Az.Media                            Core,Desk {Sync-AzMediaServiceStorageKey, Set-AzM…
Script     1.0.0                 Az.Migrate                          Core,Desk {Get-AzMigrateDiscoveredServer, Get-AzM…
Script     2.4.0                 Az.Monitor                          Core,Desk {Get-AzMetricDefinition, Get-AzMetric, …
Script     2.2.0                 Az.Monitor                          Core,Desk {Get-AzMetricDefinition, Get-AzMetric, …
Script     2.0.0                 Az.Monitor                          Core,Desk {Get-AzMetricDefinition, Get-AzMetric, …
Script     1.3.0                 Az.Monitor                          Core,Desk {Get-AzMetricDefinition, Get-AzMetric, …
Script     4.7.0                 Az.Network                          Core,Desk {Add-AzApplicationGatewayAuthentication…
Script     4.3.0                 Az.Network                          Core,Desk {Add-AzApplicationGatewayAuthentication…
Script     4.1.0                 Az.Network                          Core,Desk {Add-AzApplicationGatewayAuthentication…
Script     3.0.0                 Az.Network                          Core,Desk {Add-AzApplicationGatewayAuthentication…
Script     1.14.0                Az.Network                          Core,Desk {Add-AzApplicationGatewayAuthentication…
Script     1.1.0                 Az.NotificationHubs                 Core,Desk {Get-AzNotificationHub, Get-AzNotificat…
Script     2.3.0                 Az.OperationalInsights              Core,Desk {New-AzOperationalInsightsAzureActivity…
Script     2.1.0                 Az.OperationalInsights              Core,Desk {New-AzOperationalInsightsAzureActivity…
Script     1.3.3                 Az.OperationalInsights              Core,Desk {New-AzOperationalInsightsAzureActivity…
Script     1.4.1                 Az.PolicyInsights                   Core,Desk {Get-AzPolicyEvent, Get-AzPolicyState, …
Script     1.3.1                 Az.PolicyInsights                   Core,Desk {Get-AzPolicyEvent, Get-AzPolicyState, …
Script     1.1.3                 Az.PolicyInsights                   Core,Desk {Get-AzPolicyEvent, Get-AzPolicyState, …
Script     1.1.2                 Az.PowerBIEmbedded                  Core,Desk {Remove-AzPowerBIWorkspaceCollection, G…
Script     1.1.0                 Az.PowerBIEmbedded                  Core,Desk {Remove-AzPowerBIWorkspaceCollection, G…
Script     1.0.3                 Az.PrivateDns                       Core,Desk {Get-AzPrivateDnsZone, Remove-AzPrivate…
Script     3.5.0                 Az.RecoveryServices                 Core,Desk {Get-AzRecoveryServicesBackupProperty, …
Script     3.0.1                 Az.RecoveryServices                 Core,Desk {Get-AzRecoveryServicesBackupProperty, …
Script     3.0.0                 Az.RecoveryServices                 Core,Desk {Get-AzRecoveryServicesBackupProperty, …
Script     2.9.1                 Az.RecoveryServices                 Core,Desk {Get-AzRecoveryServicesBackupProperty, …
Script     1.4.5                 Az.RecoveryServices                 Core,Desk {Get-AzRecoveryServicesBackupProperty, …
Script     1.4.0                 Az.RedisCache                       Core,Desk {Remove-AzRedisCachePatchSchedule, New-…
Script     1.1.0                 Az.RedisCache                       Core,Desk {Remove-AzRedisCachePatchSchedule, New-…
Script     1.0.0                 Az.RedisEnterpriseCache             Core,Desk {Export-AzRedisEnterpriseCache, Get-AzR…
Script     1.0.2                 Az.Relay                            Core,Desk {New-AzRelayNamespace, Get-AzRelayNames…
Script     3.4.0                 Az.Resources                        Core,Desk {Get-AzProviderOperation, Remove-AzRole…
Script     3.0.1                 Az.Resources                        Core,Desk {Get-AzProviderOperation, Remove-AzRole…
Script     3.0.0                 Az.Resources                        Core,Desk {Get-AzProviderOperation, Remove-AzRole…
Script     2.1.0                 Az.Resources                        Core,Desk {Get-AzProviderOperation, Remove-AzRole…
Script     1.7.0                 Az.Resources                        Core,Desk {Get-AzProviderOperation, Remove-AzRole…
Script     1.5.0                 Az.ServiceBus                       Core,Desk {New-AzServiceBusNamespace, Get-AzServi…
Script     1.4.0                 Az.ServiceBus                       Core,Desk {New-AzServiceBusNamespace, Get-AzServi…
Script     2.3.0                 Az.ServiceFabric                    Core,Desk {Add-AzServiceFabricClientCertificate, …
Script     2.2.0                 Az.ServiceFabric                    Core,Desk {Add-AzServiceFabricClientCertificate, …
Script     2.1.0                 Az.ServiceFabric                    Core,Desk {Add-AzServiceFabricClientCertificate, …
Script     1.2.0                 Az.ServiceFabric                    Core,Desk {Add-AzServiceFabricApplicationCertific…
Script     1.2.0                 Az.SignalR                          Core,Desk {New-AzSignalR, Get-AzSignalR, Get-AzSi…
Script     1.1.0                 Az.SignalR                          Core,Desk {New-AzSignalR, Get-AzSignalR, Get-AzSi…
Script     2.17.0                Az.Sql                              Core,Desk {Get-AzSqlDatabaseTransparentDataEncryp…
Script     2.12.0                Az.Sql                              Core,Desk {Get-AzSqlDatabaseTransparentDataEncryp…
Script     2.11.1                Az.Sql                              Core,Desk {Get-AzSqlDatabaseTransparentDataEncryp…
Script     2.7.0                 Az.Sql                              Core,Desk {Get-AzSqlDatabaseTransparentDataEncryp…
Script     1.14.2                Az.Sql                              Core,Desk {Get-AzSqlDatabaseTransparentDataEncryp…
Script     3.5.0                 Az.Storage                          Core,Desk {Get-AzStorageAccount, Get-AzStorageAcc…
Script     3.0.0                 Az.Storage                          Core,Desk {Get-AzStorageAccount, Get-AzStorageAcc…
Script     2.1.0                 Az.Storage                          Core,Desk {Get-AzStorageAccount, Get-AzStorageAcc…
Script     1.7.0                 Az.Storage                          Core,Desk {Get-AzStorageAccount, Get-AzStorageAcc…
Script     1.4.0                 Az.StorageSync                      Core,Desk {Invoke-AzStorageSyncCompatibilityCheck…
Script     1.3.0                 Az.StorageSync                      Core,Desk {Invoke-AzStorageSyncCompatibilityCheck…
Script     1.2.0                 Az.StorageSync                      Core,Desk {Invoke-AzStorageSyncCompatibilityCheck…
Script     1.0.0                 Az.StreamAnalytics                  Core,Desk {Get-AzStreamAnalyticsFunction, Get-AzS…
Script     1.0.0                 Az.Support                          Core,Desk {Get-AzSupportService, Get-AzSupportPro…
Script     1.0.4                 Az.TrafficManager                   Core,Desk {Add-AzTrafficManagerCustomHeaderToEndp…
Script     1.0.2                 Az.TrafficManager                   Core,Desk {Add-AzTrafficManagerCustomHeaderToEndp…
Script     2.5.0                 Az.Websites                         Core,Desk {Get-AzAppServicePlan, Set-AzAppService…
Script     2.1.0                 Az.Websites                         Core,Desk {Get-AzAppServicePlan, Set-AzAppService…
Script     2.0.0                 Az.Websites                         Core,Desk {Get-AzAppServicePlan, Set-AzAppService…
Script     1.9.0                 Az.Websites                         Core,Desk {Get-AzAppServicePlan, Set-AzAppService…
Script     1.4.2                 Az.Websites                         Core,Desk {Get-AzAppServicePlan, Set-AzAppService…
Binary     2.0.2.130             AzureAD                             Desk
Binary     2.0.2.128             AzureAD                             Desk
Binary     2.0.2.52              AzureAD                             Desk
Binary     2.0.2.50              AzureAD                             Desk
Binary     2.0.2.134             AzureADPreview                      Desk
Binary     2.0.2.129             AzureADPreview                      Desk
Binary     2.0.2.119             AzureADPreview                      Desk
Binary     2.0.2.102             AzureADPreview                      Desk
Manifest   1.4.2                 Microsoft.Graph                     Core,Desk
Script     1.4.2                 Microsoft.Graph.Applications        Core,Desk {Add-MgApplicationKey, Add-MgApplicatio…
Script     1.4.2                 Microsoft.Graph.Authentication      Core,Desk {Connect-MgGraph, Disconnect-MgGraph, G…
Script     1.4.2                 Microsoft.Graph.Bookings            Core,Desk {Get-MgBookingBusiness, Get-MgBookingBu…
Script     1.4.2                 Microsoft.Graph.Calendar            Core,Desk {Get-MgGroupCalendar, Get-MgGroupCalend…
Script     1.4.2                 Microsoft.Graph.ChangeNotifications Core,Desk {Get-MgSubscription, New-MgSubscription…
Script     1.4.2                 Microsoft.Graph.CloudCommunications Core,Desk {Get-MgCommunicationCall, Get-MgCommuni…
Script     1.4.2                 Microsoft.Graph.Compliance          Core,Desk {Add-MgComplianceEdiscoveryCaseReviewSe…
Script     1.4.2                 Microsoft.Graph.CrossDeviceExperie… Core,Desk {Get-MgUserActivity, Get-MgUserActivity…
Script     1.4.2                 Microsoft.Graph.DeviceManagement    Core,Desk {Get-MgDeviceManagement, Get-MgDeviceMa…
Script     1.4.2                 Microsoft.Graph.DeviceManagement.A… Core,Desk {Add-MgDeviceManagementGroupPolicyUploa…
Script     1.4.2                 Microsoft.Graph.DeviceManagement.A… Core,Desk {Get-MgDeviceManagementApplePushNotific…
Script     1.4.2                 Microsoft.Graph.DeviceManagement.E… Core,Desk {Get-MgDeviceManagementAndroid, Get-MgD…
Script     1.4.2                 Microsoft.Graph.DeviceManagement.F… Core,Desk {Compare-MgDeviceManagementIntent, Comp…
Script     1.4.2                 Microsoft.Graph.Devices.CloudPrint  Core,Desk {Get-MgPrint, Get-MgPrintConnector, Get…
Script     1.4.2                 Microsoft.Graph.Devices.CorporateM… Core,Desk {Clear-MgDeviceAppMgtWindowInformationP…
Script     1.4.2                 Microsoft.Graph.DirectoryObjects    Core,Desk {Confirm-MgDirectoryObjectMemberGroup, …
Script     1.4.2                 Microsoft.Graph.Education           Core,Desk {Get-MgEducationClass, Get-MgEducationC…
Script     1.4.2                 Microsoft.Graph.Files               Core,Desk {Add-MgDriveListContentTypeBaseTypeCopy…
Script     1.4.2                 Microsoft.Graph.Financials          Core,Desk {Get-MgFinancial, Get-MgFinancialCompan…
Script     1.4.2                 Microsoft.Graph.Groups              Core,Desk {Add-MgGroupFavorite, Add-MgGroupToLife…
Script     1.4.2                 Microsoft.Graph.Identity.Directory… Core,Desk {Confirm-MgAdministrativeUnitMemberGrou…
Script     1.4.2                 Microsoft.Graph.Identity.Governance Core,Desk {Add-MgAccessReviewDecision, Add-MgIden…
Script     1.4.2                 Microsoft.Graph.Identity.SignIns    Core,Desk {Confirm-MgRiskyUserCompromised, Get-Mg…
Script     1.4.2                 Microsoft.Graph.Mail                Core,Desk {Get-MgUserInferenceClassification, Get…
Script     1.4.2                 Microsoft.Graph.Notes               Core,Desk {Get-MgGroupOnenoteNotebook, Get-MgGrou…
Script     1.4.2                 Microsoft.Graph.People              Core,Desk {Get-MgUserActivityStatistics, Get-MgUs…
Script     1.4.2                 Microsoft.Graph.PersonalContacts    Core,Desk {Get-MgUserContact, Get-MgUserContactEx…
Script     1.4.2                 Microsoft.Graph.Planner             Core,Desk {Get-MgGroupPlanner, Get-MgGroupPlanner…
Script     1.4.2                 Microsoft.Graph.Reports             Core,Desk {Get-MgAuditLogDirectoryAudit, Get-MgAu…
Script     1.4.2                 Microsoft.Graph.SchemaExtensions    Core,Desk {Get-MgSchemaExtension, New-MgSchemaExt…
Script     1.4.2                 Microsoft.Graph.Search              Core,Desk {Get-MgExternal, Get-MgExternalConnecti…
Script     1.4.2                 Microsoft.Graph.Security            Core,Desk {Get-MgSecurityAction, Get-MgSecurityAl…
Script     1.4.2                 Microsoft.Graph.Sites               Core,Desk {Add-MgSiteContentTypeBaseTypeCopy, Add…
Script     1.4.2                 Microsoft.Graph.Teams               Core,Desk {Add-MgChatMember, Add-MgTeamChannelMem…
Script     1.4.2                 Microsoft.Graph.Users               Core,Desk {Get-MgUser, Get-MgUserCreatedObject, G…
Script     1.4.2                 Microsoft.Graph.Users.Actions       Core,Desk {Add-MgUserInsightSharedLastSharedMetho…
Script     1.4.2                 Microsoft.Graph.Users.Functions     Core,Desk {Export-MgUserDeviceAndAppManagementDat…
Manifest   1.1.183.57            MSOnline                            Desk
Script     2.0.496               oh-my-posh                          Desk      {Write-ColorPreview, Show-Colors, Show-…
Script     0.7.3                 posh-git                            Desk      {Invoke-NullCoalescing, Add-PoshGitToPr…
Script     2.2.0      beta1      PSReadLine                          Desk      {Get-PSReadLineKeyHandler, Set-PSReadLi…
ghost commented 3 years ago

Thanks for the feedback! We are routing this to the appropriate team for follow-up. cc @xgithubtriage.

Issue Details
## Description ConnectionString returned from `New-AzStorageContext -StorageAccountName $storageAccountName -SasToken $SASToken` contains an erroneous '?' in: ;SharedAccessSignature=**_?_** `BlobEndpoint=https://xyz.blob.core.windows.net/;QueueEndpoint=https://xyz.queue.core.windows.net/;TableEndpoint=https://xyz.table.core.windows.net/;FileEndpoint=https://xyz.file.core.windows.net/;SharedAccessSignature=?sv=2019-07-07&sig=&spr=https&se=2021-12-18T19%3A41%3A31Z&srt=co&ss=f&sp=rcwl` Azure portal does not create with the `?` ![image](https://user-images.githubusercontent.com/1760475/122610158-29f65200-d04d-11eb-8ca6-7e80ac771add.png) Further, when passing this Connection String into the .NET package `Azure.Storage.Files.Shares` (and also tested 12.7) Receive error (removing the `?` fixes this error): ``` Azure.RequestFailedException: 'Server failed to authenticate the request. Make sure the value of Authorization header is formed correctly including the signature. RequestId:bec50d35-e01a-0086-4f63-642749000000 Time:2021-06-18T17:04:10.4037319Z Status: 403 (Server failed to authenticate the request. Make sure the value of Authorization header is formed correctly including the signature.) ErrorCode: AuthenticationFailed Additional Information: AuthenticationErrorDetail: sr is mandatory. Cannot be empty Content: AuthenticationFailedServer failed to authenticate the request. Make sure the value of Authorization header is formed correctly including the signature. RequestId:bec50d35-e01a-0086-4f63-642749000000 Time:2021-06-18T17:04:10.4037319Zsr is mandatory. Cannot be empty Headers: x-ms-request-id: bec50d35-e01a-0086-4f63-642749000000 x-ms-error-code: AuthenticationFailed Content-Length: 407 Content-Type: application/xml Date: Fri, 18 Jun 2021 17:04:09 GMT Server: Microsoft-HTTPAPI/2.0 ``` ## Steps to reproduce ```powershell #Connect-AzAccount $storageAccountResourceGroup = "xyz-rg" $storageAccountName = "xyz" $storageServiceType = "File" $storageResourceType = "Container,Object" $storageAccountPermissions = "rwlc" $KeyType = "key1" $LifetimeInMonths = 6 $expires = (Get-Date).AddMonths($LifetimeInMonths).ToUniversalTime() $storageAdminAccessKey = Get-AzStorageAccountKey -AccountName $storageAccountName -ResourceGroupName $storageAccountResourceGroup | Where-Object KeyName -eq $KeyType | Select-Object -ExpandProperty Value $contextKEY = New-AzStorageContext -StorageAccountName $storageAccountName -StorageAccountKey $storageAdminAccessKey $SASToken = New-AzStorageAccountSASToken -Context $contextKEY -Service $storageServiceType -ResourceType $storageResourceType -Permission $storageAccountPermissions -Protocol HttpsOnly -ExpiryTime $expires $contextSAS = New-AzStorageContext -StorageAccountName $storageAccountName -SasToken $SASToken #see `;SharedAccessSignature=?sv=` Write-Host $contextSAS.ConnectionString ``` ## Environment data ``` Name Value ---- ----- PSVersion 7.1.3 PSEdition Core GitCommitId 7.1.3 OS Microsoft Windows 10.0.18363 Platform Win32NT PSCompatibleVersions {1.0, 2.0, 3.0, 4.0…} PSRemotingProtocolVersion 2.3 SerializationVersion 1.1.0.1 WSManStackVersion 3.0 ``` ## Module versions ```powershell ModuleType Version PreRelease Name PSEdition ExportedCommands ---------- ------- ---------- ---- --------- ---------------- Script 5.7.0 Az Core,Desk Script 5.1.0 Az Core,Desk Script 5.0.0 Az Core,Desk Script 4.2.0 Az Core,Desk Script 2.7.0 Az Core,Desk Script 2.2.7 Az.Accounts Core,Desk {Disable-AzDataCollection, Disable-AzCo… Script 2.2.6 Az.Accounts Core,Desk {Disable-AzDataCollection, Disable-AzCo… Script 2.2.1 Az.Accounts Core,Desk {Disable-AzDataCollection, Disable-AzCo… Script 2.1.0 Az.Accounts Core,Desk {Disable-AzDataCollection, Disable-AzCo… Script 1.8.1 Az.Accounts Core,Desk {Disable-AzDataCollection, Disable-AzCo… Script 1.6.3 Az.Accounts Core,Desk {Disable-AzDataCollection, Disable-AzCo… Script 1.0.1 Az.Advisor Core,Desk {Get-AzAdvisorRecommendation, Enable-Az… Script 2.0.2 Az.Aks Core,Desk {Get-AzAksCluster, New-AzAksCluster, Re… Script 2.0.1 Az.Aks Core,Desk {Get-AzAksCluster, New-AzAksCluster, Re… Script 2.0.0 Az.Aks Core,Desk {Get-AzAksCluster, New-AzAksCluster, Re… Script 1.1.1 Az.Aks Core,Desk {Get-AzAks, New-AzAks, Remove-AzAks, Im… Script 1.0.2 Az.Aks Core,Desk {Get-AzAks, New-AzAks, Remove-AzAks, Im… Script 1.1.4 Az.AnalysisServices Core,Desk {Resume-AzAnalysisServicesServer, Suspe… Script 1.1.3 Az.AnalysisServices Core,Desk {Resume-AzAnalysisServicesServer, Suspe… Script 1.1.1 Az.AnalysisServices Core,Desk {Resume-AzAnalysisServicesServer, Suspe… Script 2.2.0 Az.ApiManagement Core,Desk {Add-AzApiManagementApiToGateway, Add-A… Script 2.1.0 Az.ApiManagement Core,Desk {Add-AzApiManagementApiToGateway, Add-A… Script 2.0.1 Az.ApiManagement Core,Desk {Add-AzApiManagementApiToProduct, Add-A… Script 1.3.1 Az.ApiManagement Core,Desk {Add-AzApiManagementApiToProduct, Add-A… Script 1.0.0 Az.AppConfiguration Core,Desk {Get-AzAppConfigurationStore, Get-AzApp… Script 1.1.0 Az.ApplicationInsights Core,Desk {Get-AzApplicationInsights, New-AzAppli… Script 1.0.2 Az.ApplicationInsights Core,Desk {Get-AzApplicationInsights, New-AzAppli… Script 1.5.2 Az.Automation Core,Desk {Get-AzAutomationHybridWorkerGroup, Rem… Script 1.4.0 Az.Automation Core,Desk {Get-AzAutomationHybridWorkerGroup, Rem… Script 1.3.3 Az.Automation Core,Desk {Get-AzAutomationHybridWorkerGroup, Rem… Script 3.1.0 Az.Batch Core,Desk {Remove-AzBatchAccount, Get-AzBatchAcco… Script 3.0.0 Az.Batch Core,Desk {Remove-AzBatchAccount, Get-AzBatchAcco… Script 1.1.1 Az.Batch Core,Desk {Remove-AzBatchAccount, Get-AzBatchAcco… Script 2.0.0 Az.Billing Core,Desk {Get-AzBillingInvoice, Get-AzBillingPer… Script 1.0.3 Az.Billing Core,Desk {Get-AzBillingInvoice, Get-AzBillingPer… Script 1.0.1 Az.Billing Core,Desk {Get-AzBillingInvoice, Get-AzBillingPer… Script 1.6.0 Az.Cdn Core,Desk {Get-AzCdnProfile, Get-AzCdnProfileSsoU… Script 1.4.3 Az.Cdn Core,Desk {Get-AzCdnProfile, Get-AzCdnProfileSsoU… Script 1.3.1 Az.Cdn Core,Desk {Get-AzCdnProfile, Get-AzCdnProfileSsoU… Script 1.8.0 Az.CognitiveServices Core,Desk {Get-AzCognitiveServicesAccount, Get-Az… Script 1.4.0 Az.CognitiveServices Core,Desk {Get-AzCognitiveServicesAccount, Get-Az… Script 1.2.1 Az.CognitiveServices Core,Desk {Get-AzCognitiveServicesAccount, Get-Az… Script 4.10.0 Az.Compute Core,Desk {Remove-AzAvailabilitySet, Get-AzAvaila… Script 4.6.0 Az.Compute Core,Desk {Remove-AzAvailabilitySet, Get-AzAvaila… Script 4.1.0 Az.Compute Core,Desk {Remove-AzAvailabilitySet, Get-AzAvaila… Script 2.6.0 Az.Compute Core,Desk {Remove-AzAvailabilitySet, Get-AzAvaila… Script 1.0.1 Az.ContainerInstance Core,Desk {New-AzContainerGroup, Get-AzContainerG… Script 2.2.1 Az.ContainerRegistry Core,Desk {New-AzContainerRegistry, Get-AzContain… Script 2.0.0 Az.ContainerRegistry Core,Desk {New-AzContainerRegistry, Get-AzContain… Script 1.1.0 Az.ContainerRegistry Core,Desk {New-AzContainerRegistry, Get-AzContain… Script 1.1.0 Az.CosmosDB Core,Desk {Get-AzCosmosDBSqlContainer, Get-AzCosm… Script 1.1.0 Az.Databricks Core,Desk {Get-AzDatabricksVNetPeering, Get-AzDat… Script 1.0.1 Az.Databricks Core,Desk {Get-AzDatabricksVNetPeering, Get-AzDat… Script 1.11.5 Az.DataFactory Core,Desk {Set-AzDataFactoryV2, Update-AzDataFact… Script 1.11.1 Az.DataFactory Core,Desk {Set-AzDataFactoryV2, Update-AzDataFact… Script 1.11.0 Az.DataFactory Core,Desk {Set-AzDataFactoryV2, Update-AzDataFact… Script 1.8.1 Az.DataFactory Core,Desk {Set-AzDataFactoryV2, Update-AzDataFact… Script 1.3.0 Az.DataFactory Core,Desk {Set-AzDataFactoryV2, Update-AzDataFact… Script 1.0.1 Az.DataLakeAnalytics Core,Desk {Get-AzDataLakeAnalyticsDataSource, New… Script 1.3.0 Az.DataLakeStore Core,Desk {Get-AzDataLakeStoreTrustedIdProvider, … Script 1.2.8 Az.DataLakeStore Core,Desk {Get-AzDataLakeStoreTrustedIdProvider, … Script 1.2.2 Az.DataLakeStore Core,Desk {Get-AzDataLakeStoreTrustedIdProvider, … Script 1.0.0 Az.DataShare Core,Desk {New-AzDataShareAccount, Get-AzDataShar… Script 1.0.1 Az.DeploymentManager Core,Desk {Get-AzDeploymentManagerArtifactSource,… Script 2.1.1 Az.DesktopVirtualization Core,Desk {Disconnect-AzWvdUserSession, Expand-Az… Script 2.0.1 Az.DesktopVirtualization Core,Desk {Disconnect-AzWvdUserSession, Expand-Az… Script 2.0.0 Az.DesktopVirtualization Core,Desk {Disconnect-AzWvdUserSession, Get-AzWvd… Script 1.0.0 Az.DesktopVirtualization Core,Desk {Disconnect-AzWvdUserSession, Get-AzWvd… Script 1.0.0 Az.DevTestLabs Core,Desk {Get-AzDtlAllowedVMSizesPolicy, Get-AzD… Script 1.1.1 Az.Dns Core,Desk {Get-AzDnsRecordSet, New-AzDnsRecordCon… Script 1.3.0 Az.EventGrid Core,Desk {New-AzEventGridTopic, Get-AzEventGridT… Script 1.2.2 Az.EventGrid Core,Desk {New-AzEventGridTopic, Get-AzEventGridT… Script 1.7.2 Az.EventHub Core,Desk {New-AzEventHubNamespace, Get-AzEventHu… Script 1.7.1 Az.EventHub Core,Desk {New-AzEventHubNamespace, Get-AzEventHu… Script 1.7.0 Az.EventHub Core,Desk {New-AzEventHubNamespace, Get-AzEventHu… Script 1.4.0 Az.EventHub Core,Desk {New-AzEventHubNamespace, Get-AzEventHu… Script 1.7.0 Az.FrontDoor Core,Desk {New-AzFrontDoor, Get-AzFrontDoor, Set-… Script 1.6.1 Az.FrontDoor Core,Desk {New-AzFrontDoor, Get-AzFrontDoor, Set-… Script 1.5.0 Az.FrontDoor Core,Desk {New-AzFrontDoor, Get-AzFrontDoor, Set-… Script 1.1.1 Az.FrontDoor Core,Desk {New-AzFrontDoor, Get-AzFrontDoor, Set-… Script 2.0.0 Az.Functions Core,Desk {Get-AzFunctionApp, Get-AzFunctionAppAv… Script 1.0.0 Az.Functions Core,Desk {Get-AzFunctionApp, Get-AzFunctionAppAv… Script 4.2.0 Az.HDInsight Core,Desk {Get-AzHDInsightJob, New-AzHDInsightSqo… Script 4.1.0 Az.HDInsight Core,Desk {Get-AzHDInsightJob, New-AzHDInsightSqo… Script 4.0.0 Az.HDInsight Core,Desk {Get-AzHDInsightJob, New-AzHDInsightSqo… Script 3.2.0 Az.HDInsight Core,Desk {Get-AzHDInsightJob, New-AzHDInsightSqo… Script 2.0.2 Az.HDInsight Core,Desk {Get-AzHDInsightJob, New-AzHDInsightSqo… Script 1.2.0 Az.HealthcareApis Core,Desk {New-AzHealthcareApisService, Remove-Az… Script 1.1.0 Az.HealthcareApis Core,Desk {New-AzHealthcareApisService, Remove-Az… Script 1.0.2 Az.HealthcareApis Core,Desk {New-AzHealthcareApisService, Remove-Az… Script 2.7.3 Az.IotHub Core,Desk {Add-AzIotHubKey, Get-AzIotHubEventHubC… Script 2.7.0 Az.IotHub Core,Desk {Add-AzIotHubKey, Get-AzIotHubEventHubC… Script 2.6.0 Az.IotHub Core,Desk {Add-AzIotHubKey, Get-AzIotHubEventHubC… Script 2.5.0 Az.IotHub Core,Desk {Add-AzIotHubKey, Get-AzIotHubEventHubC… Script 1.3.0 Az.IotHub Core,Desk {Add-AzIotHubKey, Get-AzIotHubEventHubC… Script 3.4.1 Az.KeyVault Core,Desk {Add-AzKeyVaultCertificate, Update-AzKe… Script 3.1.0 Az.KeyVault Core,Desk {Add-AzManagedHsmKey, Get-AzManagedHsmK… Script 3.0.0 Az.KeyVault Core,Desk {Add-AzManagedHsmKey, Get-AzManagedHsmK… Script 2.0.0 Az.KeyVault Core,Desk {Add-AzKeyVaultCertificate, Update-AzKe… Script 1.3.1 Az.KeyVault Core,Desk {Add-AzKeyVaultCertificate, Update-AzKe… Script 1.0.1 Az.Kusto Core,Desk {Add-AzKustoClusterLanguageExtension, A… Script 1.0.0 Az.Kusto Core,Desk {Add-AzKustoClusterLanguageExtension, A… Script 1.5.0 Az.LogicApp Core,Desk {Get-AzIntegrationAccountAgreement, Get… Script 1.4.0 Az.LogicApp Core,Desk {Get-AzIntegrationAccountAgreement, Get… Script 1.3.1 Az.LogicApp Core,Desk {Get-AzIntegrationAccountAgreement, Get… Script 1.1.1 Az.MachineLearning Core,Desk {Move-AzMlCommitmentAssociation, Get-Az… Script 1.1.0 Az.Maintenance Core,Desk {Get-AzApplyUpdate, Get-AzConfiguration… Script 1.0.0 Az.Maintenance Core,Desk {Get-AzApplyUpdate, Get-AzConfiguration… Script 2.0.0 Az.ManagedServices Core,Desk {Get-AzManagedServicesAssignment, New-A… Script 1.0.1 Az.ManagedServices Core,Desk {Get-AzManagedServicesAssignment, New-A… Script 1.0.1 Az.MarketplaceOrdering Core,Desk {Get-AzMarketplaceTerms, Set-AzMarketpl… Script 1.1.0 Az.Media Core,Desk {Sync-AzMediaServiceStorageKey, Set-AzM… Script 1.0.0 Az.Migrate Core,Desk {Get-AzMigrateDiscoveredServer, Get-AzM… Script 2.4.0 Az.Monitor Core,Desk {Get-AzMetricDefinition, Get-AzMetric, … Script 2.2.0 Az.Monitor Core,Desk {Get-AzMetricDefinition, Get-AzMetric, … Script 2.0.0 Az.Monitor Core,Desk {Get-AzMetricDefinition, Get-AzMetric, … Script 1.3.0 Az.Monitor Core,Desk {Get-AzMetricDefinition, Get-AzMetric, … Script 4.7.0 Az.Network Core,Desk {Add-AzApplicationGatewayAuthentication… Script 4.3.0 Az.Network Core,Desk {Add-AzApplicationGatewayAuthentication… Script 4.1.0 Az.Network Core,Desk {Add-AzApplicationGatewayAuthentication… Script 3.0.0 Az.Network Core,Desk {Add-AzApplicationGatewayAuthentication… Script 1.14.0 Az.Network Core,Desk {Add-AzApplicationGatewayAuthentication… Script 1.1.0 Az.NotificationHubs Core,Desk {Get-AzNotificationHub, Get-AzNotificat… Script 2.3.0 Az.OperationalInsights Core,Desk {New-AzOperationalInsightsAzureActivity… Script 2.1.0 Az.OperationalInsights Core,Desk {New-AzOperationalInsightsAzureActivity… Script 1.3.3 Az.OperationalInsights Core,Desk {New-AzOperationalInsightsAzureActivity… Script 1.4.1 Az.PolicyInsights Core,Desk {Get-AzPolicyEvent, Get-AzPolicyState, … Script 1.3.1 Az.PolicyInsights Core,Desk {Get-AzPolicyEvent, Get-AzPolicyState, … Script 1.1.3 Az.PolicyInsights Core,Desk {Get-AzPolicyEvent, Get-AzPolicyState, … Script 1.1.2 Az.PowerBIEmbedded Core,Desk {Remove-AzPowerBIWorkspaceCollection, G… Script 1.1.0 Az.PowerBIEmbedded Core,Desk {Remove-AzPowerBIWorkspaceCollection, G… Script 1.0.3 Az.PrivateDns Core,Desk {Get-AzPrivateDnsZone, Remove-AzPrivate… Script 3.5.0 Az.RecoveryServices Core,Desk {Get-AzRecoveryServicesBackupProperty, … Script 3.0.1 Az.RecoveryServices Core,Desk {Get-AzRecoveryServicesBackupProperty, … Script 3.0.0 Az.RecoveryServices Core,Desk {Get-AzRecoveryServicesBackupProperty, … Script 2.9.1 Az.RecoveryServices Core,Desk {Get-AzRecoveryServicesBackupProperty, … Script 1.4.5 Az.RecoveryServices Core,Desk {Get-AzRecoveryServicesBackupProperty, … Script 1.4.0 Az.RedisCache Core,Desk {Remove-AzRedisCachePatchSchedule, New-… Script 1.1.0 Az.RedisCache Core,Desk {Remove-AzRedisCachePatchSchedule, New-… Script 1.0.0 Az.RedisEnterpriseCache Core,Desk {Export-AzRedisEnterpriseCache, Get-AzR… Script 1.0.2 Az.Relay Core,Desk {New-AzRelayNamespace, Get-AzRelayNames… Script 3.4.0 Az.Resources Core,Desk {Get-AzProviderOperation, Remove-AzRole… Script 3.0.1 Az.Resources Core,Desk {Get-AzProviderOperation, Remove-AzRole… Script 3.0.0 Az.Resources Core,Desk {Get-AzProviderOperation, Remove-AzRole… Script 2.1.0 Az.Resources Core,Desk {Get-AzProviderOperation, Remove-AzRole… Script 1.7.0 Az.Resources Core,Desk {Get-AzProviderOperation, Remove-AzRole… Script 1.5.0 Az.ServiceBus Core,Desk {New-AzServiceBusNamespace, Get-AzServi… Script 1.4.0 Az.ServiceBus Core,Desk {New-AzServiceBusNamespace, Get-AzServi… Script 2.3.0 Az.ServiceFabric Core,Desk {Add-AzServiceFabricClientCertificate, … Script 2.2.0 Az.ServiceFabric Core,Desk {Add-AzServiceFabricClientCertificate, … Script 2.1.0 Az.ServiceFabric Core,Desk {Add-AzServiceFabricClientCertificate, … Script 1.2.0 Az.ServiceFabric Core,Desk {Add-AzServiceFabricApplicationCertific… Script 1.2.0 Az.SignalR Core,Desk {New-AzSignalR, Get-AzSignalR, Get-AzSi… Script 1.1.0 Az.SignalR Core,Desk {New-AzSignalR, Get-AzSignalR, Get-AzSi… Script 2.17.0 Az.Sql Core,Desk {Get-AzSqlDatabaseTransparentDataEncryp… Script 2.12.0 Az.Sql Core,Desk {Get-AzSqlDatabaseTransparentDataEncryp… Script 2.11.1 Az.Sql Core,Desk {Get-AzSqlDatabaseTransparentDataEncryp… Script 2.7.0 Az.Sql Core,Desk {Get-AzSqlDatabaseTransparentDataEncryp… Script 1.14.2 Az.Sql Core,Desk {Get-AzSqlDatabaseTransparentDataEncryp… Script 3.5.0 Az.Storage Core,Desk {Get-AzStorageAccount, Get-AzStorageAcc… Script 3.0.0 Az.Storage Core,Desk {Get-AzStorageAccount, Get-AzStorageAcc… Script 2.1.0 Az.Storage Core,Desk {Get-AzStorageAccount, Get-AzStorageAcc… Script 1.7.0 Az.Storage Core,Desk {Get-AzStorageAccount, Get-AzStorageAcc… Script 1.4.0 Az.StorageSync Core,Desk {Invoke-AzStorageSyncCompatibilityCheck… Script 1.3.0 Az.StorageSync Core,Desk {Invoke-AzStorageSyncCompatibilityCheck… Script 1.2.0 Az.StorageSync Core,Desk {Invoke-AzStorageSyncCompatibilityCheck… Script 1.0.0 Az.StreamAnalytics Core,Desk {Get-AzStreamAnalyticsFunction, Get-AzS… Script 1.0.0 Az.Support Core,Desk {Get-AzSupportService, Get-AzSupportPro… Script 1.0.4 Az.TrafficManager Core,Desk {Add-AzTrafficManagerCustomHeaderToEndp… Script 1.0.2 Az.TrafficManager Core,Desk {Add-AzTrafficManagerCustomHeaderToEndp… Script 2.5.0 Az.Websites Core,Desk {Get-AzAppServicePlan, Set-AzAppService… Script 2.1.0 Az.Websites Core,Desk {Get-AzAppServicePlan, Set-AzAppService… Script 2.0.0 Az.Websites Core,Desk {Get-AzAppServicePlan, Set-AzAppService… Script 1.9.0 Az.Websites Core,Desk {Get-AzAppServicePlan, Set-AzAppService… Script 1.4.2 Az.Websites Core,Desk {Get-AzAppServicePlan, Set-AzAppService… Binary 2.0.2.130 AzureAD Desk Binary 2.0.2.128 AzureAD Desk Binary 2.0.2.52 AzureAD Desk Binary 2.0.2.50 AzureAD Desk Binary 2.0.2.134 AzureADPreview Desk Binary 2.0.2.129 AzureADPreview Desk Binary 2.0.2.119 AzureADPreview Desk Binary 2.0.2.102 AzureADPreview Desk Manifest 1.4.2 Microsoft.Graph Core,Desk Script 1.4.2 Microsoft.Graph.Applications Core,Desk {Add-MgApplicationKey, Add-MgApplicatio… Script 1.4.2 Microsoft.Graph.Authentication Core,Desk {Connect-MgGraph, Disconnect-MgGraph, G… Script 1.4.2 Microsoft.Graph.Bookings Core,Desk {Get-MgBookingBusiness, Get-MgBookingBu… Script 1.4.2 Microsoft.Graph.Calendar Core,Desk {Get-MgGroupCalendar, Get-MgGroupCalend… Script 1.4.2 Microsoft.Graph.ChangeNotifications Core,Desk {Get-MgSubscription, New-MgSubscription… Script 1.4.2 Microsoft.Graph.CloudCommunications Core,Desk {Get-MgCommunicationCall, Get-MgCommuni… Script 1.4.2 Microsoft.Graph.Compliance Core,Desk {Add-MgComplianceEdiscoveryCaseReviewSe… Script 1.4.2 Microsoft.Graph.CrossDeviceExperie… Core,Desk {Get-MgUserActivity, Get-MgUserActivity… Script 1.4.2 Microsoft.Graph.DeviceManagement Core,Desk {Get-MgDeviceManagement, Get-MgDeviceMa… Script 1.4.2 Microsoft.Graph.DeviceManagement.A… Core,Desk {Add-MgDeviceManagementGroupPolicyUploa… Script 1.4.2 Microsoft.Graph.DeviceManagement.A… Core,Desk {Get-MgDeviceManagementApplePushNotific… Script 1.4.2 Microsoft.Graph.DeviceManagement.E… Core,Desk {Get-MgDeviceManagementAndroid, Get-MgD… Script 1.4.2 Microsoft.Graph.DeviceManagement.F… Core,Desk {Compare-MgDeviceManagementIntent, Comp… Script 1.4.2 Microsoft.Graph.Devices.CloudPrint Core,Desk {Get-MgPrint, Get-MgPrintConnector, Get… Script 1.4.2 Microsoft.Graph.Devices.CorporateM… Core,Desk {Clear-MgDeviceAppMgtWindowInformationP… Script 1.4.2 Microsoft.Graph.DirectoryObjects Core,Desk {Confirm-MgDirectoryObjectMemberGroup, … Script 1.4.2 Microsoft.Graph.Education Core,Desk {Get-MgEducationClass, Get-MgEducationC… Script 1.4.2 Microsoft.Graph.Files Core,Desk {Add-MgDriveListContentTypeBaseTypeCopy… Script 1.4.2 Microsoft.Graph.Financials Core,Desk {Get-MgFinancial, Get-MgFinancialCompan… Script 1.4.2 Microsoft.Graph.Groups Core,Desk {Add-MgGroupFavorite, Add-MgGroupToLife… Script 1.4.2 Microsoft.Graph.Identity.Directory… Core,Desk {Confirm-MgAdministrativeUnitMemberGrou… Script 1.4.2 Microsoft.Graph.Identity.Governance Core,Desk {Add-MgAccessReviewDecision, Add-MgIden… Script 1.4.2 Microsoft.Graph.Identity.SignIns Core,Desk {Confirm-MgRiskyUserCompromised, Get-Mg… Script 1.4.2 Microsoft.Graph.Mail Core,Desk {Get-MgUserInferenceClassification, Get… Script 1.4.2 Microsoft.Graph.Notes Core,Desk {Get-MgGroupOnenoteNotebook, Get-MgGrou… Script 1.4.2 Microsoft.Graph.People Core,Desk {Get-MgUserActivityStatistics, Get-MgUs… Script 1.4.2 Microsoft.Graph.PersonalContacts Core,Desk {Get-MgUserContact, Get-MgUserContactEx… Script 1.4.2 Microsoft.Graph.Planner Core,Desk {Get-MgGroupPlanner, Get-MgGroupPlanner… Script 1.4.2 Microsoft.Graph.Reports Core,Desk {Get-MgAuditLogDirectoryAudit, Get-MgAu… Script 1.4.2 Microsoft.Graph.SchemaExtensions Core,Desk {Get-MgSchemaExtension, New-MgSchemaExt… Script 1.4.2 Microsoft.Graph.Search Core,Desk {Get-MgExternal, Get-MgExternalConnecti… Script 1.4.2 Microsoft.Graph.Security Core,Desk {Get-MgSecurityAction, Get-MgSecurityAl… Script 1.4.2 Microsoft.Graph.Sites Core,Desk {Add-MgSiteContentTypeBaseTypeCopy, Add… Script 1.4.2 Microsoft.Graph.Teams Core,Desk {Add-MgChatMember, Add-MgTeamChannelMem… Script 1.4.2 Microsoft.Graph.Users Core,Desk {Get-MgUser, Get-MgUserCreatedObject, G… Script 1.4.2 Microsoft.Graph.Users.Actions Core,Desk {Add-MgUserInsightSharedLastSharedMetho… Script 1.4.2 Microsoft.Graph.Users.Functions Core,Desk {Export-MgUserDeviceAndAppManagementDat… Manifest 1.1.183.57 MSOnline Desk Script 2.0.496 oh-my-posh Desk {Write-ColorPreview, Show-Colors, Show-… Script 0.7.3 posh-git Desk {Invoke-NullCoalescing, Add-PoshGitToPr… Script 2.2.0 beta1 PSReadLine Desk {Get-PSReadLineKeyHandler, Set-PSReadLi… ``` ## Debug output ``` ``` ## Error output ``` ```
Author: felickz
Assignees: -
Labels: `Service Attention`, `Storage`, `customer-reported`, `needs-triage`, `question`
Milestone: -
amishra-dev commented 3 years ago

@blueww Wei Wei could you please look at this issue.

blueww commented 3 years ago

@felickz

Thanks for raising the issue! ? has been in the SAS connection string from Powershell from very long time ago, and the behavior comes from old SDK. It might not be so difficult to remove ? from the connection string of Storage Context, but this is a potential breaking change, as the connection string might be used by many user in many different tools, and remove ? might will break part of them.

I will need time to do more investigation to see the possibility for breaking, then decide how to fix it.

blueww commented 3 years ago

@felickz

We are considering to remove the "?" from connection string, but since this is a potential breaking change, we prefer to do the change in the next Azure PowerShell major release (generally, Azure PowerShell has major release twice a year.)

Besides that, I am contacting SDK team, to see if can make SDK also support connectionString with '?' to unblock your scenario. Feel free to let us know if you have any concern or comments.

rnwhitehead commented 2 years ago

I'm seeing the same error when using az storage file download, using --sas-token to authenticate. However, strangely, it works using --connection-string, even when the string passed is a SAS token.

yifanz7 commented 1 year ago

The current plan is to remove the leading question mark in the next PSH major release in Nov.

blueww commented 11 months ago

Close since the leading question mark of Azure Powershell generated SAS is already removed in latest Az.storage release: https://www.powershellgallery.com/packages/Az.Storage/6.0.0