skip to Main Content

I run the following in PowerShell:

Get-AzSqlDatabaseGeoBackup -ResourceGroupName "ContosoResourceGroup" -ServerName "ContosoServer"

It lists all the backups for the databases, specifically the ResourceId for each.

Now the resource id I assume is a blob because they are db backups?

How do I copy that blob to a storage account in Azure using az cli?

2

Answers


  1. Now the resource id I assume is a blob because they are db backups?

    Agreed with @Venkat V The Resource ID is not a blob, its essential for uniquely identifying and referencing Azure resources when performing operations such as management, monitoring, or automation using Azure APIs, PowerShell cmdlets, Azure CLI, or Terraform.

    How do I copy that blob to a storage account in Azure using az cli?

    • Azure CLI
      you need to use az sql db export as following command here you can use both SQL user credentials or admin user and password created when the SQL server was provisioned.

    enter image description here

    az sql db export -s ServerName -n DatabaseName -g ResourceGroupName --admin-password "password" --admin-user "SQL username/ AD usename" --auth-type ADPassword/SQL --storage-key Storage_account_key== --storage-key-type StorageAccessKey --storage-uri "https://StorageAccountName.blob.core.windows.net/Folder1/myBacpac1.bacpac"
    
    Login or Signup to reply.
  2. The automated backups created by SQL Azure are stored internally on Azure and this is not directly exposed to you so you cannot download them or copy them to Azure Storage accounts. The process of restoring has been abstracted from you also, there is a restore interface and you just tell it from which point in time you would like to restore. SQL Azure does all the work to go through from the most recent full backup and re-apply changes to get to the point you requested.

    Login or Signup to reply.
Please signup or login to give your own answer.
Back To Top
Search