none
Unable to delete all components of SQL Database Managed Instance deployment

    Întrebare

  • Is there a way to delete a SQL Database Managed Instance deployment ? I created all components in a single resource group (Vnet, Route Table and the Managed Instance). I have tried to delete the resource group via the azure portal and powershell however, this did not work. I have removed most items and have narrowed down the problem to an inability to perform deletes on  Microsoft.Sql/virtualClusters resource types. This is, in turn, preventing removal of the Vnet. I am met with the error below when I try to do so. Will this be something addressed in General Availability and is there a way to resolve now?:

     

    Remove-AzureRmResource : The pipeline has been stopped.
    At line:1 char:1
    + Remove-AzureRmResource -ResourceId  /subscriptions/my_subscription_id ...
    + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
        + CategoryInfo          : CloseError: (:) [Remove-AzureRmResource], PipelineStoppedException
        + FullyQualifiedErrorId : Microsoft.Azure.Commands.ResourceManager.Cmdlets.Implementation.RemoveAzureResourceCmdlet

    Remove-AzureRmResource : MethodNotAllowed : The HTTP method 'DELETE' is not supported on the resource 'https://management.uksouth.control.database.windows.net/modules/AzureResourceManager/su
    bscriptions/my_subscription_id/resourceGroups/SQLManagedInstance/providers/Microsoft.Sql/virtualClusters/VirtualClusterdefault?api-version=2015-05-01-preview'.
    At line:1 char:1
    + Remove-AzureRmResource -ResourceId  /subscriptions/my_subscription_id ...
    + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
        + CategoryInfo          : CloseError: (:) [Remove-AzureRmResource], ErrorResponseMessageException
        + FullyQualifiedErrorId : MethodNotAllowed,Microsoft.Azure.Commands.ResourceManager.Cmdlets.Implementation.RemoveAzureResourceCmdlet

    Performing Get-AzureRmResource trimmed output.

    Name              : VirtualClusterdefault
    ResourceId        : /subscriptions/my_subscription_id/resourceGroups/SQLManagedInstance/providers/Microsoft.Sql/virtualClusters/VirtualClusterdefault
    ResourceName      : VirtualClusterdefault
    ResourceType      : Microsoft.Sql/virtualClusters
    ResourceGroupName : SQLManagedInstance
    Location          : uksouth
    SubscriptionId    : my_subscription_id

    14 mai 2018 10:29

Răspunsuri

Toate mesajele

  • Hello,

    Did you use the Remove-AzureRmSqlServer cmdlet?

    https://docs.microsoft.com/en-us/powershell/module/azurerm.sql/remove-azurermsqlserver?view=azurermps-6.0.0



    Regards,

    Alberto Morillo
    SQLCoffee.com

    • Marcat ca răspuns de SQLNinja 15 mai 2018 11:29
    14 mai 2018 12:30
  • Hi Alberto,

    Thanks for the reply. I did not use the cmdlet. I was able to delete the SQL Database Managed Instance via the portal. What I am unable to do is remove the virtual cluster which I think is preventing the removal of the subnet and subsequently the Vnet. I have just tried using the cmdlet you suggested, I wasn't really expecting it to work (based on resource type) and it did not. Results below. Your enagement is very much appreciated :)

    PS C:\Users\my_name> Remove-AzureRmSqlServer -ResourceGroupName "SQLManagedInstance" -ServerName "VirtualClusterdefault"
    Remove-AzureRmSqlServer : The Resource 'Microsoft.Sql/servers/VirtualClusterdefault' under resource group 'SQLManagedInstance' was not found.
    At line:1 char:1
    + Remove-AzureRmSqlServer -ResourceGroupName "SQLManagedInstance" -Serv ...
    + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
        + CategoryInfo          : CloseError: (:) [Remove-AzureRmSqlServer], CloudException
        + FullyQualifiedErrorId : Microsoft.Azure.Commands.Sql.Server.Cmdlet.RemoveAzureSqlServer
    14 mai 2018 13:02
  • Hi Alberto,

    Thanks for the reply. I did not use the cmdlet. I was able to delete the SQL Database Managed Instance via the portal. What I am unable to do is remove the virtual cluster which I think is preventing the removal of the subnet and subsequently the Vnet. I have just tried using the cmdlet you suggested, I wasn't really expecting it to work (based on resource type) and it did not. Results below. Your enagement is very much appreciated :)

    PS C:\Users\my_name> Remove-AzureRmSqlServer -ResourceGroupName "SQLManagedInstance" -ServerName "VirtualClusterdefault"
    Remove-AzureRmSqlServer : The Resource 'Microsoft.Sql/servers/VirtualClusterdefault' under resource group 'SQLManagedInstance' was not found.
    At line:1 char:1
    + Remove-AzureRmSqlServer -ResourceGroupName "SQLManagedInstance" -Serv ...
    + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
        + CategoryInfo          : CloseError: (:) [Remove-AzureRmSqlServer], CloudException
        + FullyQualifiedErrorId : Microsoft.Azure.Commands.Sql.Server.Cmdlet.RemoveAzureSqlServer

    From the error it looks that the Resource group name you provided is not correct. Please check if the resource name provided is correct.

    For more information about this you can check the below link -

    https://docs.microsoft.com/en-us/powershell/module/azurerm.sql/remove-azurermsqlserver?view=azurermps-6.0.0


    Please Mark as Answer if my post works for you or Vote as Helpful if it helps you. Kapil Singh

    14 mai 2018 15:50
  • Hi Kapil,

    The error would seem as you suggest without further scrutiny. The resource is not found as it is not of the type "Microsoft.Sql/servers". The resource is of the type Microsoft.Sql/Virtualservers and is "likely" why it can not be deleted with the cmdlet.

    Thanks for engaging, appreciated as above :)

    14 mai 2018 16:55
  • Hello,

    I am proceeding to share this issue with a list of Azure SQL Database contacts, trying to find ideas how to deal with the issue. I am not promising any results



    Hope this helps.



    Regards,

    Alberto Morillo
    SQLCoffee.com

    14 mai 2018 18:25
  • Hello,

    The answer received is the following:

    Currently there’s a delay between the moment a customer drops last instance and the moment the compute resources (and release resource group / VNet) are decommissioned. It may take some hours but this latency will be reduce when the service goes to GA. Tomorrow when you read this message you should be able remove all the remnants. If you need to release the resources as soon as possible please open a support ticket.



    Hope this helps.



    Regards,

    Alberto Morillo
    SQLCoffee.com



    15 mai 2018 03:53
  • Hi Alberto,

    Thanks for your response and for the benefit of anyone else encountering the issue during preview, the virtual cluster was indeed deleted when I checked today. I was then easily able to remove the virtual network. I would estimate it took ~12 - 24 hours (activity log is vague) for thee virtual cluster to be removed, however, I am not entirely sure which command triggered the action, deleting the resource group via the portal or using the Remove-AzureRmSqlServer cmdlet. I would guess it was the latter as the resource group and Vnet were still in place.

    Many thanks.


    15 mai 2018 11:29
  • Hello,

    Please take in consideration the service is in preview. User experience will greatly improve by the time of GA.


    Thank you for visiting Azure forums.


    Have a great day!



    Regards,

    Alberto Morillo
    SQLCoffee.com


    15 mai 2018 11:53