Hi Lavanya Yatin,
Thanks for reaching out to Microsoft Q&A.
To restore a deleted Azure Database for MySQL Flexible Server instance, you need the following:
- Azure Subscription name hosting the original server
- Location where the server was created
Restore steps
- Go to the Activity Log from the Monitor page in Azure portal.
- In the Activity Log, select Add filter as shown and set the following filters for the:
- Subscription = Your Subscription hosting the deleted server
- Resource Type = Azure Database for MySQL Flexible Server (Microsoft.DBforMySQL/flexibleServers)
- Operation = Delete MySQL Server (Microsoft.DBforMySQL/flexibleServers/delete)
- Select the Delete MySQL Server event, select the JSON tab, and note the "resourceId" and "submissionTimestamp" attributes in JSON output. The resourceId is in the following format:
/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/resourceGroups/TargetResourceGroup/providers/Microsoft.DBforMySQL/flexibleServers/deletedserver
. - Go to Create Server REST API Page and select "Try It" tab highlighted in green and sign in with your Azure account. The Azure Resource Manager URL varies by the Azure environment. Verify you're using the correct one by referring to the Azure Resource Manager environment URLs section.
- Provide the resourceGroupName, serverName (deleted Azure Database for MySQL Flexible Server instance name), and subscriptionId, derived from the "resourceId" attribute captured in Step 3. At the same time, the version is prepopulated, as shown in the image.
- Scroll below on the Request Body section and paste the following: JSONCopy
{
"location": "Dropped Server Location", "properties": { "restorePointInTime": "submissionTimestamp - 15 minutes", "createMode": "PointInTimeRestore", "sourceServerResourceId": "resourceId" } }
1. Replace the following values in the request body above:
1. **Dropped server Location** with the Azure region where the deleted server was created
1. `submissionTimestamp` and `resourceId` with the values captured in Step 3.
1. For `restorePointInTime`, specify a value of `submissionTimestamp` minus **15 minutes** to ensure the command doesn't error out.
1. If you see Response Code 201 or 202, the restore request is successfully submitted.
1. The server creation can take time, depending on the database size and computing resources provided on the original server. The restore status can be monitored from:
1. Activity log by filtering for:
1. **Subscription** = Your Subscription
1. **Resource Type** = Azure Database for MySQL Flexible Server (Microsoft.DBforMySQL/flexibleServers)
1. **Operation** = Update MySQL Server Create
Reference doc: [https://learn.microsoft.com/en-us/azure/mysql/flexible-server/how-to-restore-dropped-server](https://learn.microsoft.com/en-us/azure/mysql/flexible-server/how-to-restore-dropped-server)
**Please do not forget to "Accept the answer” and “up-vote” wherever the information provided helps you, this can be beneficial to other community members.**