Clean up resources and delete the tenant

When you've finished the Azure AD B2C tutorials, you can delete the tenant you used for testing or training. To delete the tenant, you'll first need to delete all tenant resources. In this article, you'll:

  • Use the Delete tenant option to identify cleanup tasks
  • Delete tenant resources (user flows, identity providers, applications, users)
  • Delete the tenant

Identify cleanup tasks

  1. Sign in to the Azure portal with a global administrator or subscription administrator role. Use the same work or school account or the same Microsoft account that you used to sign up for Azure.

  2. Make sure you're using the directory that contains your Azure AD B2C tenant. Select the Directories + subscriptions icon in the portal toolbar.

  3. On the Portal settings | Directories + subscriptions page, find your Azure AD B2C directory in the Directory name list, and then select Switch.

  4. Select the Azure Active Directory service.

  5. Under Manage, select Properties.

  6. Under Access management for Azure resources, select Yes, and then select Save.

  7. Sign out of the Azure portal and then sign back in to refresh your access. Make sure you're using the directory that contains your Azure AD B2C tenant. Select the Directories + subscriptions icon in the portal toolbar.

  8. On the Portal settings | Directories + subscriptions page, find your Azure AD B2C directory in the Directory name list, and then select Switch.

  9. Select the Azure Active Directory service.

  10. On the Overview page, select Delete tenant. The Required action column indicates the resources you'll need to remove before you can delete the tenant.

    Delete tenant tasks

Delete tenant resources

If you have the confirmation page open from the previous section, you can use the links in the Required action column to open the Azure portal pages where you can remove these resources. Or, you can remove tenant resources from within the Azure AD B2C service using the following steps.

  1. Sign in to the Azure portal with a global administrator or subscription administrator role. Use the same work or school account or the same Microsoft account that you used to sign up for Azure.

  2. Make sure you're using the directory that contains your Azure AD B2C tenant. Select the Directories + subscriptions icon in the portal toolbar.

  3. On the Portal settings | Directories + subscriptions page, find your Azure AD B2C directory in the Directory name list, and then select Switch.

  4. Select the Azure AD B2C service. Or use the search box to find and select Azure AD B2C.

  5. Delete all users except the admin account you're currently signed in as: Under Manage, select Users. On the All users page, select the checkbox next to each user (except the admin account you're currently signed in as). Select Delete, and then select Yes when prompted.

    Delete users

  6. Delete app registrations and the b2c-extensions-app: Under Manage, select App registrations. Select the All applications tab. Select an application, and then select Delete. Repeat for all applications, including the b2c-extensions-app application.

    Delete application

  7. Delete any identity providers you configured: Under Manage, select Identity providers. Select an identity provider you configured, and then select Remove.

    Delete identity provider

  8. Delete user flows: Under Policies, select User flows. Next to each user flow, select the ellipses (...) and then select Delete.

    Delete user flows

  9. Delete policy keys: Under Policies, select Identity Experience Framework, and then select Policy keys. Next to each policy key, select the ellipses (...) and then select Delete.

  10. Delete custom policies: Under Policies, select Identity Experience Framework, select Custom policies, and then delete all policies.

Delete the tenant

  1. Sign in to the Azure portal with a global administrator or subscription administrator role. Use the same work or school account or the same Microsoft account that you used to sign up for Azure.

  2. Make sure you're using the directory that contains your Azure AD B2C tenant. Select the Directories + subscriptions icon in the portal toolbar.

  3. On the Portal settings | Directories + subscriptions page, find your Azure AD B2C directory in the Directory name list, and then select Switch.

  4. Select the Azure Active Directory service.

  5. If you haven't already granted yourself access management permissions, do the following:

    • Under Manage, select Properties.
    • Under Access management for Azure resources, select Yes, and then select Save.
    • Sign out of the Azure portal and then sign back in to refresh your access, and select the Azure Active Directory service.
  6. On the Overview page, select Delete tenant.

    Delete the tenant

  7. Follow the on-screen instructions to complete the process.

Next steps

In this article, you learned how to:

  • Delete your tenant resources
  • Delete the tenant

Next, learn more about getting started with Azure AD B2C user flows and custom policies.