Azure Hands-on Labs - Creating Storage Accounts with PowerShell

Azure Hands-on Labs - Creating Storage Accounts with PowerShell

Azure Learning Path for Cloud and DevOps Engineers

📝Introduction

This post demonstrates this hands-on lab, where we walk through using Azure PowerShell to create a storage account. This beginner-level hands-on lab covers several concepts, including the following.

Creating variables to store key parameters. Identifying the proper cmdlets to create the new storage account. Creating the storage account and entering the correct parameters.

This hands-on lab uses the Azure Cloud Shell, so there's no need to install any software if you prefer.

📝Log in to the Azure Management Console

Using your credentials, make sure you're using the right Region. In my case, I am using west-us.

📌Note: You can also use the VSCode tool or from your local PowerShell to connect to Azure PowerShell

More information on how to set up it is on the link.

📝Prerequisites:

  • Update to PowerShell 5.1, if needed.

  • Install .NET Framework 4.7.2 or later.

  • VisualCode

  • Web Browser (Chrome, Edge)

📝Setting an Azure Storage Account to Load Powershell

  • Click the Cloud Shell icon (>_) at the top of the page.

  • Click PowerShell.

  • Click Show Advanced Settings. Use the combo box under Cloud Shell region to select the Region. Under Resource group and Storage account(It's a globally unique name), enter a name for both. In the box under File share, enter a name. Click ***Create storage (***if you don't have any yet).

📝Creating Storage Accounts in Azure PowerShell

  • Get the name of the Resource Group.
  Get-AzResourceGroup
  #Copy the value for the ResourceGroupName parameter to the clipboard. 
  #This will be referred to as RESOURCE_GROUP_NAME for the rest of this guide.
  • Assign RESOURCE_GROUP_NAME to a variable.

      $resourcegroup='RESOURCE_GROUP_NAME'
    
  • Set the location variable.

      $location='westus'
    
  • Create the Azure Storage Account. Use New-AzStorageAccount to create the account with the specified parameters.

      New-AzStorageAccount -ResourceGroupName $resourcegroup `
      -Name 'demostorageaccount01' `
      -Location $location `
      -SkuName Standard_LRS `
      -Kind StorageV2
    

    You can also check on the Azure Management Console the resources created.

    📌Note - At the end of each hands-on Lab, always clean up all the resources previously created to avoid being charged.

    Congratulations — you have completed this hands-on lab covering the basics of Azure Creating an Storage Account using PowerShell tool.

    Thank you for reading. I hope you understood and learned something helpful from my blog.

    Please follow me on CloudDevOpsToLearn and LinkedIn franciscojblsouza