How to Resolve: Can't Leave Microsoft Entra ID Tenant
If you attempted to use the “leave tenant” button in the Microsoft Entra portal and your account is a personal Microsoft account that is a guest user of that tenant, you need to leave the directory using the My Account page instead of the Microsoft Entra portal page.
If this is the case, you can follow these steps to leave the tenant:
Turn off all incognito or private session on your browser.
Start a new incognito or private session on your browser.
Copy this URL https://myaccount.microsoft.com/?tenant=microsoft.onmicrosoft.com to your private browser.
Login with your personal (i.e. live.com, hotmail.com) account.
If you land on the My Access page, select your account avatar on the top right corner and click View Account.
Find the Organizations section and click Manage Organizations. In the Organizations page, you will find the associated organization of your personal account here.
If the administrator of this organization allows guest users to leave on their own, you will see a Leave button on the right side. If not, you have to contact the admin of this organization to manually remove you.
Click Leave.
See also: Leave an organization as a guest user — Microsoft Entra External ID | Microsoft Learn
Here are some additional steps if the previous steps did not work:
Collect both the tenant name and the tenant ID
The Tenant_Name will look something like tenantnameoutlook.onmicrosoft.com or tenantnamehotmail.onmicrosoft.com
The Tenant ID is a GUID, which you can view under the “Switch Directories” option. (For instance: xyz–1234–146b-abcd-a1b2c3)
Then, follow these steps:
Open private browser tab
Navigate to https://myaccount.microsoft.com/?tenantId=TENANT_NAMEoutlook.onmicrosoft.com
After signing in, select “Stay signed in”
Manually navigate to https://myaccount.microsoft.com/organizations/leave/TENANT_ID_GUID
Click Leave.
Close the private browser instance.
Here are some related Microsoft Q&A posts for reference:
How to get out of a directory and work in a new one in Azure? — Microsoft Q&A How To Leave another Tenant — Microsoft Q&A