Hello jb_devel,
Welcome to the Microsoft Q&A and thank you for posting your questions here.
I understand that your concern and questions on termination of Azure service in your Azure Cloud Infrastructure.
The below solution will help you to terminate Azure services and to:
- Complete elimination of ongoing costs for the unused database.
- Guaranteed ability to recreate the database in its original state, with all configurations intact.
- Mitigation of backup retention risks by exporting data to long-term, low-cost storage.
The first thing is to export your Data for Long-Term Recovery with the below options:
Option 1: Export to SQL Dump or BACPAC:
- Use tools like Azure Data Studio or
mysqldump
to export the database to a local system or Azure Blob Storage. This is an example for mysqldump using bash command:mysqldump -u <username> -h <server-name>.mysql.database.azure.com -p <database-name> > backup.sql
- Save the file in a secure location.
Option 2: Export Backups to Azure Blob Storage:
- Enable Azure Storage Blob and move the backups there to retain them for as long as needed.
Secondly, document your server configurations:
- Use Azure Resource Manager (ARM) templates or Terraform scripts to export the current configuration of the Azure Database for MySQL flexible server:
- In the Azure portal, navigate to the server's Export Template section.
- Save the ARM template locally. This will allow you to recreate the service with the same configurations (e.g., server size, region, network settings).
This is your third category of things to do by "Terminate the Service":
- Temporarily halts the server to stop billing for compute resources by "Stop the Server".
- Delete the server and confirm deletion to avoid incurring storage and management costs.
NOTE:
- To ensure minimal backup costs: Move Backups to Archive Storage to reduce costs, by transferring backups to the archive tier in Azure Blob Storage, which is significantly cheaper.
- For the future reusability, use the saved database dump or BACPAC file to restore the database on a new MySQL server if needed and reuse the ARM template or Terraform script to replicate the original server configuration.
- To put into considerations the cost, Azure Blob Storage (Archive tier) costs less than $0.001 per GB/month, making it a cost-effective option for long-term storage and recreating the service will incur standard provisioning costs based on the chosen server configuration.
I hope this is helpful! Do not hesitate to let me know if you have any other questions.
Please don't forget to close up the thread here by upvoting and accept it as an answer if it is helpful.