Hi folks!
Great to see you again.
This blog post is purely based on Azure Blob Storage: The PowerShell way!
In this blog post, I will
1. Create a New Azure ResourceGroup
2. Create a Storage account
3. Create a New Container inside the Blob Storage of Storage Account.
4. Upload a text file from your current machine to Azure container using AzCopy.
Please Follow the Steps Below:
#Create a New Azure Storage Account
$Location = ‘southeast asia’
$ResourceGroup = ‘Storage-RG’
$StorageAccountName = ‘canarysteststorage’
$StorageSKU = ‘Standard_LRS’
$ContainerName = ‘myblobcontainer’
$FileCopySource = ‘C:myfolder’
$FileCopyDest = ‘https://canarysteststorage.blob.core.windows.net/container1/’
Login-AzureRmAccount
#Create a New Azure Resource Group
New-AzureRmResourceGroup -Location $Location -Name $ResourceGroup
#Create a New Azure Storage Account
New-AzureRmStorageAccount -ResourceGroupName $ResourceGroup -Name $StorageAccountName -SkuName $StorageSKU -Location $Location
#Copy the Primary Storage key
$StorageKey = (Get-AzureRmStorageAccountKey -Name $StorageAccountName -ResourceGroupName $ResourceGroup).value[0]
#Copy the Storage key
$StorageContext = New-AzureStorageContext -StorageAccountKey $StorageKey -StorageAccountName $StorageAccountName
#Create a New Azure Storage Container
$container = New-AzureStorageContainer -Name $ContainerName -Context $StorageContext
AzCopy /Source:$FileCopySource /Dest:$FileCopyDest /DestKey:$key /Pattern:CanarysText.txt
Thanks for Reading!
Please Share your views/Comments.