AAD: Cannot Delete Tenant

Matt Steffens 1 Reputation point
2022-03-30T06:50:42.047+00:00

Trying to delete AAD Tenant but being blocked by "License-based subscription" check:

192236-image.png

I have followed https://learn.microsoft.com/en-us/azure/active-directory/enterprise-users/directory-delete-howto article, but no success.

It appears to be WINDOWS_STORE subscription(s) associated with the tenant as per resolution of this Q&A post - https://learn.microsoft.com/en-us/answers/questions/42111/cant-delete-seat-based-subscription-to-delete-an-a.html

Running some PowerShell commands also reveals that tenant has enabled WINDOWS_STORE subscription(s):

188249-image.png

188254-image.png

Microsoft Entra ID
Microsoft Entra ID
A Microsoft Entra identity service that provides identity management and access control capabilities. Replaces Azure Active Directory.
21,897 questions
0 comments No comments
{count} votes

3 answers

Sort by: Most helpful
  1. JamesTran-MSFT 36,631 Reputation points Microsoft Employee
    2022-03-30T20:29:50.433+00:00

    @Matt Steffens
    Thank you for your post and for sharing the related Q&A question!

    Because you're having issues with deleting your Windows Store Subscription in order to delete your Azure Active Directory tenant, can you try creating a Support Request using the below screenshot? I'll also share the solution from the related Q&A thread below - Can't delete seat-based subscription to delete an azure active directory.

    188528-image.png

    ---------------

    Issue:
    Can't delete license-based subscription to delete an azure active directory.

    Troubleshooting:
    Doc followed - Delete a tenant in Azure Active Directory

    • Azure AD Admin Center, Azure Portal, Microsoft Store For Business, and Microsoft 365 Admin center, didn't show a subscription to be deleted.

    Recommended Steps:
    Since this requires further troubleshooting, it's recommended to Create a Support Request.

    RCA:
    There was a “WINDOWS_STORE (trial) subscription” under the Tenant that you provided.

    Solution:
    Support had to collaborate with internal resources to manually remove the subscription. (~3 day period after deletion for it to update in your Tenant).

    If you're having issues creating the support request, please let me know.
    Thank you for your time and patience throughout this issue.

    ----------

    Please remember to "Accept Answer" if any answer/reply helped, so that others in the community facing similar issues can easily find the solution.

    0 comments No comments

  2. Matt Steffens 1 Reputation point
    2022-04-12T08:35:04.547+00:00

    UPDATE: It turns out those two WINDOWS_STORE subscriptions associated with my tenant exist as I had suggested, however they are only not visible within M365 Admin portal (even after setting all the filters to display all subscriptions regardless of their status under Billing > Your Products in M365 Admin portal).

    Running Get-MsolSubscription | fl command via PowerShell reveals required OcpSubscriptionId values which we should use to craft URL address, allowing us to access "hidden" subscription.

    192180-image.png

    Steps to cancel/delete WINDOWS_STORE subscriptions:

    • Sign-in using Global Admin to M365 Admin portal
    • Use https://admin.microsoft.com/AdminPortal/Home#/subscriptions/webdirect/[SUBSCRIPTION_GUID] and replace the [SUBSCRIPTION_GUID] segment with OcpSubscriptionId value (one by one if you need to action more than one)
    • Cancel and then delete the subscription

    NOTE: The Delete Subscription option initiates Quick Deprovisioning. To know if it worked, you can check the banner as it should state that "Your Data will be deleted on [DATE]", where the date is three days from when the deletion was initiated (that is the day that the subscription will reach the Deprovisioned state).

    0 comments No comments

  3. Matt Steffens 1 Reputation point
    2022-04-19T01:37:17.323+00:00

    UPDATE 2: After cancelling and deleting the WINDOWS_STORE subscriptions, I had waited for 72 hours+ period (it took extra 10 hours on top in my case) in order for subscriptions to actually be deprovisioned and removed.

    I then returned to Azure Portal to proceed with Tenant deletion as to my knowledge the 'License-based subscription' pre-requisite was the only item stopping me from deleting my tenant (see screenshot in my initial post above). However, this time around the 'Enterprise Applications' pre-requisite item check had started blocking the ability to remove the tenant for some reason (the 'License-based subscription' pre-requisite check was now successful).

    Yet again I was still unable to delete the tenant. If I followed the suggested link to remove the 'Enterprise applications' I was unable to see/find any remaining enterprise applications which I could remove via Azure Portal UI.

    One more time I connected to Azure via PowerShell and executed these commands:

    • Connect-AzAccount -tenant "tenant GUID"
    • Connect-AzureAD
    • Get-AzureADServicePrincipal (display list of Azure AD service principals)

    I eyeballed the list of service principals returned and decided to attempt removing Microsoft Office 365 Portal service principal.

    ObjectId: c480ce69-07ae-4aa1-bdbe-2db3f06ca2d4
    AppId: 00000006-0000-0ff1-ce00-000000000000
    DisplayName: Microsoft Office 365 Portal

    I ran this command:

    • Remove-AzureADServicePrincipal -ObjectId c480ce69-07ae-4aa1-bdbe-2db3f06ca2d4

    The command executed successfully and now all the pre-requisite checks passed which finally allowed the tenant deletion.

    194074-image.png

    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.