ansible-collections / azure

Development area for Azure Collections
https://galaxy.ansible.com/azure/azcollection
GNU General Public License v3.0
248 stars 332 forks source link

Backup SQL Server in Azure VM #835

Open kiweezi opened 2 years ago

kiweezi commented 2 years ago
SUMMARY

A way to backup just the SQL DB on an Azure VM. This could be added as a param to the azure_rm_backupazurevm module or made separately. It would also need to be available to use with the azure_rm_backuppolicy module.

ISSUE TYPE
COMPONENT NAME
ADDITIONAL INFORMATION

This is a commonly used recovery method in Azure in prod environments that is not available in Ansible.

---
- name: Creating a backup for Azure VM SQL Server
  azure_rm_backupazurevm:
    resource_group: 'myResourceGroup'
    recovery_vault_name: 'testVault'
    resource_id: '/subscriptions/00000000-0000-0000-0000-000000000000/         resourceGroups/myResourceGroup/providers/Microsoft.Compute/virtualMachines/testVM'
    backup_policy_id: '/subscriptions/00000000-0000-0000-0000-000000000000/         resourceGroups/myResourceGroup/providers/microsoft.recoveryservices/vaults/testVault/backupPolicies/ProdPolicy'
    backup_type: 'AzureVMSQLServer'
    state: 'create'
Fred-sun commented 2 years ago

@kiweezi Thank you for paying attention to this repo. I don't quite understand the problem you have. Is it that the function can't be realized? Could you describe the problem in detail? Thank you very much!

kiweezi commented 2 years ago

Hey @Fred-sun. Sorry for the delay.

What I'm trying to say in the above is that this feature is not available in the repo but is in Azure CLI and Powershell. The feature is simply initiating a back up the SQL server installation on an Azure VM to a recovery vault. There is also no way currently to make a scheduled backup of this using the recovery vault policies to my knowledge. This MS doc provides more info about it: https://docs.microsoft.com/en-us/azure/backup/tutorial-sql-backup

Does that make sense?

uccsjarmo commented 2 years ago

Hi,

I'm not sure if @kiweezi is trying to say that "azure_rm_backuppolicy should implement support for Azure IaaS MSSQL instance backup with using policy"?

I think this is a very good proposal.