An Azure relational database service.
Hello **Harj Sohal
**It sounds like you're dealing with a frustrating situation regarding unexpected database tier changes and restoration issues. Here’s what you can try:
Understanding the Issue: It seems the Azure SQLDBControlPlaneFirstPartyApp service is automatically changing your database tier and restoring it after you've deleted it, even though you've applied locks. This can happen if there are management operations that disregard these locks, especially concerning service tiers and how Azure handles resource scaling.
Apply Alternative Strategies:
- Change to Serverless Tier: If your database is inactive most of the time, consider switching to the serverless compute tier. It automatically pauses during inactivity, reducing costs significantly. You can switch this in the Azure Portal under your database's "Compute + storage" settings.
- Set the Database to Basic or Standard: If you want to keep it from scaling up, you can manually set the tier to Basic or Standard, which will significantly reduce costs.
- While locks are supposed to prevent deletion, they may not prevent management-level changes such as automatic tier changes related to Azure maintenance. You might want to ensure that your locks are applied at the correct level (resource group or database).
- Using ARM Templates or CLI: Instead of relying solely on the portal, consider applying your locks using Azure CLI or ARM templates to ensure they are set correctly. The command for adding a lock is:
az lock create --name PreventDelete --lock-type CanNotDelete --resource-group YourResourceGroup --resource-type Microsoft.Sql/servers/databases --resource-name YourDatabaseName
Also, I request you to please share the details requested in the private message for further troubleshooting.