Azure DevOps Personal Access Token
Detects Azure DevOps personal access tokens (PATs). The primary detector is the current 84-character format, which carries a fixed AZDO signature at positions 76-80. Tokens in the legacy 52-character Base32 format are detected only when a specific Azure DevOps term is nearby, because that shape has no signature. Microsoft Purview ships a built-in sensitive information type for the same credential, which also validates the token checksum; this version cannot.
- Type
- regex
- Engine
- universal
- Confidence
- high
- Confidence justification
- High for the current format: Microsoft documents a fixed length (84) and a fixed AZDO signature at a fixed offset, so a chance match needs an 84-character alphanumeric run with those four letters in exactly that place. The legacy 52-character format is a generic Base32 shape with no signature; it is capped at the 75 tier and needs a specific Azure DevOps term, and the whitespace that let the previous regex match ordinary prose has been removed. Neither branch validates the checksum that Microsoft's built-in detector uses.
- Detection quality
- Mixed
- Jurisdictions
- global
- Regulations
- Criminal Code Act 1995 (Cth)
- Frameworks
- CIS Controls, ISO 27001, NIST CSF, PCI-DSS, SOC 2
- Data categories
- credentials, security
- Scope
- specific
- Risk rating
- 8
- Platform compatibility
- Purview: Compatible, GCP DLP: Unsupported, Macie: Unsupported, Zscaler: Compatible, CrowdStrike DLP: Unsupported, Palo Alto: Unsupported, Netskope: Unsupported
Pattern
(?-i)(?<![A-Za-z0-9])([A-Za-z0-9]{76}AZDO[A-Za-z0-9]{4})(?![A-Za-z0-9])
Corroborative evidence keywords
Azure DevOps, azuredevops, dev.azure.com, visualstudio.com, VSTS, ADO, personal access token, PAT, api key, api_key, apikey, access key, access token, auth token, authorization, bearer, conn str, connection string, connectionstring, cookie (+41 more)
Proximity: 300 characters
Should match
abcdefghijklmnopqrstuvwxyz0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnAZDOabcd— Bare current-format PAT (76 alphanumerics, AZDO, 4 alphanumerics); 65 discovery tierURL="org.visualstudio.com/proj"; PAT = "abcdefghijklmnopqrstuvwxyz0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnAZDOabcd"— Current-format PAT in the assignment shape Microsoft's own example uses; 85 tierAZURE_DEVOPS_PAT=ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789ABCDEFGHIJKLMNAZDO0123— Current-format PAT in the environment variable Microsoft's documentation uses; 85 tierAzure DevOps PAT (old format): abcdefghijklmnopqrstuvwxyz234567abcdefghijklmnopqrst— Legacy 52-character Base32 PAT with a specific Azure DevOps term; 75 tiergit remote https://dev.azure.com/contoso/_git/app token 234567abcdefghijklmnopqrstuvwxyz234567abcdefghijklmn— Legacy 52-character PAT next to a dev.azure.com URL; 75 tier
Should not match
Azure DevOps pipeline the nightly build agent restarts when the queue is idle— 55 characters of lowercase prose after "Azure DevOps pipeline"; the previous regex allowed whitespace and matched thisabcdefghijklmnopqrstuvwxyz234567abcdefghijklmnopqrst— Legacy-shaped 52-character value with no Azure DevOps term; the legacy branch never fires alone, not even for discoveryazure abcdefghijklmnopqrstuvwxyz234567abcdefghijklmnopqrst— The generic word "azure" next to a legacy-shaped value is not specific Azure DevOps evidenceAzure DevOps PAT ABCDEFGHIJKLMNOPQRSTUVWXYZ0189ABCDEFGHIJKLMNOPQRSTUV— 52 characters but upper case with digits 0/1/8/9, so not a lowercase Base32 body, even with an Azure DevOps termdev.azure.com PAT abcdefghijklmnopqrstuvwxyz0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmAZDOabcde— 84 alphanumerics with AZDO one position early (75 before it, 5 after), so the signature is not at 76-80dev.azure.com PAT abcdefghijklmnopqrstuvwxyz0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnazdoabcd— Signature in lower case; the format is case-sensitiveAzure DevOps aaaaaaaaaaaaa— Too short to be a PAT in either formattemplate example placeholder record identifier— Template/sample context should be excluded even when anchor words are present
Known false positives
- Documentation and tutorials that show a made-up token in the 84-character AZDO shape. Microsoft's own example value has this shape and is described as invalidated; this pattern still matches it because it cannot test the checksum. Mitigation: The template-exclusion dictionary suppresses values framed as examples or placeholders. For checksum-accurate matching, run Microsoft's built-in Azure DevOps personal access token SIT alongside this one.
- Other 52-character lowercase Base32 values near an Azure DevOps term, such as a Base32-encoded 256-bit hash or key in a pipeline log. Mitigation: The legacy branch stops at the 75 tier and needs a specific Azure DevOps term within 300 characters. Azure DevOps Services has issued the 84-character format since July 2024 and advises regenerating older tokens, so review legacy matches with that in mind.
- A current-format PAT that has already expired or been revoked. Mitigation: The pattern cannot test validity. Treat a match as a credential until the token is confirmed revoked on the user's Personal access tokens page.
References
- Use personal access tokens, PAT format - Microsoft Learn (PATs are 84 characters with 52 randomized; fixed AZDO signature at positions 76 through 80)
- Azure DevOps personal access token entity definition - Microsoft Learn (84 case-sensitive a-z, A-Z, 0-9 with AZDO at 76-80; example value; built-in SIT has a checksum; keyword list)
- Azure DevOps Sprint 241 release notes, July 2024 - Microsoft Learn (token length increased from 52 to 84 characters; integrators should support both lengths)
- TruffleHog Azure DevOps PAT detector (corroborates the legacy token as 52 lowercase characters, keyword-gated)