How to create Azure Directory(Tenant) dynamically from C# application

Jignesh Patel 21 Reputation points
2021-10-14T11:56:15.743+00:00

I would like to create Azure Directory(Tenant) dynamically from C# application. Is it possible if yes then do we've any reference links?

C#
C#
An object-oriented and type-safe programming language that has its roots in the C family of languages and includes support for component-oriented programming.
10,390 questions
Microsoft Entra External ID
Microsoft Entra External ID
A modern identity solution for securing access to customer, citizen and partner-facing apps and services. It is the converged platform of Azure AD External Identities B2B and B2C. Replaces Azure Active Directory External Identities.
2,678 questions
Microsoft Entra ID
Microsoft Entra ID
A Microsoft Entra identity service that provides identity management and access control capabilities. Replaces Azure Active Directory.
19,852 questions
0 comments No comments
{count} votes

2 answers

Sort by: Most helpful
  1. Alan Kinane 16,796 Reputation points MVP
    2021-10-14T12:12:53.5+00:00

    This might help if you are using the Partner Center API: https://learn.microsoft.com/en-us/partner-center/develop/create-a-customer

    0 comments No comments

  2. JamesTran-MSFT 36,481 Reputation points Microsoft Employee
    2021-10-14T18:09:43.6+00:00

    @Jignesh Patel
    Thank you for your post!

    Unfortunately, it's not possible to create an Azure Active Directory (Azure AD) tenant using C#. As of right now, the only way to create an Azure AD tenant would be through the Azure Portal. For more info - Create a new tenant in Azure Active Directory.

    If you have any other questions, 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.