Open the service connections list on an Azure DevOps project and check how each one authenticates. Where the answer is a client secret, there is an expiry date a year or two out, and often nobody left who remembers creating it.
What the 2026 numbers say
GitGuardian's State of Secrets Sprawl 2026 counted 28.65 million new hardcoded secrets added to public GitHub during 2025, up 34% year on year. Commit volume grew faster than that, so the rate is arguably flat. Three other findings matter more. 59% of the compromised machines in their incident data were CI/CD runners, not personal laptops. 64% of the valid secrets they found in 2022 were still active in January 2026, after being reported to the owner. And internal repositories are roughly six times more likely than public ones to contain hardcoded secrets.
The 64% is the one that bears on design. Rotating a pipeline credential is hard because a client secret starts in one variable group and ends up in a local .env file, someone's shell history, a runbook written during an incident and two forks of the repo. Changing it in the vault breaks whichever copy you forgot, whenever that pipeline next runs. So the expiry date gets extended instead, because the alternative is an outage on a Tuesday.
Exchange a token instead of storing one
Workload identity federation replaces the stored secret with a trust relationship:
- The external platform issues a short-lived OIDC token describing the running workload, with an issuer (who minted it), a subject (which workload, in which project, under which connection) and an audience.
- The pipeline presents that token to Microsoft Entra as a client assertion.
- Entra checks it against a federated identity credential on a user-assigned managed identity or an app registration. Issuer, subject and audience all have to match what was configured, case-sensitively.
- On a match, Entra issues an access token for Azure.
Nothing is stored at either end. The tokens are short-lived and audience-bound, so a captured one is worthless within the hour, where a client secret with a two-year expiry works from any IP address.
Azure DevOps and the date in your calendar
The Azure DevOps issuer, the one with the https://vstoken.dev.azure.com prefix in the federated credential, was deprecated on 1 July 2026. Until June 2027 affected connections show a warning in pipeline runs and in the service connection UI. On 1 July 2027 that issuer reaches end of life. The replacement is the Microsoft Entra issuer, under https://login.microsoftonline.com/. It applies to Azure public cloud connections that use single-tenant Entra applications or managed identities; sovereign clouds and multi-tenant applications are out of scope for now.
There are two populations, and they need different work.
Connections still using a secret
Under Project settings > Service connections, pick the connection and press Convert. It swaps the authentication scheme to workload identity federation in place, keeping the connection name so no pipeline YAML changes. Conversion is reversible for seven days, which makes it much easier to get approved.
Azure DevOps has to have created the connection originally, since it can't modify credentials it doesn't own, and the connection can only be used by one project. Manually created and cross-project connections need the manual route below.
For more than a handful, Microsoft publishes a bulk conversion script that walks every eligible connection in a project and prompts per connection. It needs PowerShell 7.3 and the Azure CLI:
./convert_azurerm_service_connection_to_oidc_simple.ps1 `
-Project "Your-Project" `
-OrganizationUrl https://dev.azure.com/your-org
Connections already federated on the old issuer
These are already federated and still need migrating. Azure DevOps flags them in the service connection list with an Update button that moves them onto the Entra issuer. The second query below finds them.
Doing it yourself, with a user-assigned managed identity
Where you can't create app registrations, or want the identity managed as code, use a user-assigned managed identity with a federated credential whose subject names the service connection:
data "azurerm_client_config" "current" {}
resource "azurerm_user_assigned_identity" "deploy" {
name = "id-azdo-deploy"
resource_group_name = azurerm_resource_group.this.name
location = azurerm_resource_group.this.location
}
resource "azurerm_federated_identity_credential" "azdo" {
name = "azdo-sc-azure-prod"
user_assigned_identity_id = azurerm_user_assigned_identity.deploy.id
audience = ["api://AzureADTokenExchange"]
issuer = "https://login.microsoftonline.com/${data.azurerm_client_config.current.tenant_id}/v2.0"
# org / project / service connection name, exactly as they appear in Azure DevOps
subject = "sc://your-org/Your-Project/sc-azure-prod"
}
# Scope the rights to a resource group, not the whole subscription.
resource "azurerm_role_assignment" "deploy" {
scope = azurerm_resource_group.this.id
role_definition_name = "Contributor"
principal_id = azurerm_user_assigned_identity.deploy.principal_id
}
On azurerm 4.81 the credential attaches with user_assigned_identity_id; the older parent_id and resource_group_name arguments still work but are deprecated.
Then create the service connection with Managed identity, or with Workload identity federation (manual) and paste in the identity's client ID and tenant ID. The manual dialog shows the exact issuer and subject it will send, and they have to match the federated credential character for character. A case-mismatched project name is the usual first-run failure, and it surfaces as AADSTS700213, whose message names the subject it received.
The subject claim decides which connection can use the credential. sc://org/project/connection pins it to one named connection in one project, so a production connection and a pull-request connection should be two identities with different rights. Also authorise named pipelines rather than ticking grant access to all pipelines, or any pipeline in the project inherits production rights.
Runnable version: blog-examples/federated-credential.
GitHub Actions, the same idea
The issuer becomes https://token.actions.githubusercontent.com and the subject describes the repository and branch:
issuer = "https://token.actions.githubusercontent.com"
subject = "repo:your-org/your-repo:ref:refs/heads/main"
The workflow needs permissions: id-token: write, without which no token is issued and the login fails with an error that doesn't say so. Put the client, tenant and subscription IDs in vars rather than secrets, since none of them is a secret. Scoped to ref:refs/heads/main, only that branch qualifies; scoped to the repository alone, any fork or feature branch satisfies it too.
Inside Azure, and what Key Vault is still for
Federation is for callers outside Azure. Anything running on Azure compute uses a managed identity, and the platform handles the credential lifecycle (see identity is your security perimeter). A stored secret is for the cases where neither is supported: third-party API keys, database credentials for engines that don't speak Entra, signing certificates and licence keys. Those stay in Key Vault, with RBAC and purge protection.
Find what you still hold
Neither query changes anything, so both are safe to run against production this morning. First, app registrations that still carry a password, soonest expiry first:
az ad app list --all -o json \
--query "[?length(passwordCredentials)>\`0\`]" \
| jq -r '.[] | .displayName as $n | .appId as $a
| .passwordCredentials[] | [$n, $a, .endDateTime] | @tsv' \
| sort -t "$(printf '\t')" -k3
Second, which federated credentials are still pinned to the retiring Azure DevOps issuer:
az ad app list --all --query "[].appId" -o tsv | while read -r id; do
az ad app federated-credential list --id "$id" -o tsv \
--query "[?starts_with(issuer,'https://vstoken.dev.azure.com')].[name,issuer]" \
| sed "s|^|$id |"
done
Anything that comes back is on the July 2027 clock. Managed identities hold their federated credentials separately, so check those with az identity federated-credential list.
This week
- Run the first query. The output is your inventory of stored secrets.
- Run the bulk conversion script against your busiest Azure DevOps project. The seven-day revert window makes it a low-risk change to propose.
- Split the production service connection from the pull-request one, and authorise named pipelines.
- Run the second query and move anything on the
vstokenissuer across.