Skip to content

Latest commit

 

History

History
32 lines (31 loc) · 1.21 KB

BLOBSETUP.md

File metadata and controls

32 lines (31 loc) · 1.21 KB

Azure Blob Storage Setup

Run the following commands on the cloud shell, or do over the GUI

  • Fields in <> are arbitrary
  1. Create a Resource Group
New-AzResourceGroup -Name <name> -Location <region>
  1. Create a Storage Account
New-AzStorageAccount -ResourceGroupName <resourceGroupName> -Name <storageAccountName> -SkuName Standard_LRS -Location <region> -Kind StorageV2 -AccessTier Hot
  1. Get Storage Account Key
# Powershell Version >=1.4
$blobStorageAccountKey = (Get-AzStorageAccountKey -ResourceGroupName <resourceGroupName> -AccountName <storageAccountName>)| Where-Object {$_.KeyName -eq "key1"}
# Powershell Version <=1.3.2
$blobStorageAccountKey = (Get-AzStorageAccountKey -ResourceGroupName <resourceGroupName> -AccountName <storageAccountName>).Key1
  1. Create a storage context:
$blobStorageContext = New-AzStorageContext -StorageAccountName <storageAccountName> -StorageAccountKey $blobStorageAccountKey
  1. Use storage context to create new storage container:
New-AzStorageContainer -Name <containerName> -Context $blobStorageContext

Required Env Keys

Obtained in the setup process

  • AZURE_STORAGE_ACCOUNT_NAME
  • AZURE_STORAGE_ACCOUNT_ACCESS_KEY
  • AZURE_CONTAINER_NAME