{"id":47157,"date":"2024-09-25T11:52:52","date_gmt":"2024-09-25T11:52:52","guid":{"rendered":"https:\/\/www.devopsschool.com\/blog\/?p=47157"},"modified":"2024-09-25T11:53:33","modified_gmt":"2024-09-25T11:53:33","slug":"azure-pipeline-to-deploy-into-aks","status":"publish","type":"post","link":"https:\/\/www.devopsschool.com\/blog\/azure-pipeline-to-deploy-into-aks\/","title":{"rendered":"Azure Pipeline to Deploy into AKS"},"content":{"rendered":"\n<script src=\"https:\/\/gist.github.com\/devops-school\/d08e9875b51fd14a824ec2861660f584.js\"><\/script>\n\n\n\n<p>The <code>azureSubscription<\/code> field in the Azure DevOps pipeline YAML refers to the name or ID of the Azure service connection that you set up in Azure DevOps to authenticate and authorize the pipeline to interact with your Azure resources (e.g., your AKS cluster).<\/p>\n\n\n\n<p>In Azure DevOps, this service connection represents the credentials (usually based on a Service Principal) that the pipeline will use to perform tasks such as deploying to AKS, accessing other Azure resources, etc.<\/p>\n\n\n\n<h3 class=\"wp-block-heading\">Steps to find or create the <code>azureSubscription<\/code> value:<\/h3>\n\n\n\n<ol class=\"wp-block-list\">\n<li><strong>Go to Azure DevOps<\/strong>:\n<ul class=\"wp-block-list\">\n<li>Navigate to your Azure DevOps project.<\/li>\n<\/ul>\n<\/li>\n\n\n\n<li><strong>Project Settings<\/strong>:\n<ul class=\"wp-block-list\">\n<li>In the lower-left corner, click on <strong>Project settings<\/strong>.<\/li>\n<\/ul>\n<\/li>\n\n\n\n<li><strong>Service connections<\/strong>:\n<ul class=\"wp-block-list\">\n<li>Under <strong>Pipelines<\/strong>, click on <strong>Service connections<\/strong>.<\/li>\n\n\n\n<li>You should see a list of service connections if any are already set up. These represent the available Azure subscriptions that your pipeline can use.<\/li>\n<\/ul>\n<\/li>\n\n\n\n<li><strong>Find the correct service connection<\/strong>:\n<ul class=\"wp-block-list\">\n<li>The <code>azureSubscription<\/code> value should match the <strong>name<\/strong> of the service connection listed here. For example, it might be something like <code>MyAzureServiceConnection<\/code>, or in your case, the name of the subscription you&#8217;re authorized to use.<\/li>\n<\/ul>\n<\/li>\n\n\n\n<li><strong>Create a new service connection<\/strong> (if necessary):\n<ul class=\"wp-block-list\">\n<li>If you don&#8217;t have a service connection set up, click <strong>New service connection<\/strong>.<\/li>\n\n\n\n<li>Choose <strong>Azure Resource Manager<\/strong> and follow the steps to create a new connection using either:\n<ul class=\"wp-block-list\">\n<li><strong>Service Principal (automatic)<\/strong> (recommended) \u2013 this will automatically set up a Service Principal and permissions for you.<\/li>\n\n\n\n<li><strong>Service Principal (manual)<\/strong> \u2013 this allows you to manually enter details such as Subscription ID, Service Principal ID, and Secret if you&#8217;ve set up credentials manually in Azure.<\/li>\n<\/ul>\n<\/li>\n\n\n\n<li>After setting it up, you can use the <strong>name<\/strong> of this service connection in your pipeline YAML.<\/li>\n<\/ul>\n<\/li>\n\n\n\n<li><strong>Use in the pipeline<\/strong>:<\/li>\n<\/ol>\n","protected":false},"excerpt":{"rendered":"<p>The azureSubscription field in the Azure DevOps pipeline YAML refers to the name or ID of the Azure service connection that you set up in Azure DevOps to authenticate and&#8230; <\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"","sticky":false,"template":"","format":"standard","meta":{"_joinchat":[],"footnotes":""},"categories":[2],"tags":[],"class_list":["post-47157","post","type-post","status-publish","format-standard","hentry","category-uncategorised"],"_links":{"self":[{"href":"https:\/\/www.devopsschool.com\/blog\/wp-json\/wp\/v2\/posts\/47157","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.devopsschool.com\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.devopsschool.com\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.devopsschool.com\/blog\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/www.devopsschool.com\/blog\/wp-json\/wp\/v2\/comments?post=47157"}],"version-history":[{"count":2,"href":"https:\/\/www.devopsschool.com\/blog\/wp-json\/wp\/v2\/posts\/47157\/revisions"}],"predecessor-version":[{"id":47159,"href":"https:\/\/www.devopsschool.com\/blog\/wp-json\/wp\/v2\/posts\/47157\/revisions\/47159"}],"wp:attachment":[{"href":"https:\/\/www.devopsschool.com\/blog\/wp-json\/wp\/v2\/media?parent=47157"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.devopsschool.com\/blog\/wp-json\/wp\/v2\/categories?post=47157"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.devopsschool.com\/blog\/wp-json\/wp\/v2\/tags?post=47157"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}