Unable to delete custom domain

Christo 0 Reputation points
2025-03-13T09:51:29.91+00:00

I'm unable to delete a custom domain, in order to move it to a different subscription, as there are references to existing users with this domain. However I've already moved these users indentities to the old onmicrosoft.com domain.

Because of these reference I get an error that:

"An attempt to delete the domain 'mydomain.com' has failed due to an unexpected error in the domain deletion process. Please try again."

Is there a way to force the renaming of any references to the users via the cli?

where else could there be references lingering for the existing mydomain.com?

Thanks for your help,

Christos

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

2 answers

Sort by: Most helpful
  1. Christo 0 Reputation points
    2025-03-13T12:27:31.9833333+00:00

    To answer my own question, it seems that there was a proxy address added to these users, in the form of smtp:@mydomain.com in addition to the smtp:@mydomain.onmicrosoft.com.

    You can only? remove this with the Microsoft Graph explorer by running a query:

    PATCH https://graph.microsoft.com/beta/users/<object_id_user>/

    {

    "proxyAddresses": ["smtp:******@mydomain.onmicrosoft.com"]

    }

    After that the domain can be removed

    0 comments No comments

  2. Raja Pothuraju 16,430 Reputation points Microsoft External Staff
    2025-03-13T15:20:53.84+00:00

    Hello @Christo,

    I'm glad that you were able to resolve your issue and thank you for posting your solution so that others experiencing the same thing can easily reference this! Since the Microsoft Q&A community has a policy that "The question author cannot accept their own answer. They can only accept answers by others ", I'll repost your solution in case you'd like to "Accept " the answer.

    Issue: Unable to delete custom domain.

    Solution: Resolved by @Christo.

    To answer my own question, it seems that there was a proxy address added to these users, in the form of smtp:@mydomain.com in addition to the smtp:@mydomain.onmicrosoft.com. You can only? remove this with the Microsoft Graph explorer by running a query: PATCH https://graph.microsoft.com/beta/users/<object_id_user>/ { "proxyAddresses": ["smtp:****@mydomain.onmicrosoft.com"]** } After that the domain can be removed

    If you have any other questions or are still running into more issues, please let me know. Thank you again 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

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.