Home Azure Cloud Modernizing Azure DevOps Service Connections with Workload Identity Federation

Modernizing Azure DevOps Service Connections with Workload Identity Federation

181
0

🔒 Introduction

Microsoft now recommends using Workload Identity Federation (WIF) with service connections instead of secrets for Azure DevOps to connect to Azure.

With WIF, Azure DevOps no longer stores long-lived secrets or passwords. Instead, it uses a trust-based identity system that issues short-lived tokens when your pipeline runs.

This modern approach means:

  • 🔐 No secrets to manage or rotate
  • ⏱️ No expiry headaches
  • 🧱 Better protection against credential leaks

Previously, the common approach for Azure DevOps was to use service connections with stored secrets to authenticate with Azure Resource Manager (ARM).
If your project still uses this older method, you’ll now see a message like:

“Convert your existing Azure Resource Manager service connections which use secrets to authenticate to leverage Workload identity federation instead, for improved security and simplified maintenance.”

This message is a friendly reminder from Microsoft that it’s time to modernize your setup and switch to Workload Identity Federation for improved security and simplified maintenance.

We can select Workload identity federation for Credential while creating a service connection.

We still have the option for secret but selecting it will give us a warning.


💡 What Is Workload Identity Federation?

Workload Identity Federation (WIF) allows Azure DevOps to connect to Azure without storing any credentials inside your pipelines.
It works by creating a federated trust between Azure DevOps and Microsoft Entra ID (formerly Azure Active Directory).

When your pipeline runs:

  1. Azure DevOps requests a temporary token from Entra ID.
  2. Entra ID verifies that the request is coming from your project.
  3. It issues a short-lived access token, valid only for that specific run.

This process uses the industry-standard OpenID Connect (OIDC) protocol — the same secure mechanism used in modern password-less authentication systems.


🚀 Why Switch to WIF?

Moving to Workload Identity Federation provides both security and simplicity.
Here’s a quick comparison:

Old (Secrets)New (Workload Identity Federation)
Uses service principal + secretUses trust-based identity (OIDC)
Secrets expire and must be rotatedTokens are temporary and auto-managed
Risk of secret leaksNo secrets stored anywhere
Manual setup & maintenanceSimplified configuration
Not aligned with Zero-TrustFully Zero-Trust compliant

In short, WIF makes your DevOps pipelines safer, simpler, and future-ready.


🧩 What Actually Changes When You Convert

When you convert a service connection to Workload Identity Federation:

  • Authentication changes from client secret to token exchange.
  • Azure DevOps authenticates to Microsoft Entra ID using OIDC tokens instead of passwords.
  • The service connection type becomes:
    Authentication Type: Workload Identity Federation
  • Your pipelines continue working normally — just with improved security and no stored secrets.

🪜 How to Convert/Create Service Connections

Step 1: Identify Your Old Connections

Go to your Azure DevOps project:
Project Settings → Service Connections

Look for any connections labeled as Using Service Principal Authentication — those are the ones that use secrets.


Step 2: Try Automatic Conversion

If you see a “Convert” button next to the service connection, Azure DevOps can upgrade it for you automatically.
Click the button, and it will show a message similar to the following:

Click Convert and it will:

  • Create the federated identity in Microsoft Entra ID
  • Update your service connection
  • Keep your pipelines working seamlessly

If that option isn’t available, follow the manual process below.


Step 3: Manual Setup (Federated Credential)

If automatic conversion isn’t available, you can set up Workload Identity Federation manually by creating a new service connection that uses Workload Identity Federation.

For detailed guidance, refer to Microsoft’s official article: Getting Started with Azure DevOps Service Connections Using Workload Identity Federation.


Step 4: Test Your Pipelines

Run a pipeline that depends on the updated service connection.
If it completes successfully — congratulations! 🎉
You’ve officially gone secret-less.

For example, here’s a simple Azure DevOps YAML snippet that uses the new connection:

- task: AzureCLI@2
  inputs:
    azureSubscription: 'Cocan-infra-conn-sec'   # your new WIF-based connection name
    scriptType: bash
    scriptLocation: inlineScript
    inlineScript: |
      az group list

If the task runs without authentication errors, your Workload Identity Federation setup is working perfectly. We will see this hands-on in the blog post Getting Started with Azure DevOps Service Connections Using Workload Identity Federation.


⚠️ Important Notes and Best Practices

  • Some older Azure DevOps extensions might not yet support Workload Identity Federation.
  • Ensure your Issuer, Subject, and Audience fields exactly match between Entra ID and DevOps.
  • Always assign least privilege permissions to your service principal or managed identity.
  • If you use shared pipelines across projects, make sure each has its own federated connection for proper isolation.

🧾 Quick Summary

StepTask
1Identify service connections using secrets
2Use “Convert” button if available
3Otherwise, manually configure Workload Identity Federation
4Test and verify pipelines
5Delete old secrets safely

🎯 Final Thoughts

Switching from secrets to Workload Identity Federation is one of the simplest and most impactful upgrades you can make in Azure DevOps.

It helps you:

  • Strengthen your security posture
  • Simplify maintenance
  • Align with Zero-Trust best practices

If you still see the conversion message in Azure DevOps, take it as an opportunity — not a warning.
By making the switch now, you’re preparing your pipelines for a more secure, automated, and password-less future.

Previous articleGetting Started with Azure DevOps Service Connections Using Workload Identity Federation
Next articleGetting Started with Azure Repos
Heartin Kanikathottu
As a seasoned Cloud and Security Architect, I’ve led transformative initiatives in key roles, including Vice President at Morgan Stanley, Principal Architect at Societe Generale, and Tech Lead & Cloud Security Architect at VMware, among others. I’m also an internationally published author with multiple books available on platforms like Amazon and O'Reilly. Notably, one of my books was recognized as the 8th best cloud computing book of all time in 2020, reflecting the impact of my contributions to the field. With over 15 professional certifications from providers such as Microsoft (Azure), Amazon (AWS), Oracle (Java), Pivotal (Spring), and IBM, I bring a wealth of expertise to my work. Academically, I hold dual Master’s degrees in Cloud Computing and Data Analytics. I’m passionate about sharing knowledge and mentoring others, which is why I actively speak at global technical forums such as Tech Opportunities Fest at Platform Calgary, Google's Kubernetes Meetup, Java User Group, Elasticsearch Meetup, and the Agile India Conference.

LEAVE A REPLY

Please enter your comment!
Please enter your name here