Backup Storage Accounts RRS feed

  • Question

  • Hello, how are you? Im very new in Azure

    I need to backup storage accounts from a respective Resource Group. How can I do it? I need the step by step of how to do

    Also I need to calculate the cost of this backup. Its easy to know how much it will cost?

    Thanks in advance


    Thursday, April 11, 2019 12:25 AM

All replies

  • You can use for this purpose soft delete - more info at https://docs.microsoft.com/en-us/azure/storage/blobs/storage-blob-soft-delete


    • Proposed as answer by YASWANTH MADI Thursday, April 11, 2019 5:10 AM
    Thursday, April 11, 2019 1:41 AM
  • @exitista, 

    In addition to Marcin’s response, you can back up the Azure storage account with below options depends on requirement.

    1)Soft delete for Azure Storage Blobs The better step is first to enable soft delete which is now in GA: https://azure.microsoft.com/en-us/blog/soft-delete-for-azure-storage-blobs-ga.

    2)Read-access geo-redundant storage: The second approach is enable geo-replication for RA-GRA, so if the first data center is down you can always read from a secondary replica in another region, you can find more information in here: https://docs.microsoft.com/en-us/azure/storage/common/storage-redundancy-grs.

    3)You can make a snapshot of a blob and then download the snapshot for a point in time backup as described here.

    4)You can try the Azcopy here. It will list all containers in a storage account and copy them to another storage account one by one by AzCopy tool.

    5)you can take a look at Azure Storage Explorer  tool. you can even copy and paste between containers.

    6)You can use below server-side storage account copy PowerShell script to copy the storage blob containers from one to another storage accounts.

    Select-AzureRmSubscription -SubscriptionId "Your Azure subscription ID"
    #Server side storage copy
    $SourceStorageAccount = "Your source storage AccountName"
    $SourceStorageKey = "Your source storageAccount Key"
    $DestStorageAccount = "Your destination storage AccountName"
    $DestStorageKey = "Your destination storageAccount Key"
    $SourceStorageContext = New-AzureStorageContext -StorageAccountName $SourceStorageAccount -StorageAccountKey $SourceStorageKey
    $DestStorageContext = New-AzureStorageContext -StorageAccountName $DestStorageAccount -StorageAccountKey $DestStorageKey
    $Containers = Get-AzureStorageContainer -Context $SourceStorageContext
    foreach($Container in $Containers)
        $ContainerName = $Container.Name
        if (!((Get-AzureStorageContainer -Context $DestStorageContext) | Where-Object { $_.Name -eq $ContainerName }))
            Write-Output "Creating new container $ContainerName"
            New-AzureStorageContainer -Name $ContainerName -Permission Off -Context $DestStorageContext -ErrorAction Stop
        $Blobs = Get-AzureStorageBlob -Context $SourceStorageContext -Container $ContainerName
        $BlobCpyAry = @() #Create array of objects
        #Do the copy of everything
        foreach ($Blob in $Blobs)
           $BlobName = $Blob.Name
           Write-Output "Copying $BlobName from $ContainerName"
           $BlobCopy = Start-CopyAzureStorageBlob -Context $SourceStorageContext -SrcContainer $ContainerName -SrcBlob $BlobName -DestContext $DestStorageContext -DestContainer $ContainerName -DestBlob $BlobName
           $BlobCpyAry += $BlobCopy
        #Check Status
        foreach ($BlobCopy in $BlobCpyAry)
           #Could ignore all rest and just run $BlobCopy | Get-AzureStorageBlobCopyState but I prefer output with % copied
           $CopyState = $BlobCopy | Get-AzureStorageBlobCopyState
           $Message = $CopyState.Source.AbsolutePath + " " + $CopyState.Status + " {0:N2}%" -f (($CopyState.BytesCopied/$CopyState.TotalBytes)*100) 
           Write-Output $Message

    You can refer the similar query here and I would recommend you to check the following article on Azure Calculator to estimate the Azure storage cost. See if that helps you!

    Kindly, let us know if you need any further assistance on this.

    • Proposed as answer by YASWANTH MADI Thursday, April 11, 2019 5:11 AM
    Thursday, April 11, 2019 5:11 AM
  • @exitista, Just checking in to see if the above answers helped. If this answers your query, do click “Mark as Answer” and Up-Vote for the same. And, if you have any further query do let us know.
    Monday, April 15, 2019 6:07 AM