How to add a service principal to the organization of Azure DevOps

nguyen xuan hai 101 Reputation points
2023-08-10T07:09:11.8433333+00:00

In the Azure DevOps GUI, I can see that we can add a user or service principal to the organization. In actual, it requires to input a valid email address but service principal has no email address.

So, how to add a service principal to the organization of Azure DevOps?User's image

Community Center | Not monitored
{count} votes

2 answers

Sort by: Most helpful
  1. Shrikant Gupta 5 Reputation points Microsoft Employee
    2024-12-09T09:17:33.99+00:00
    • You can only add a managed identity or service principal for the tenant your organization is connected to. You need to add a directory to your organisation so that it can access all the SPs and other identities.

    Go to organisation setting > Microsoft Entra > Connect Directory.

    • Make sure to remember your organisation name, since I was not able to access my organisation after connecting the directory. Once you have successfully connected access your org using the link https://dev.azure.com/<org-name>

    After this you will be able to add Service Principals in your org.

    Hope this helps. Cheers!!

    1 person found this answer helpful.

  2. James Hamil 27,221 Reputation points Microsoft Employee Moderator
    2023-08-11T21:06:26.9033333+00:00

    Hi @nguyen xuan hai , try using the Object ID.

    1. Create a service principal if you haven't already.
    2. Once you have the service principal created, you'll need its Object ID. You can find this in the Azure portal under Azure Active Directory > App registrations > Your app > Overview.
    3. In Azure DevOps, navigate to your organization settings.
    4. Go to Users and click on Add user.
    5. In the Add user dialog, select Add Azure Active Directory user or group.
    6. Enter the Object ID of the service principal in the Search by name or email address field and click Search.
    7. The service principal should appear in the search results. Select it and click Add.

    Please let me know if you have any questions and I can help you further.

    If this answer helps you please mark "Accept Answer" so other users can reference it.

    Thank you,

    James


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.