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):
- Go to Azure Portal > Storage accounts > Create.
- Fill in the required details (resource group, name, region, etc.).
- Once created, open the storage account.
- Under Data storage, select Containers.
- Click + Container, give it a name (e.g.,
mycontainer
), and set access level (private is recommended).
- Create upload file in VM
- In the storage account, go to Access keys (for key) or Shared access signature (for SAS).
- Copy the key or generate and copy a SAS token.
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.
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"
- Go to the Azure Portal > Storage Account > Container.
- Confirm your file appears in the blob container.
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.