AZ Cheat Sheet: Difference between revisions

From Coolscript
Jump to navigation Jump to search
Line 20: Line 20:


*Copy Data from local to Container
*Copy Data from local to Container
  az storage blob upload-batch --destination Container-Name --pattern "*.exe" --source "c:\Users\admin\Downloads" --account-name Storage-Account-Name --account-key sample/mbRMrfrMSvofr65ihghNyR+1SH41kGXP/SMMDBf8Hrv2UWknKwvKcPvK/rOB8EqGjQGx9zc5ZbhM7QHYuabqtA==
  az storage blob upload-batch --destination Container-Name --pattern "*.exe" --source "c:\Users\admin\Downloads" --account-name Storage-Account-Name --account-key xyz==


*Copy data between two container within the same Storage-Account
*Copy data between two container within the same Storage-Account

Revision as of 10:03, 15 January 2021

Login and Subscription

az login --use-device-code
az account show
  • Set Subscription
az account set --subscription SubscriptionName


Storage-Account

  • Create Storage Account
az storage account create --location eastus --name ContainerName --resource-group RG --sku Standard_RAGRS --kind BlobStorage --access-tier Hot
  • Get Keys
az storage account keys list --resource-group RG --account-name ContainerName --output table
  • Create Container
az storage container create --name Container-Name --account-name Storage-Account-Name --account-key sample/mbRMrfrMSvofr65ihghNyR+1SH41kGXP/SMMDBf8Hrv2UWknKwvKcPvK/rOB8EqGjQGx9zc5ZbhM7QHYuabqtA==
  • Copy Data from local to Container
az storage blob upload-batch --destination Container-Name --pattern "*.exe" --source "c:\Users\admin\Downloads" --account-name Storage-Account-Name --account-key xyz==
  • Copy data between two container within the same Storage-Account
az storage blob copy start-batch --destination-container Container-Name --account-name Storage-Account-Name --account-key xyz== --source-account-name Storage-Account-Name --source-account-key xyz== --source-container Container-Name
  • Copy data between two storage accounts
az storage blob copy start-batch --destination-container Container-Name --account-name Storage-Account-Name --account-key xyz== --source-account-name Storage-Account-Name --source-account-key xyz== --source-container ContainerName