Skip to content

Delete Service Principal Entitlement using graph information #170

@dipti-pai

Description

@dipti-pai

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!

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions