As of my last knowledge update in January 2022, the synchronization of user profile pictures from Azure Active Directory (Azure AD) to Azure DevOps (formerly Visual Studio Team Services or VSTS) is not a built-in feature. However, you can achieve this synchronization through a custom solution using Azure AD Graph API, Microsoft Graph API, or other available mechanisms.
Here are general steps you can follow:
-
Register an Application in Azure AD:
- Go to the Azure portal.
- Navigate to Azure Active Directory > App registrations > New registration.
- Register an application and note down the Application (client) ID and Directory (tenant) ID.
-
Assign API Permissions:
- In the registered application, go to API permissions.
- Add the necessary permissions, such as User.Read.All for Microsoft Graph API.
-
Get App Secret:
- Generate a client secret in the Certificates & secrets section for your application.
-
Configure Azure DevOps Service Connection:
- In Azure DevOps, go to Project Settings > Service connections.
- Add a new service connection for Azure Resource Manager using the Application ID, Directory ID, and Secret obtained in previous steps.
-
Develop a Script or Application:
- Create a script or application that uses the Azure AD Graph API or Microsoft Graph API to retrieve user profile pictures from Azure AD.
- Use the Azure DevOps REST API to update user profile pictures in Azure DevOps.
-
Implement Sync Mechanism:
- Schedule the script or application to run periodically to keep Azure DevOps user profile pictures in sync with Azure AD.
Here's a simplified example in PowerShell using Microsoft Graph API for fetching and updating profile pictures:
Note: Make sure to adapt the script to your specific requirements and test it thoroughly in a controlled environment.
Always refer to the latest documentation for Azure AD Graph API, Microsoft Graph API, and Azure DevOps REST API, as these services may receive updates after my last knowledge update.