-
Notifications
You must be signed in to change notification settings - Fork 90
Description
I am working on a gitops project that automatically pulls from Azure Devops repositories using managed identity. To test this in an automated way, I create an Azure DevOps organization, project and add the managed identity as a user in the Azure DevOps organization with permissions on the projects in the organization using azure-devops-go-api memberentitlement API (AddServicePrincipalEntitlement). At the end of the test, I want to cleanup the managed identity user that was added to the organization.
Looking at the Azure DevOps REST API and the go sdk memberentitlement deleteserviceprincipalentitlement API, this takes servicePrincipalID as the input. From what I have read so far, the servicePrincipalID is returned when addserviceprincipalentitlement API is called. Because of the way the cleanup happens, it is not always possible to know the servicePrincipal ID.
My question is if it is possible to delete the service principal entitlement by matching the user from graph API rather than using the servicePrincipalID ?
Thanks in advance!