Can we create Azure Active Directory using Azure SDK ?

narsimha 20 Reputation points
2024-07-01T10:45:23.6633333+00:00

Hi,

I need to create Azure Active Directory using Azure SDK. can anyone suggest me that is it possible or if not provide any document related to that ?

Microsoft Entra ID
Microsoft Entra ID
A Microsoft Entra identity service that provides identity management and access control capabilities. Replaces Azure Active Directory.
22,066 questions
{count} votes

5 answers

Sort by: Most helpful
  1. Deepanshukatara-6769 10,130 Reputation points
    2024-07-01T11:26:56.9033333+00:00

    Hi Narshima, Welcome to MS Q&A

    Yes, you can create an Azure Active Directory using Azure SDK. The Azure SDKs are collections of libraries built to make it easier to use Azure services from different languages. The SDKs are designed to simplify interactions between your application and Azure resources. To create an Azure Active Directory using Azure SDK, you can use the Microsoft Graph API, which is a RESTful web API that enables you to access Microsoft Cloud service resources. You can use the Microsoft Graph API to create, read, update, and delete different types of Azure Active Directory resources such as users, groups, and applications.

    For example -

    To create an Azure AD group using Azure SDK, you can use the az ad group create command. The --display-name and --mail-nickname parameters are required. Here is an example command:

    az ad 
    

    This will create a group with the display name "MyGroup" and mail nickname "MyGroup". You can add members to the group using the az ad group member add command. Here is an example command:

    az ad 
    

    Replace <object-id> with the object ID of the user or service principal you want to add to the group.


    References:


    kindly accept answer if it helps

    Please let me know if you have any question

    Thanks

    Deepanshu

    0 comments No comments

  2. Deleted

    This answer has been deleted due to a violation of our Code of Conduct. The answer was manually reported or identified through automated detection before action was taken. Please refer to our Code of Conduct for more information.


    Comments have been turned off. Learn more

  3. Deleted

    This answer has been deleted due to a violation of our Code of Conduct. The answer was manually reported or identified through automated detection before action was taken. Please refer to our Code of Conduct for more information.


    Comments have been turned off. Learn more

  4. Deleted

    This answer has been deleted due to a violation of our Code of Conduct. The answer was manually reported or identified through automated detection before action was taken. Please refer to our Code of Conduct for more information.


    Comments have been turned off. Learn more

  5. Marilee Turscak-MSFT 36,861 Reputation points Microsoft Employee
    2024-07-01T22:28:18.44+00:00

    Hi @narsimha ,It is not supported to create an Entra ID/Azure Active Directory tenant using the Azure SDK. You need to use the Azure Portal to create the tenant.

    For more information, see: Create a new tenant in Azure Active Directory.

    You can create a request for this capability in the feedback forum: https://feedback.azure.com/

    If the information helped you, please Accept the answer. This will help us and improve searchability for others in the community who may be researching similar questions.

    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.