2

I have used the following powershell script to delete a database:

Remove-AzureRmSqlDatabase -ServerName $server -ResourceGroupName $rgname -DatabaseName $dbname

(first setting the variables)

and have tried using the Azure Portal

The port indicates a success in deletion, as does the activity logs, however

the resource is not being deleted?

Screenshot of activity log:

Activity Log

The deletes (on a number of occasions after the db comes back) show successful, however there is an audit policy that seems to be doing something. There are no Locks on the resrouce group.

UPDATE:

I have deleted from SSMS, and is not showing there or in the portal anymore.. (will wait to see if it comes back, as it did when deleting via portal and powershell)

UPDATE 2: Database is now back, so this is the database having been deleted 3 ways, portal, powershell and via SSMS.

9
  • can you post an image Commented Feb 16, 2020 at 8:34
  • What would you expect the image to show, to help? Commented Feb 16, 2020 at 8:37
  • stackoverflow.com/questions/17085377/cant-delete-azure-database Commented Feb 16, 2020 at 8:39
  • The Portal indicates a successful delete as does the activity log. and the result of the powershell script is similar to this post: voiceofthedba.com/2017/03/22/… Commented Feb 16, 2020 at 8:45
  • can you prove its not being deleted? Commented Feb 16, 2020 at 9:02

2 Answers 2

1

It turns out the web application uses EF migrations which is recreating the database.

Note: The bigger issue is that the database is created on a much higher, and much more expensive tier.

Sign up to request clarification or add additional context in comments.

Comments

0

Do you happen to have a rogue policy somewhere? It seems something is running a Policy Effect: deployIfNotExist on the resource. Without access to your environment, there's not much I could recommend.

Check the documentation here: https://learn.microsoft.com/en-us/azure/governance/policy/concepts/effects#audit

2 Comments

Thanks, will look into this, I have not specifically created a policy like this but will check.
The only policy I can see on this is AuditIfNotExists but auditing is not enabled, not sure if this is related?

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.