Share via

Cannot leave organizations for old test tenants - getting AADSTS5000224

Nimrah Gill 20 Reputation points Microsoft Employee
2026-03-16T21:13:21.01+00:00

Hi!

I have used several test tenants in the past to invite myself as a B2B guest. However, majority of these test tenants have been expired since years ago. And everytime i run az login i see 10+ warnings about tokens i have for these tenants, and worried this is a security concern. And when i go to https://myaccount.microsoft.com/organizations to try to leave those organizations/tenants, the leave process refreshes constantly and then fails with error AADSTS5000224, and won't let me leave the organizations.

I have seen online for AADSTS5000224 that you should open an Azure support request. I opened one in the past for this but then it was closed telling to me to open a support ticket on Microsoft Digital and then they told me to go back and open a ticket on Azure again. And now when i tried to open a ticket on Azure again, it redirected me to open a support request on Microsoft Q&A here.

Can I please have some help here? I would really appreciate getting this resolved and not having to go through loops again.

Thank you so much and take care!

Nimrah

Microsoft Security | Microsoft Entra | Microsoft Entra ID
0 comments No comments

Answer accepted by question author
  1. Rukmini 37,050 Reputation points Microsoft External Staff Moderator
    2026-03-16T21:30:04.8166667+00:00

    Hello Nimrah Gill

    Based on your description, it looks like you’re encountering error code AADSTS5000224 when trying to access Azure. This error typically occurs when authentication for your Azure tenant has been temporarily disabled due to a recent security incident. To resolve this, we need to work with our engineering team to re-enable authentication for your tenant.

    Since you’re an internal Microsoft employee, I’ve provided the specific steps to involve the engineering team offline as the process differs for internal staff.

    If the resolution was helpful, kindly take a moment to click on 210246-screenshot-2021-12-10-121802.pngand click on Yes for was this answer helpful. And, if you have any further query do let us know.

    1 person found this answer helpful.

1 additional answer

Sort by: Most helpful
  1. Alex Burlachenko 20,425 Reputation points MVP Volunteer Moderator
    2026-03-17T08:09:03.3166667+00:00

    Hi Nimrah Gill,

    AADSTS5000224 in this scenario usually means the tenant u are trying to leave no longer exists in a healthy state. Those old test tenants were likely deleted or fully expired, but ur account still has stale guest references. Because the tenant is effectively gone, the leave operation cannot complete and just loops.

    This is not really a security issue. The warnings during az login are just token acquisition attempts against directories that no longer respond properly. There is no active access if the tenant is expired or deleted.

    Unfortunately this is not something u can fix yourself from the portal. The only real fix is backend cleanup of the stale B2B references. That has to be done by Microsoft identity engineering ))))) The correct path is an Entra ID ticket under Directory Management or B2B collaboration not an general Azure VM or subscription support. If you get redirected again be very explicit that this is an AADSTS5000224 stale tenant membership cleanup issue and that the tenants are expired test tenants u cannot leave. There is no client side workaround, it requires backend directory cleanup.

    rgds,

    Alex

    0 comments No comments

Your answer

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