Service Account with Personal Access Token (PAT)

Aleksandar Panchevski 15 Reputation points
2023-03-01T11:50:55.6166667+00:00

Hi guys,
I want to change PAT which currently use for CD pipeline in Azure Devops. Want to create Service Account and to use that PAT.
What is the procedure for creating Service Account PAT?
Does it good practice?

Azure App Service
Azure App Service
Azure App Service is a service used to create and deploy scalable, mission-critical web apps.
7,663 questions
Microsoft Entra ID
Microsoft Entra ID
A Microsoft Entra identity service that provides identity management and access control capabilities. Replaces Azure Active Directory.
21,371 questions
{count} votes

1 answer

Sort by: Most helpful
  1. Grmacjon-MSFT 17,886 Reputation points
    2023-03-03T02:22:57.69+00:00

    @Aleksandar Panchevski I believe you're able to acheive this using the PAT REST API. Please follow the steps in this documentation: Manage personal access tokens (PATs) using REST API

    With the PAT Lifecycle Management API, you can easily manage the PATs associated with your organizations using automated processes. This rich set of APIs enables you to manage the PATs you own, allowing you to create new personal access tokens and renew or expire existing personal access tokens.

    To use the API, you must authenticate with an Azure AD token. Learn more on how to do this in the following authentication section.

    In order to do so, a few prerequisites must be met:

    • You must have an Azure AD tenant with an active Azure subscription.
    • Depending on your tenant's security policies, your application may need to be granted permissions to access resources in the organization. At this moment, the only way to proceed with using this app in this tenant is to ask an admin to grant permission to the app before you can use it.

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.