How to Upload Files to Azure with CLI

What you’ll need

  • An Azure account
  • The name of the storage account that you want to access
  • An access key for the storage account

How to find your Azure access key

  1. Open an internet browser window and go to https://portal.azure.com.
  2. Log in as you usually would.

    Your Azure dashboard should look something like this:

  3. Click on Storage accounts in the menu on the left.

  4. Select your storage account; in this example, mydatabackups.

  5. Click on Access keys in the Storage menu.

  6. Click on the blue copy button next to an access key.

Connecting to Azure File Storage

Use the azfile protocol and connect to the file.core.windows.net host:

    From the prompt enter the connect command:

      fzcli> connect azfile://<account>:<access key>@file.core.windows.
      ˓→net

Optionally you can use the parameters of the connect command:

    fzcli> connect --protocol azfile --user <account>
    --pass <access key> --path <path>file.core.windows.net

Note that the path is optional but if present it has to start with a slash.

Connecting to Azure Blob Storage

Use the azblob protocol and connect to the blob.core.windows.net host:

    From the prompt enter the connect command:

      fzcli> connect azblob://<account>:<access key>@blob.core.windows.
      ˓→net<path>

    Optionally you can use the parameters of the connect command:

      fzcli> connect --protocol azblob --user <account>
      --pass <access key> --path <path> blob.core.windows.net

    Note that the path is optional but if present it has to start with a slash.

You can now transfer files between your local machine and your Azure account.

Tags: , , ,