Service Account with Personal Access Token (PAT)

Aleksandar Panchevski 5 Reputation points

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 Active Directory
Azure Active Directory
An Azure enterprise identity service that provides single sign-on and multi-factor authentication.
16,711 questions
Azure App Service
Azure App Service
Azure App Service is a service used to create and deploy scalable, mission-critical web apps.
5,682 questions
{count} vote

1 answer

Sort by: Most helpful
  1. Grmacjon-MSFT 11,826 Reputation points

    @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.