30_Send data to blob storage from instance(Alt to SGW) - SanjeevOCI/Azure GitHub Wiki

step-by-step guide to send data from an Azure VM to Azure Blob Storage (an alternative to using Storage Gateway/SGW):


1. Create an Azure Storage Account and Blob Container

  1. Go to Azure Portal > Storage accounts > Create.
  2. Fill in the required details (resource group, name, region, etc.).

30_Send-data-to-blob-storage-from-instance_1

  1. Once created, open the storage account.
  2. Under Data storage, select Containers.
  3. Click + Container, give it a name (e.g., mycontainer), and set access level (private is recommended).

30_Send-data-to-blob-storage-from-instance_2 30_Send-data-to-blob-storage-from-instance_3 30_Send-data-to-blob-storage-from-instance_4

  1. Create upload file in VM

30_Send-data-to-blob-storage-from-instance_6


2. Get Storage Account Access Key or SAS Token

  1. In the storage account, go to Access keys (for key) or Shared access signature (for SAS).
  2. Copy the key or generate and copy a SAS token.

SAS_Key_1 SAS_Key_2


3. Install AzCopy on the VM

Option A: Using AzCopy (Recommended for file transfers)

  • Download and install AzCopy on your VM:
    AzCopy Download
  • Extract and add AzCopy to your system PATH.

30_Send-data-to-blob-storage-from-instance_7


4. Upload Data from VM to Blob Storage

Using AzCopy

Command Example (using Access Key):

azcopy copy "/path/to/local/file.txt" "https://<storageaccount>.blob.core.windows.net/<container>/<blobname>?<SAS_token>" --recursive=false
  • Replace <storageaccount>, <container>, <blobname>, and <SAS_token> with your values.
azcopy copy "/root/storageupload/upload.txt" "https://testvmtostorage.blob.core.windows.net/mycontainer/testblob?sv=2024-11-04&ss=bfqt&srt=sco&sp=rwdlacupiytfx&se=2025-05-24T18:40:48Z&st=2025-05-24T10:40:48Z&spr=https&sig=%2FV8lW9F%2FrtdE3VIWaBVy791226OCjJNmPZPn1xROTUc%3D"

SAS_Key_3


5. Verify Upload

  • Go to the Azure Portal > Storage Account > Container.
  • Confirm your file appears in the blob container.

SAS_Key_4


Summary Table

Step Action Tool/Command Example
1 Create Storage Account & Container Azure Portal
2 Get Access Key or SAS Token Azure Portal
3 Install AzCopy or Azure CLI on VM Download from Microsoft
4 Upload Data azcopy copy ... or az storage blob upload ...
5 Verify Upload Azure Portal

This method is a direct, secure, and efficient alternative to Storage Gateway for sending data from a VM to Azure Blob Storage.

⚠️ **GitHub.com Fallback** ⚠️