'Azure PowerShell Copy-AzStorageBlob: Invalid parameter: comp
I am trying to copy blobs between storage accounts using Copy-AzStorageBlob command.
$srcCtx = New-AzStorageContext -StorageAccountName $srcStorageAccountName -SasToken $srcSasToken
$destCtx = New-AzStorageContext -StorageAccountName $destStorageAccountName -SasToken $destSasToken
Copy-AzStorageBlob -SrcBlob "blobPath" -SrcContainer "src" -Context $srcCtx -DestContainer "dest" -DestContext $destCtx
and I get an error that the following parameter is invalid:
QueryParameterName: comp
QueryParameterValue: tags
but I am not using them directly. Do you have any idea what is wrong? I would like to underline, that source and destination context are working - I have read and write some blobs using mentioned contexts. The issue occurs only during blob copying.
The error message:
Copy-AzStorageBlob: Value for one of the query parameters specified in the request URI is invalid.
RequestId:d705aed0-b01e-0013-12c6-244430000000
Time:2022-02-18T12:56:40.1603279Z
Status: 400 (Value for one of the query parameters specified in the request URI is invalid.)
ErrorCode: InvalidQueryParameterValue
Additional Information:
QueryParameterName: comp
QueryParameterValue: tags
Reason:
Content:
<?xml version="1.0" encoding="utf-8"?><Error><Code>InvalidQueryParameterValue</Code><Message>Value for one of the query parameters specified in the request URI is invalid.
RequestId:d705aed0-b01e-0013-12c6-244430000000
Time:2022-02-18T12:56:40.1603279Z</Message><QueryParameterName>comp</QueryParameterName><QueryParameterValue>tags</QueryParameterValue><Reason /></Error>
Headers:
Server: Microsoft-HTTPAPI/2.0
x-ms-request-id: d705aed0-b01e-0013-12c6-244430000000
x-ms-client-request-id: f76e9297-504e-42a7-8c86-54ad81bedad7
x-ms-error-code: InvalidQueryParameterValue
Date: Fri, 18 Feb 2022 12:56:40 GMT
Content-Length: 375
Content-Type: application/xml
Solution 1:[1]
Please try freshly generating a new SAS key through Azure Portal or Azure Storage Explorer to ensure that the SAS key is fresh and not expired and copy that in url without whitespaces and also make sure to have the correct permissions ( read, write, list etc) which are required for certain operations.
Make sure to have one of any of below roles tried.
1. Storage Blob Data Contributor
2. Storage Blob Data Owner
Try to upgrade(or downgrade) the package versions of azure.storage.blob
Try to provide only required headers like x-ms-blob-type in your request by removing all other unneccessary headers .Check if x-ms-tags header is present and remove if not required.
References:
Sources
This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.
Source: Stack Overflow
| Solution | Source |
|---|---|
| Solution 1 | kavyasaraboju-MT |
