omkarclouddba.tech

How to resolve AzCopy common errors? | AzCopy failures troubleshooting

This article guides,

How to resolve AzCopy common errors? or AzCopy failures troubleshooting

What is AzCopy?

Microsoft Azure provided cloud storage called azure storage where you can upload or download files from storage. This can be used for many purposes. As DBA most common scenario is to copy file to azure blob storage. Sometime we need to provide SQL Server database backup files to developer for development. If you are using Microsoft Azure , you can use storage container to copy those files and provide URL to developer so that they can download it and restore on there environment locally. This method also helps to maintain security aspect of data.

How to use AzCopy to copy files?

To download AZ copy latest version you check Microsoft site. You need to unzip the folder once downloaded and then start using in command prompt. Above video have step by step process of copy file from local drive to azure blob storage.

Most common error in AZCopy copy or download files.

INFO: Authentication failed, it is either not correct, or expired, or does not have the correct permission -> github.com/Azure/azure-storage-blob-go/azblob.newStorageError, C:/Users/VssAdministrator/go/pkg/mod/github.com/!azure/azure-storage-blob-go@v0.15.0/azblob/zc_storage_error.go:42
===== RESPONSE ERROR (ServiceCode=AuthorizationFailure) =====
Description=This request is not authorized to perform this operation.
RequestId:619958bb-c01e-001c-2832-b9ed67000000
Time:2023-07-18T04:42:43.3690972Z, Details:
   Code: AuthorizationFailure
   PUT https://test.blob.core.windows.net/backup/stackflow.bak?blockid=mdawmddjdpgqfw5cbgovo3q72muemdawmdawmdawmdawmdaw&comp=block&se=2024-07-18t12%3A35%3A34z&sig=-REDACTED-&sip=198.168.0.0&sp=racwd&spr=https&sr=c&st=2023-07-18t04%3A35%3A34z&sv=2022-11-02&timeout=901
   Content-Length: [8388608]
   User-Agent: [AzCopy/10.19.0 Azure-Storage/0.15 (go1.19.8; Windows_NT)]
   X-Ms-Client-Request-Id: [56ab97fd-69a5-4fe4-71b8-081a76545fc0]
   X-Ms-Version: [2020-10-02]
   --------------------------------------------------------------------------------
   RESPONSE Status: 403 This request is not authorized to perform this operation.
   Content-Length: [246]
   Content-Type: [application/xml]
   Date: [Tue, 18 Jul 2023 04:42:43 GMT]
   Server: [Microsoft-HTTPAPI/2.0]
   X-Ms-Client-Request-Id: [56ab97fd-69a5-4fe4-71b8-081a76545fc0]
   X-Ms-Error-Code: [AuthorizationFailure]
   X-Ms-Request-Id: [619958bb-c01e-001c-2832-b9ed67000000]

How to resolve AzCopy common errors?

When you copy files from local drive to azure storage using AZ copy , you need shared access signature URL which will have blob location along with expiration of URL. If you are trying to use expired URL then above error occurred. To resolve this you need to create new SAS token and get that URL and use it in your AZ copy command and you will successfully able to copy files.

Exit mobile version