<?xml version="1.0" encoding="utf-8" standalone="yes"?><rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom"><channel><title>Azure DevOps on Build Deploy Repeat</title><link>https://builddeployrepeat.com/tags/azure-devops/</link><description>Recent content in Azure DevOps on Build Deploy Repeat</description><generator>Hugo -- gohugo.io</generator><language>en-us</language><lastBuildDate>Wed, 20 May 2026 00:00:00 +0000</lastBuildDate><atom:link href="https://builddeployrepeat.com/tags/azure-devops/index.xml" rel="self" type="application/rss+xml"/><item><title>How to Connect Azure DevOps to Azure with a Service Connection (Step-by-Step App Registration Guide)</title><link>https://builddeployrepeat.com/post/azure/azure-app-registration-service-connection/</link><pubDate>Wed, 20 May 2026 00:00:00 +0000</pubDate><guid>https://builddeployrepeat.com/post/azure/azure-app-registration-service-connection/</guid><description>&lt;p>If you’re planning to deploy resources to Azure using Azure DevOps pipelines, the very first step is to set up secure connectivity between the two platforms. This is done by creating an Application Registration in Azure (Entra ID) on your Azure Tenant and using it in Azure DevOps as a Service Connection. Without this setup, Azure DevOps pipelines can’t deploy to your Azure subscription. This is the security handshake that makes CI/CD possible in Azure.&lt;/p>
&lt;p>In this post, I’ll walk you through:&lt;/p>
&lt;ul>
&lt;li>What an App Registration is and why we need it&lt;/li>
&lt;li>How to create one in Azure&lt;/li>
&lt;li>How to configure a Service Connection in Azure DevOps&lt;/li>
&lt;li>How to test the connection with a pipeline&lt;/li>
&lt;/ul>
&lt;p>By the end, you’ll have a working setup that can authenticate Azure DevOps to your Azure subscription.&lt;/p>
&lt;hr>
&lt;h2 id="what-is-an-app-registration">What is an App Registration?
&lt;/h2>&lt;p>Think of an App Registration as an identity for applications or services.&lt;/p>
&lt;ul>
&lt;li>When a user logs in to Azure, they authenticate with their username and password.&lt;/li>
&lt;li>When a service (like Azure DevOps) needs access to Azure, it uses an App Registration instead.&lt;/li>
&lt;/ul>
&lt;p>An App Registration provides:&lt;/p>
&lt;ul>
&lt;li>A Client ID (like a username)&lt;/li>
&lt;li>A Client Secret (like a password)&lt;/li>
&lt;li>Or optionally, a certificate for authentication&lt;/li>
&lt;/ul>
&lt;p>This setup is much safer than using personal credentials in pipelines, and it allows fine-grained control using RBAC (Role Based Access Control) roles.&lt;/p>
&lt;h2 id="high-level-flow">High-level flow
&lt;/h2>&lt;div class="mermaid desktop center">flowchart LR
A["Azure DevOps Pipeline"] -- uses --> B["Azure DevOps Service Connection"]
B -- authenticates with --> C["App Registration"]
C -- access granted by RBAC --> D["Azure Subscription / Resources"]
A@{ shape: rounded}
B@{ shape: rounded}
C@{ shape: rounded}
D@{ shape: rounded}
style A fill:#457DDF,color:#f7f7f7,stroke-width:0px,stroke-dasharray:0
style B fill:#457DDF,color:#f7f7f7,stroke-width:0px,stroke-dasharray:0
style C fill:#457DDF,color:#f7f7f7,stroke-width:0px,stroke-dasharray:0
style D fill:#457DDF,color:#f7f7f7,stroke-width:0px,stroke-dasharray:0&lt;/div>
&lt;div class="mermaid mobile center">flowchart TB
A["Azure DevOps Pipeline"] -- uses --> B["Azure DevOps Service Connection"]
B -- authenticates with --> C["App Registration"]
C -- access granted by RBAC --> D["Azure Subscription / Resources"]
A@{ shape: rounded}
B@{ shape: rounded}
C@{ shape: rounded}
D@{ shape: rounded}
style A fill:#457DDF,color:#f7f7f7,stroke-width:0px,stroke-dasharray:0
style B fill:#457DDF,color:#f7f7f7,stroke-width:0px,stroke-dasharray:0
style C fill:#457DDF,color:#f7f7f7,stroke-width:0px,stroke-dasharray:0
style D fill:#457DDF,color:#f7f7f7,stroke-width:0px,stroke-dasharray:0&lt;/div>
&lt;hr>
&lt;h2 id="step-1-create-an-app-registration-in-azure">Step 1: Create an App Registration in Azure
&lt;/h2>&lt;ol>
&lt;li>
&lt;p>Navigate to the Azure Portal -&amp;gt; Search for Microsoft Entra ID&lt;/p>
&lt;/li>
&lt;li>
&lt;p>Select App Registrations from the left menu&lt;/p>
&lt;/li>
&lt;li>
&lt;p>Click New Registration&lt;/p>
&lt;ul>
&lt;li>Name: &lt;code>azure-devops-service-principal&lt;/code>&lt;/li>
&lt;li>Supported account types: &lt;em>Single tenant only&lt;/em> (default)&lt;/li>
&lt;li>Redirect URI: leave blank&lt;/li>
&lt;/ul>
&lt;/li>
&lt;li>
&lt;p>Click Register. You will now see:&lt;/p>
&lt;ul>
&lt;li>Application (client) ID&lt;/li>
&lt;li>Directory (tenant) ID&lt;/li>
&lt;/ul>
&lt;/li>
&lt;li>
&lt;p>Under Certificates &amp;amp; Secrets -&amp;gt; Client Secrets -&amp;gt; New Client Secret&lt;/p>
&lt;ul>
&lt;li>Give a description: &lt;code>secret-azure-devops-service-principal&lt;/code>&lt;/li>
&lt;li>Select an expiration and click Add&lt;/li>
&lt;li>Copy the secret value (you won’t see it again)&lt;/li>
&lt;/ul>
&lt;/li>
&lt;li>
&lt;p>Assign permissions:&lt;/p>
&lt;ul>
&lt;li>Navigate to your subscription -&amp;gt; Access control (IAM) -&amp;gt; Add -&amp;gt; Add role assignment&lt;/li>
&lt;li>For simplicity choose Privileged Administrator Roles -&amp;gt; Contributor for broad deployments at the subscription level&lt;/li>
&lt;li>Click on Select Members and choose your App Registration&lt;/li>
&lt;li>Click on Review + Assign&lt;/li>
&lt;/ul>
&lt;/li>
&lt;/ol>
&lt;p>Tip: Keep the App Registration’s permissions scoped only to what you need (e.g. resource group instead of full subscription) to follow least privilege best practices.&lt;/p>
&lt;hr>
&lt;h2 id="step-2-create-a-service-connection-in-azure-devops">Step 2: Create a Service Connection in Azure DevOps
&lt;/h2>&lt;ol>
&lt;li>Go to your Azure DevOps Project -&amp;gt; Project Settings -&amp;gt; Service connections&lt;/li>
&lt;li>Click New service connection -&amp;gt; Choose Azure Resource Manager
&lt;ul>
&lt;li>Identity type: App registration or managed identity (manual)&lt;/li>
&lt;li>Credential: Secret&lt;/li>
&lt;li>Environment: Azure Cloud&lt;/li>
&lt;li>Scope Level: Subscription&lt;/li>
&lt;li>Subscription ID: Your Azure Subscription ID&lt;/li>
&lt;li>Subscription name: Your Azure Subscription Name&lt;/li>
&lt;li>Application (client) ID: Your App Registration (client) ID (listed on the app registration)&lt;/li>
&lt;li>Directory (tenant) ID: Your Directory (tenant) ID (listed on the app registration)&lt;/li>
&lt;li>Credential: Service principal key&lt;/li>
&lt;li>Client secret: Your client secret copied earlier&lt;/li>
&lt;li>Service Connection Name: &lt;code>azure-devops-service-connection&lt;/code>&lt;/li>
&lt;/ul>
&lt;/li>
&lt;li>Verify and save&lt;/li>
&lt;/ol>
&lt;p>Now Azure DevOps can authenticate to Azure using this Service Connection.&lt;/p>
&lt;hr>
&lt;h2 id="step-3-test-the-service-connection-with-a-pipeline">Step 3: Test the Service Connection with a Pipeline
&lt;/h2>&lt;p>First we will ensure you have a Git repository initialized in your Azure DevOps project:&lt;/p>
&lt;ol>
&lt;li>
&lt;p>Go to your Azure DevOps Project -&amp;gt; Repos&lt;/p>
&lt;ul>
&lt;li>If you see an option to Initialize main branch -&amp;gt; Click Initialize&lt;/li>
&lt;/ul>
&lt;/li>
&lt;li>
&lt;p>Go to your Azure DevOps Project -&amp;gt; Pipelines&lt;/p>
&lt;ul>
&lt;li>Click New Pipeline&lt;/li>
&lt;li>Choose Azure Repos Git for source code&lt;/li>
&lt;li>Select the repository where you want to store the pipeline yaml file&lt;/li>
&lt;li>Click on Starter Pipeline&lt;/li>
&lt;li>Use the following yaml code to create the pipeline:&lt;/li>
&lt;/ul>
&lt;/li>
&lt;/ol>
&lt;div class="highlight">&lt;pre tabindex="0" style="color:#f8f8f2;background-color:#272822;-moz-tab-size:4;-o-tab-size:4;tab-size:4;">&lt;code class="language-yaml" data-lang="yaml">&lt;span style="display:flex;">&lt;span>&lt;span style="color:#f92672">trigger&lt;/span>: &lt;span style="color:#ae81ff">none&lt;/span>
&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span>
&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span>&lt;span style="color:#f92672">pool&lt;/span>:
&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span> &lt;span style="color:#f92672">vmImage&lt;/span>: &lt;span style="color:#e6db74">&amp;#39;ubuntu-latest&amp;#39;&lt;/span>
&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span>
&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span>&lt;span style="color:#f92672">steps&lt;/span>:
&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span>- &lt;span style="color:#f92672">task&lt;/span>: &lt;span style="color:#ae81ff">AzureCLI@2&lt;/span> &lt;span style="color:#75715e"># Azure CLI task to verify service connection by showing subscription info&lt;/span>
&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span> &lt;span style="color:#f92672">inputs&lt;/span>:
&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span> &lt;span style="color:#f92672">azureSubscription&lt;/span>: &lt;span style="color:#e6db74">&amp;#39;azure-devops-service-connection&amp;#39;&lt;/span>
&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span> &lt;span style="color:#f92672">scriptType&lt;/span>: &lt;span style="color:#e6db74">&amp;#39;bash&amp;#39;&lt;/span>
&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span> &lt;span style="color:#f92672">scriptLocation&lt;/span>: &lt;span style="color:#e6db74">&amp;#39;inlineScript&amp;#39;&lt;/span>
&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span> &lt;span style="color:#f92672">inlineScript&lt;/span>: |&lt;span style="color:#e6db74">
&lt;/span>&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span>&lt;span style="color:#e6db74"> echo &amp;#34;Checking Azure login...&amp;#34;
&lt;/span>&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span>&lt;span style="color:#e6db74"> az account show&lt;/span>
&lt;/span>&lt;/span>&lt;/code>&lt;/pre>&lt;/div>&lt;ul>
&lt;li>Click on Save and run&lt;/li>
&lt;li>Click on Approve if prompted for any approvals to service connections&lt;/li>
&lt;/ul>
&lt;p>Once the pipeline run is successful, the AzureCLI task will print subscription details on the pipeline logs.&lt;/p>
&lt;h2 id="wrap-up">Wrap-Up
&lt;/h2>&lt;p>You’ve just:&lt;/p>
&lt;ul>
&lt;li>Learned what an App Registration is&lt;/li>
&lt;li>Created one in Azure with RBAC permissions&lt;/li>
&lt;li>Configured a Service Connection in Azure DevOps&lt;/li>
&lt;li>Validated it with a pipeline&lt;/li>
&lt;/ul>
&lt;p>This setup is the foundation of every Azure deployment using Azure DevOps. Remember to scope your App Registration&amp;rsquo;s permissions to the minimum needed to ensure a secure, production-ready setup.&lt;/p>
&lt;p>In a subsequent post, we will use this connection to deploy a simple Bicep template into Azure.&lt;/p></description></item></channel></rss>