How to backup SQL database in Azure VM from SQL agent?

Sridhar.Kamala 5 Reputation points
2024-03-25T15:02:53.0866667+00:00

Hello, we are intending to transfer all SQL database baackups to Azure and have several backups that we need to run manually/on-demand using SQL agent jobs. I have created a backup policy specifically for on-demand backups, and while some online sources recommend PowerShell scripts or JSON, I'm unable to find the right way to get this done. I'm hoping someone here might be able help with this. Grateful for any assistance.

SQL Server on Azure Virtual Machines
{count} votes

3 answers

Sort by: Most helpful
  1. ShaktiSingh-MSFT 15,341 Reputation points
    2024-03-26T06:06:31.27+00:00

    Hi Sridhar.Kamala,

    Welcome to Microsoft Q&A forum.

    As I understand, you want to backup SQL database in Azure VM from SQL agent.

    I assume you are following the documentation here: https://learn.microsoft.com/en-us/azure/backup/tutorial-sql-backup, please let us know at what step you are stuck so that we can assist you.

    Thanks

    0 comments No comments

  2. Olaf Helper 45,091 Reputation points
    2024-03-26T06:26:46.0266667+00:00

    It doesn't matter if SQL Server runs on-premise or on a VM in the Cloud; backup scheduled by a SQL Server-Agent job is the same, no difference beside may be the backup destination like BLOB storage.


  3. ShaktiSingh-MSFT 15,341 Reputation points
    2024-03-28T08:00:29.46+00:00

    Hi Sridhar.Kamala,

    Thanks for the reply.

    We can use the Powershell Enable-AzRecoveryServicesBackupProtection cmdlet to configure backup for this SQL DB.

    Complete documentation is here to refer: https://learn.microsoft.com/en-us/azure/backup/backup-azure-sql-automationLet us know if this helps or you have any queries.

    Thanks


Your answer

Answers can be marked as Accepted Answers by the question author, which helps users to know the answer solved the author's problem.