Copy local file to azure storage

Christian Becker 21 Reputation points
2024-09-02T19:53:55.66+00:00

Hi There,

I'm trying to transfer a file from local filesystem inside an Azure Virtual Machine (Debian 12) to Azure Storage. Because azcopy is not available for Debian 12 I'm trying to use az cli directly.

I've tried

az storage blob copy start --account-name mybackupstorage --auth-mode login --destination-blob testfile --destination-container backupcontainer --source-uri file://home/azureuser/testfile

But this results in

The value for one of the HTTP headers is not in the correct format.
RequestId:22f5ada2-601e-0022-4853-fde006000000
Time:2024-09-02T16:18:35.3672485Z
ErrorCode:InvalidHeaderValue
headername:x-ms-copy-source
headervalue:file://home/azureuser/testfile

I've also tried using three slashes but that doesn't work either.

I've also tried az storage azcopy blob upload but that doesn't support Managed Identities.

Could somebody tell me, where I'm thinking the wrong way?

Bests
Chris

Azure Storage Accounts
Azure Storage Accounts
Globally unique resources that provide access to data management services and serve as the parent namespace for the services.
3,104 questions
0 comments No comments
{count} votes

1 answer

Sort by: Most helpful
  1. Andreas Baumgarten 107.9K Reputation points MVP
    2024-09-02T20:53:20.6966667+00:00

    Hi @Christian Becker ,

    maybe this helps/works? I haven't tested the command:

    az storage blob upload --account-name mybackupstorage --container-name backupcontainer --name testfile --file /home/azureuser/testfile --auth-mode login
    

    (If the reply was helpful please don't forget to upvote and/or accept as answer, thank you)

    Regards

    Andreas Baumgarten


Your answer

Answers can be marked as Accepted Answers by the question author, which helps users to know the answer solved the author's problem.