Azure SQL Databses inaccessible and missing from Azure Portal following failed restore

Mark Jackson 1 Reputation point
2022-01-14T16:04:25.68+00:00

I attempted a point-in-time restore of three databases via the Azure Portal. These restores failed, saying a conflict had occurred.
The original databases are fine, and I have since successfully performed point-in-time restores.

Of the attempted restores three show in SSMS Object Explorer as "Restoring" and one as "Active"
Running the following against the master database gives the same info

SELECT name, user_access_desc, state_desc FROM sys.databases

Running as the designated Admin account (according to Azure Portal) SSMS tells me these databases don't exist if I try to access them or delete them.
None of these show in the Azure Portal, though all the other databases that are fine show as normal.

At this point I just want to clear up this residual mess.
Does anyone know how I can remove these?

Azure SQL Database
{count} votes

1 answer

Sort by: Most helpful
  1. Alberto Morillo 33,611 Reputation points MVP
    2022-01-14T16:52:22.95+00:00

    To better track those restore operations you can run the following query on the Master database of the Azure SQL Database logical server to track the progress of all restores.

    SELECT major_resource_id, percent_complete  
    FROM sys.dm_operation_status   
    WHERE operation LIKE '%DATABASE RESTORE%'  
    

    If you don't see any restore then no restore is in progress. If you don't see progress over time on the restores returned by the query, then create a support ticket. As you can see here, some customers report restore backups taking more than 72 hours to finish.

    You can also take a look at the Activity Log.

    Try to drop the databases those databases.

    Remove-AzSqlInstanceDatabase -Name "Database01" -InstanceName "managedInstance1" -ResourceGroupName "ResourceGroup01" -Force  
    
    0 comments No comments

Your answer

Answers can be marked as Accepted Answers by the question author, which helps users to know the answer solved the author's problem.