<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom" xmlns:dc="http://purl.org/dc/elements/1.1/">
  <channel>
    <title>DEV Community: Adi Iman Zuraidi</title>
    <description>The latest articles on DEV Community by Adi Iman Zuraidi (@adimixxdev).</description>
    <link>https://dev.to/adimixxdev</link>
    <image>
      <url>https://media2.dev.to/dynamic/image/width=90,height=90,fit=cover,gravity=auto,format=auto/https:%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Fuser%2Fprofile_image%2F2229455%2F1a076267-e464-4356-941f-a40f48111dea.jpg</url>
      <title>DEV Community: Adi Iman Zuraidi</title>
      <link>https://dev.to/adimixxdev</link>
    </image>
    <atom:link rel="self" type="application/rss+xml" href="https://dev.to/feed/adimixxdev"/>
    <language>en</language>
    <item>
      <title>Setting Up Azure DevOps Service Connection with Azure Managed Identity: A Step-by-Step Guide</title>
      <dc:creator>Adi Iman Zuraidi</dc:creator>
      <pubDate>Fri, 18 Oct 2024 09:48:47 +0000</pubDate>
      <link>https://dev.to/adimixxdev/setting-up-azure-devops-service-connection-with-azure-managed-identity-a-step-by-step-guide-gnd</link>
      <guid>https://dev.to/adimixxdev/setting-up-azure-devops-service-connection-with-azure-managed-identity-a-step-by-step-guide-gnd</guid>
      <description>&lt;p&gt;I was recently tasked with deploying applications to Azure resources and setting up a CI/CD pipeline in Azure DevOps. A crucial part of this process is creating a Service Connection, which allows Azure DevOps to interact with Azure resources securely.&lt;/p&gt;

&lt;p&gt;This tutorial will guide you through the process of setting up a Service Connection in Azure DevOps using Azure Managed Identity. This method enhances security by leveraging Azure's built-in authentication mechanisms, eliminating the need to store sensitive credentials.&lt;/p&gt;

&lt;p&gt;By following this guide, you'll learn how to:&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;Set up a Service Connection in Azure DevOps&lt;/li&gt;
&lt;li&gt;Configure Azure Managed Identity for use with your Service Connection&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;Let's begin with the step-by-step process to create your Service Connection and configure the necessary Azure resources.&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;Navigate to Project Settings and locate "Service Connections" under the Pipelines section. Click on "New Service Connection".&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;From the list of options, select "Azure Resource Manager". Then, choose "Workload Identity Federation (Manual)" as the authentication method.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2F3zxdqz4lr87q15m0gjma.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2F3zxdqz4lr87q15m0gjma.png" alt="Creating New Service Connection in Azure DevOps Project Settings" width="800" height="501"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Focuyzzz95lyyufiajocy.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Focuyzzz95lyyufiajocy.png" alt="Azure Resource Manager options" width="532" height="561"&gt;&lt;/a&gt;&lt;/p&gt;
&lt;/li&gt;
&lt;li&gt;&lt;p&gt;Provide a descriptive name for your Service Connection in the designated field.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;When proceeding to next step, you will see a form with several fields &lt;br&gt;
to complete : &lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Subscription ID&lt;/li&gt;
&lt;li&gt;Subscription Name&lt;/li&gt;
&lt;li&gt;Service Principal ID&lt;/li&gt;
&lt;li&gt;Tenant ID&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;&lt;a href="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fxm8x21cd626z9q9rkpur.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fxm8x21cd626z9q9rkpur.png" alt="Azure Resource Manager configurations" width="506" height="969"&gt;&lt;/a&gt;&lt;/p&gt;
&lt;/li&gt;
&lt;li&gt;&lt;p&gt;For the Subscription ID and Subscription Name, you can retrieve these details from the Resource Group information in the Azure Portal:&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;Navigate to your Resource Group in the Azure Portal&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;Look for the Subscription ID and Subscription Name in the Resource Group's overview section&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fjtzb0s11vzl1bovdzpez.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fjtzb0s11vzl1bovdzpez.png" alt="Azure Resource Group Resource ID &amp;amp; Name" width="800" height="242"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Setup Azure Managed Identity for Service Principal ID &amp;amp; Tenant ID&lt;/strong&gt;&lt;/p&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;In the Azure Portal, navigate to Managed Identity &amp;gt; Settings &amp;gt; Federated Credentials. Click on "Add Credential".&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fnx55n7ii2wl9rdelxesw.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fnx55n7ii2wl9rdelxesw.png" alt="Federated Credentials in Managed Identity" width="800" height="285"&gt;&lt;/a&gt;&lt;/p&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;In the "Add Federated Credential" page, locate the "Federated credential scenario" field and select the "Other" option.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2F7vzk85cmt70glle8emp4.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2F7vzk85cmt70glle8emp4.png" alt="Add Federated Credential page" width="800" height="535"&gt;&lt;/a&gt;&lt;/p&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;In the "Connect Your Account" section, populate the "Issuer URL" and "Subject Identifier" fields using the data provided in the Azure DevOps Service Connection Setup.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fmavk1n7c4apgt8kvqhhc.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fmavk1n7c4apgt8kvqhhc.png" alt="Service Principal Details" width="536" height="497"&gt;&lt;/a&gt;&lt;/p&gt;
&lt;/li&gt;
&lt;li&gt;&lt;p&gt;Assign a descriptive name to the Federated Credential, then click "Add" to create it.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;After the Federated Credential is successfully saved, return to Managed Identity &amp;gt; Settings &amp;gt; Properties&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;In the Properties section, locate and copy the following data from the Managed Identity to the corresponding fields in the Azure DevOps Service Connection settings:&lt;/p&gt;

&lt;div class="table-wrapper-paragraph"&gt;&lt;table&gt;
&lt;thead&gt;
&lt;tr&gt;
&lt;th&gt;&lt;strong&gt;Managed Identity Field&lt;/strong&gt;&lt;/th&gt;
&lt;th&gt;&lt;strong&gt;Azure DevOps Service Connection Field&lt;/strong&gt;&lt;/th&gt;
&lt;/tr&gt;
&lt;/thead&gt;
&lt;tbody&gt;
&lt;tr&gt;
&lt;td&gt;Client Id&lt;/td&gt;
&lt;td&gt;Service Principal Id&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Tenant Id&lt;/td&gt;
&lt;td&gt;Tenant Id&lt;/td&gt;
&lt;/tr&gt;
&lt;/tbody&gt;
&lt;/table&gt;&lt;/div&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;Click on "Verify and Save". Ensure that the Managed Identity has the appropriate Role Assignments for the Service Connection to function correctly.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fwul8ma2xzh0peuywzp8m.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fwul8ma2xzh0peuywzp8m.png" alt="Role Assignments in Managed Identity" width="800" height="223"&gt;&lt;/a&gt;&lt;/p&gt;
&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;Congratulations! You've now set up a Service Connection in Azure DevOps using Azure Managed Identity. Here's a quick recap:&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;You created a Service Connection in Azure DevOps&lt;/li&gt;
&lt;li&gt;You configured Azure Managed Identity for improved security&lt;/li&gt;
&lt;li&gt;Your Azure DevOps project is now linked to Azure resources without storing credentials&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;Remember to:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Keep your Service Connection settings up to date&lt;/li&gt;
&lt;li&gt;Ensure your Managed Identity has the right permissions in Azure&lt;/li&gt;
&lt;li&gt;Test your new Service Connection with a simple pipeline&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Happy Deploying!&lt;/p&gt;

</description>
    </item>
  </channel>
</rss>
