Hi Ganczarczyk, Marek,
It looks like you're encountering an issue when trying to change the access tier of a blob to "Archive" in Azure Blob Storage using PowerShell. The error message indicates that the request is failing due to an invalid header value for the x-ms-access-tier
header.
- Blob State: Verify that the blob you are trying to change to the Archive tier is not currently in a state that prevents it from being archived. For example, if the blob is currently being modified or if it is a snapshot, you may not be able to change its tier.
- Blob Type: The Archive tier can only be applied to block blobs. If you are trying to change the tier of a page blob or append blob, it will not work.
- Permissions: check whether you have the necessary permissions to change the access tier of the blob. You need to have at least the "Storage Blob Data Contributor" role assigned.
- Correct Syntax: check that you are using the correct syntax and that the blob reference is valid. The command should look like this:
$blob.BlobClient.SetAccessTier("Archive", $null)
- Storage Account Configuration: Make sure that your storage account is configured to support the archive tier. Only storage accounts configured for LRS, GRS, or RA-GRS support moving blobs to the archive tier.
- Version Compatibility: Verify that the version of the Azure SDK you are using is supports with the operations you are trying to perform. The error may arise from using an outdated version.
try to use of Azure CLI or the Azure portal as alternative option for users with additional options to achieve their goal. This can be particularly helpful if the issue is specific to PowerShell.
Access tiers for blob data - Azure Storage | Microsoft Learn
Archive a blob - Azure Storage | Microsoft Learn
Hope the above suggestion helps! Please let us know do you have any further queries.
Please do consider to “up-vote” wherever the information provided helps you, this can be beneficial to other community members.