<?xml version="1.0" encoding="UTF-8"?><rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:wfw="http://wellformedweb.org/CommentAPI/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
	xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
	>

<channel>
	<title>Azure - TheCodeBuzz</title>
	<atom:link href="https://thecodebuzz.com/category/azure/feed/" rel="self" type="application/rss+xml" />
	<link>https://thecodebuzz.com</link>
	<description>Best Practices for Software Development</description>
	<lastBuildDate>Sun, 01 Nov 2026 19:16:17 +0000</lastBuildDate>
	<language>en-US</language>
	<sy:updatePeriod>
	hourly	</sy:updatePeriod>
	<sy:updateFrequency>
	1	</sy:updateFrequency>
	

<image>
	<url>https://thecodebuzz.com/wp-content/uploads/2022/11/cropped-android-chrome-512x512-1-1-51x51.jpg</url>
	<title>Azure - TheCodeBuzz</title>
	<link>https://thecodebuzz.com</link>
	<width>32</width>
	<height>32</height>
</image> 
	<item>
		<title>Azure &#8211; Get All Pull requests using ADO DevOps API</title>
		<link>https://thecodebuzz.com/azure-ado-api-get-all-pull-requests-using-ado-devops-api/</link>
					<comments>https://thecodebuzz.com/azure-ado-api-get-all-pull-requests-using-ado-devops-api/#respond</comments>
		
		<dc:creator><![CDATA[admin]]></dc:creator>
		<pubDate>Mon, 04 Jul 2022 00:54:00 +0000</pubDate>
				<category><![CDATA[Azure]]></category>
		<category><![CDATA[Azure HowTo]]></category>
		<category><![CDATA[azure devops api approve pull request]]></category>
		<category><![CDATA[azure devops api examples]]></category>
		<category><![CDATA[azure devops api get file from repo]]></category>
		<category><![CDATA[azure devops api list git branches]]></category>
		<category><![CDATA[azure devops export pull requests]]></category>
		<category><![CDATA[azure devops organization api]]></category>
		<category><![CDATA[azure devops show all pull requests]]></category>
		<category><![CDATA[postman azure devops rest api]]></category>
		<guid isPermaLink="false">https://www.thecodebuzz.com/?p=22783</guid>

					<description><![CDATA[<p>Azure &#8211; Get All Pull requests using ADO DevOps API Today in this article, we will see Azure &#8211; Get All Pull requests using ADO DevOps API feature in detail. It&#8217;s easy to call Azure DevOps API and get the pull request details. One can automate the process using the AZ command or CLI or [&#8230;]</p>
<p>The post <a href="https://thecodebuzz.com/azure-ado-api-get-all-pull-requests-using-ado-devops-api/">Azure – Get All Pull requests using ADO DevOps API</a> first appeared on <a href="https://thecodebuzz.com">TheCodeBuzz</a>.</p>]]></description>
										<content:encoded><![CDATA[<h1 class="wp-block-heading">Azure &#8211; Get All Pull requests using ADO DevOps API</h1>



<figure class="wp-block-image size-full is-resized"><a href="https://www.thecodebuzz.com/trigger-azure-pipelines-build-api-for-automating-azure-devops" target="_blank" rel="noopener"><img fetchpriority="high" decoding="async" src="https://www.thecodebuzz.com/wp-content/uploads/2022/03/how-to-queue-a-new-build-using-vsts-rest-api.jpg" alt="API for automating Azure DevOps Pipelines ,trigger-azure-pipelines-build-api-for-automating-azure-devops" class="wp-image-21348" width="722" height="371" srcset="https://thecodebuzz.com/wp-content/uploads/2022/03/how-to-queue-a-new-build-using-vsts-rest-api.jpg 906w, https://thecodebuzz.com/wp-content/uploads/2022/03/how-to-queue-a-new-build-using-vsts-rest-api-300x155.jpg 300w, https://thecodebuzz.com/wp-content/uploads/2022/03/how-to-queue-a-new-build-using-vsts-rest-api-768x396.jpg 768w, https://thecodebuzz.com/wp-content/uploads/2022/03/how-to-queue-a-new-build-using-vsts-rest-api-785x405.jpg 785w" sizes="(max-width: 722px) 100vw, 722px" /></a></figure>



<p class="wp-block-paragraph">Today in this article, we will see Azure &#8211; Get All Pull requests using ADO DevOps API feature in detail.</p>



<p class="wp-block-paragraph"></p>



<div class="wp-block-aioseo-table-of-contents"><ul><li><a href="#aioseo-trigger-an-ado-build--using-queue-api">Trigger an ADO build- using Queue API</a></li><li><a href="#aioseo-configuration-and-security">Configuration and security</a></li></ul></div>



<p class="wp-block-paragraph">It&#8217;s easy to call Azure DevOps API and get the pull request details. One can automate the process using the AZ command or CLI or PowerShell script.</p>



<p class="wp-block-paragraph"></p>



<p class="wp-block-paragraph"></p>



<p class="wp-block-paragraph">We will use the below API for the same.</p>



<p class="wp-block-paragraph"></p>



<h2 class="wp-block-heading" id="aioseo-trigger-an-ado-build--using-queue-api">Trigger an ADO build- using Queue API </h2>



<p class="wp-block-paragraph"></p>



<p class="wp-block-paragraph"><strong>GET API</strong></p>



<p class="wp-block-paragraph"></p>



<pre class="wp-block-preformatted has-medium-font-size">GET https://dev.azure.com/{organization}/{project}/_apis/git/repositories/{repo-name}/pullrequests?&amp;api-version=6.0</pre>



<p class="wp-block-paragraph"></p>



<p class="wp-block-paragraph"><strong>Build pipeline With optional parameters</strong></p>



<p class="wp-block-paragraph"></p>



<p class="wp-block-paragraph"><strong>GET API</strong></p>



<p class="wp-block-paragraph"></p>



<pre class="wp-block-preformatted has-medium-font-size">https://dev.azure.com/jan2022-thecodebuzz/globalexceptionhandler/_apis/git/repositories/globalexceptionhandler/pullrequests?&amp;api-version=6.0</pre>



<p class="wp-block-paragraph"></p>



<p class="wp-block-paragraph"></p>



<p class="wp-block-paragraph"></p>



<p class="wp-block-paragraph">In the above Post request below are the input parameters,</p>



<p class="wp-block-paragraph"></p>



<ul class="wp-block-list"><li><strong><em>organization </em> </strong>&#8211; The name of the Azure DevOps organization.</li></ul>



<ul class="wp-block-list"><li><em><strong>project</strong>  </em>&#8211; Project ID or project name</li></ul>



<ul class="wp-block-list"><li><strong><em>api version </em></strong>&#8211; Version of the API to use. </li></ul>



<p class="wp-block-paragraph"></p>



<p class="wp-block-paragraph"></p>



<p class="wp-block-paragraph">Below is our sample repository,</p>



<p class="wp-block-paragraph"></p>



<p class="has-medium-font-size wp-block-paragraph"><a href="https://dev.azure.com/jan2022-thecodebuzz/globalexceptionhandler/_build">https://dev.azure.com/jan2022-thecodebuzz/globalexceptionhandler/_build</a></p>



<p class="wp-block-paragraph"></p>



<figure class="wp-block-image size-large"><img decoding="async" width="1024" height="622" src="https://www.thecodebuzz.com/wp-content/uploads/2022/03/trigger-azure-pipelines-build-via-api-1024x622.jpg" alt="Azure - Get All Pull requests using ADO DevOps API " class="wp-image-21341" srcset="https://thecodebuzz.com/wp-content/uploads/2022/03/trigger-azure-pipelines-build-via-api-1024x622.jpg 1024w, https://thecodebuzz.com/wp-content/uploads/2022/03/trigger-azure-pipelines-build-via-api-300x182.jpg 300w, https://thecodebuzz.com/wp-content/uploads/2022/03/trigger-azure-pipelines-build-via-api-768x466.jpg 768w, https://thecodebuzz.com/wp-content/uploads/2022/03/trigger-azure-pipelines-build-via-api-1536x933.jpg 1536w, https://thecodebuzz.com/wp-content/uploads/2022/03/trigger-azure-pipelines-build-via-api-785x477.jpg 785w, https://thecodebuzz.com/wp-content/uploads/2022/03/trigger-azure-pipelines-build-via-api.jpg 1976w" sizes="(max-width: 1024px) 100vw, 1024px" /></figure>



<p class="wp-block-paragraph"></p>



<h2 class="wp-block-heading" id="aioseo-configuration-and-security">Configuration and security </h2>



<p class="wp-block-paragraph"></p>



<p class="wp-block-paragraph">Let&#8217;s now configure the API to be invoked securely.</p>



<p class="wp-block-paragraph"></p>



<p class="wp-block-paragraph">Step1- Click on the User settings and set up the <em><strong>personal access token</strong></em>.</p>



<p class="wp-block-paragraph"></p>



<figure class="wp-block-image size-large is-resized"><img decoding="async" src="https://www.thecodebuzz.com/wp-content/uploads/2022/03/UntitAPI-for-automating-Azure-DevOps-Pipelinesled-730x1024.jpg" alt="start-a-build-and-passing-variables-through-azure-devops-rest-api" class="wp-image-21342" width="313" height="439" srcset="https://thecodebuzz.com/wp-content/uploads/2022/03/UntitAPI-for-automating-Azure-DevOps-Pipelinesled-730x1024.jpg 730w, https://thecodebuzz.com/wp-content/uploads/2022/03/UntitAPI-for-automating-Azure-DevOps-Pipelinesled-214x300.jpg 214w, https://thecodebuzz.com/wp-content/uploads/2022/03/UntitAPI-for-automating-Azure-DevOps-Pipelinesled-371x520.jpg 371w, https://thecodebuzz.com/wp-content/uploads/2022/03/UntitAPI-for-automating-Azure-DevOps-Pipelinesled.jpg 765w" sizes="(max-width: 313px) 100vw, 313px" /></figure>



<p class="wp-block-paragraph">Define a name for this token and authorize the scope of access with this token. You can choose this token access for the Build pipeline trigger or release pipeline trigger etc.</p>



<p class="wp-block-paragraph"></p>



<p class="wp-block-paragraph">I have below sample 2 pull request </p>



<figure class="wp-block-image size-large"><img loading="lazy" decoding="async" width="1024" height="289" src="https://www.thecodebuzz.com/wp-content/uploads/2022/07/Azure-Get-All-Pull-requests-using-ADO-DevOps-API--1024x289.jpg" alt="" class="wp-image-22784" srcset="https://thecodebuzz.com/wp-content/uploads/2022/07/Azure-Get-All-Pull-requests-using-ADO-DevOps-API--1024x289.jpg 1024w, https://thecodebuzz.com/wp-content/uploads/2022/07/Azure-Get-All-Pull-requests-using-ADO-DevOps-API--300x85.jpg 300w, https://thecodebuzz.com/wp-content/uploads/2022/07/Azure-Get-All-Pull-requests-using-ADO-DevOps-API--768x216.jpg 768w, https://thecodebuzz.com/wp-content/uploads/2022/07/Azure-Get-All-Pull-requests-using-ADO-DevOps-API--785x221.jpg 785w, https://thecodebuzz.com/wp-content/uploads/2022/07/Azure-Get-All-Pull-requests-using-ADO-DevOps-API-.jpg 1462w" sizes="auto, (max-width: 1024px) 100vw, 1024px" /></figure>



<p class="wp-block-paragraph"></p>



<p class="wp-block-paragraph"></p>



<p class="wp-block-paragraph">Once you execute the GET API, all metadata associated with Pull request can be accessed easily ,</p>



<p class="wp-block-paragraph"></p>



<figure class="wp-block-image size-large"><img loading="lazy" decoding="async" width="1024" height="681" src="https://www.thecodebuzz.com/wp-content/uploads/2022/07/Azure-Get-All-Pull-requests-using-ADO-DevOps-powershell-1024x681.jpg" alt="" class="wp-image-22785" srcset="https://thecodebuzz.com/wp-content/uploads/2022/07/Azure-Get-All-Pull-requests-using-ADO-DevOps-powershell-1024x681.jpg 1024w, https://thecodebuzz.com/wp-content/uploads/2022/07/Azure-Get-All-Pull-requests-using-ADO-DevOps-powershell-300x200.jpg 300w, https://thecodebuzz.com/wp-content/uploads/2022/07/Azure-Get-All-Pull-requests-using-ADO-DevOps-powershell-768x511.jpg 768w, https://thecodebuzz.com/wp-content/uploads/2022/07/Azure-Get-All-Pull-requests-using-ADO-DevOps-powershell-782x520.jpg 782w, https://thecodebuzz.com/wp-content/uploads/2022/07/Azure-Get-All-Pull-requests-using-ADO-DevOps-powershell.jpg 1200w" sizes="auto, (max-width: 1024px) 100vw, 1024px" /></figure>



<p class="wp-block-paragraph"></p>



<p class="wp-block-paragraph"><strong>References</strong>: </p>



<p class="wp-block-paragraph"></p>



<ul class="has-medium-font-size wp-block-list"><li><a href="https://www.thecodebuzz.com/create-https-nginx-on-linux-azure-virtual-machine-ubuntu/" target="_blank" rel="noreferrer noopener" title="Create HTTP with NGINX on Linux in Azure Virtual Machine"><em>Create HTTP with NGINX on Linux in Azure Virtual Machine</em></a></li></ul>



<p class="wp-block-paragraph"></p>



<ul class="has-medium-font-size wp-block-list"><li><a style="font-size: revert;" href="https://www.thecodebuzz.com/azure-devops-build-pipelines-using-run-pipeline-api-automate/" title="Automating Azure DevOps Build Pipelines using Run Pipeline API"><em>Automating Azure DevOps Build Pipelines using Run Pipeline API</em></a> </li></ul>



<hr>



<p class="wp-block-paragraph"></p>



<p class="has-background" style="background-color:#b6d9ac;font-size:18px"><br>Please <strong><em>bookmark </em></strong>this page and <em><strong>share </strong></em>it with your friends.                                                    Please <a href="https://www.thecodebuzz.com/subscription/" target="_blank" rel="noreferrer noopener"><em><mark style="background-color:rgba(0, 0, 0, 0)" class="has-inline-color has-luminous-vivid-orange-color"><strong>Subscribe</strong> </mark></em></a>to the blog to receive notifications on freshly published (2026) best practices and guidelines for software design and development.</p>




<br>



<hr>



<p class="wp-block-paragraph"></p>



<p class="wp-block-paragraph"></p><p>The post <a href="https://thecodebuzz.com/azure-ado-api-get-all-pull-requests-using-ado-devops-api/">Azure – Get All Pull requests using ADO DevOps API</a> first appeared on <a href="https://thecodebuzz.com">TheCodeBuzz</a>.</p>]]></content:encoded>
					
					<wfw:commentRss>https://thecodebuzz.com/azure-ado-api-get-all-pull-requests-using-ado-devops-api/feed/</wfw:commentRss>
			<slash:comments>0</slash:comments>
		
		
			</item>
		<item>
		<title>API for automating Azure DevOps ADO Build Pipelines  &#8211; Part 1</title>
		<link>https://thecodebuzz.com/trigger-azure-pipelines-build-api-for-automating-azure-devops/</link>
					<comments>https://thecodebuzz.com/trigger-azure-pipelines-build-api-for-automating-azure-devops/#respond</comments>
		
		<dc:creator><![CDATA[admin]]></dc:creator>
		<pubDate>Tue, 22 Mar 2022 02:16:47 +0000</pubDate>
				<category><![CDATA[ADO]]></category>
		<category><![CDATA[Azure]]></category>
		<category><![CDATA[Cloud]]></category>
		<category><![CDATA[API automating Azure DevOps Build Pipelines]]></category>
		<category><![CDATA[azure devops api pipeline variables]]></category>
		<category><![CDATA[azure devops api run pipeline with parameters]]></category>
		<category><![CDATA[azure devops get all pipeline runs]]></category>
		<category><![CDATA[azure devops pipeline api]]></category>
		<category><![CDATA[azure devops pipeline call rest api]]></category>
		<category><![CDATA[azure devops pipeline run description]]></category>
		<category><![CDATA[build a ci/cd pipeline for azure api management]]></category>
		<category><![CDATA[create release pipeline in azure devops using rest api]]></category>
		<guid isPermaLink="false">https://www.thecodebuzz.com/?p=21338</guid>

					<description><![CDATA[<p>API for automating Azure DevOps ADO Build Pipelines &#8211; Guidelines Today in this article, we will see how to use API for automating Azure DevOps ADO Build Pipelines process. We will see an example of how to trigger Azure Pipelines build via API. We will look over all 2 approaches to achieve the same, Today [&#8230;]</p>
<p>The post <a href="https://thecodebuzz.com/trigger-azure-pipelines-build-api-for-automating-azure-devops/">API for automating Azure DevOps ADO Build Pipelines  – Part 1</a> first appeared on <a href="https://thecodebuzz.com">TheCodeBuzz</a>.</p>]]></description>
										<content:encoded><![CDATA[<h1 class="wp-block-heading">API for automating Azure DevOps ADO Build Pipelines &#8211; Guidelines</h1>



<figure class="wp-block-image size-full is-resized"><a href="https://www.thecodebuzz.com/trigger-azure-pipelines-build-api-for-automating-azure-devops" target="_blank" rel="noopener"><img loading="lazy" decoding="async" width="906" height="467" src="https://www.thecodebuzz.com/wp-content/uploads/2022/03/how-to-queue-a-new-build-using-vsts-rest-api.jpg" alt="API for automating Azure DevOps Pipelines ,trigger-azure-pipelines-build-api-for-automating-azure-devops" class="wp-image-21348" style="width:722px;height:371px" srcset="https://thecodebuzz.com/wp-content/uploads/2022/03/how-to-queue-a-new-build-using-vsts-rest-api.jpg 906w, https://thecodebuzz.com/wp-content/uploads/2022/03/how-to-queue-a-new-build-using-vsts-rest-api-300x155.jpg 300w, https://thecodebuzz.com/wp-content/uploads/2022/03/how-to-queue-a-new-build-using-vsts-rest-api-768x396.jpg 768w, https://thecodebuzz.com/wp-content/uploads/2022/03/how-to-queue-a-new-build-using-vsts-rest-api-785x405.jpg 785w" sizes="auto, (max-width: 906px) 100vw, 906px" /></a></figure>



<p class="wp-block-paragraph">Today in this article, we will see how to use API for automating Azure DevOps ADO Build Pipelines process.</p>



<p class="wp-block-paragraph"></p>



<p class="wp-block-paragraph">We will see an example of how to trigger Azure Pipelines build via API. </p>



<p class="wp-block-paragraph">We will look over all 2 approaches to achieve the same,</p>



<p class="wp-block-paragraph"></p>



<ul class="wp-block-list">
<li>Build -Queue API</li>
</ul>



<p class="wp-block-paragraph"></p>



<ul class="wp-block-list">
<li>Runs &#8211; <a href="https://www.thecodebuzz.com/azure-devops-build-pipelines-using-run-pipeline-api-automate/" target="_blank" rel="noreferrer noopener" title="Automating Azure DevOps Build Pipelines using Run Pipeline API">Run Pipeline</a> API</li>
</ul>



<p class="wp-block-paragraph"></p>



<p class="wp-block-paragraph">Today in this article, we will cover below aspects,</p>



<div class="wp-block-aioseo-table-of-contents"><ul><li><a href="#aioseo-trigger-an-ado-build--using-queue-api">Trigger an ADO build- using Queue API</a><ul><li><a href="#aioseo-post-api">Calling POST API</a></li></ul></li><li><a href="#aioseo-build-pipeline-with-optional-parameters">Build pipeline With optional parameters</a><ul><li><a href="#aioseo-calling-post-api">Calling POST API</a></li></ul></li><li><a href="#aioseo-input-parameters-explained">Input Parameters Explained</a></li><li><a href="#aioseo-configuration-and-security">Configuration and security</a></li></ul></div>



<p class="wp-block-paragraph">We will use the below API for the same.</p>



<p class="wp-block-paragraph"></p>



<h2 class="wp-block-heading" id="aioseo-trigger-an-ado-build--using-queue-api"><strong>Trigger an ADO build- using Queue API </strong></h2>



<p class="wp-block-paragraph"></p>



<h3 class="wp-block-heading" id="aioseo-post-api">Calling POST API</h3>



<p class="wp-block-paragraph"></p>



<pre class="wp-block-preformatted has-medium-font-size">POST https://dev.azure.com/{organization}/{project}/_apis/build/builds?api-version=7.1-preview.7</pre>



<p class="wp-block-paragraph"></p>



<h2 class="wp-block-heading" id="aioseo-build-pipeline-with-optional-parameters"><strong>Build pipeline With optional parameters</strong></h2>



<p class="wp-block-paragraph"></p>



<p class="wp-block-paragraph">We can build a pipeline With optional parameters as explained in below example,</p>



<p class="wp-block-paragraph"></p>



<h3 class="wp-block-heading" id="aioseo-calling-post-api">Calling POST API</h3>



<p class="wp-block-paragraph"></p>



<pre class="wp-block-preformatted has-medium-font-size">POST https://dev.azure.com/{organization}/{project}/_apis/build/builds?ignoreWarnings={ignoreWarnings}&amp;checkInTicket={checkInTicket}&amp;sourceBuildId={sourceBuildId}&amp;definitionId={definitionId}&amp;api-version=7.1-preview.7</pre>



<p class="wp-block-paragraph"></p>



<h2 class="wp-block-heading" id="aioseo-input-parameters-explained">Input Parameters Explained</h2>



<p class="wp-block-paragraph"></p>



<p class="wp-block-paragraph">In the above Post request below are the input parameters,</p>



<p class="wp-block-paragraph"></p>



<ul class="wp-block-list">
<li> <strong><em>organization </em> </strong>&#8211; The name of the Azure DevOps organization.</li>
</ul>



<ul class="wp-block-list">
<li><em><strong>project</strong>  </em>&#8211; Project ID or project name</li>
</ul>



<ul class="wp-block-list">
<li><strong><em>api version </em></strong>&#8211; Version of the API to use. </li>
</ul>



<p class="wp-block-paragraph"></p>



<p class="wp-block-paragraph"><strong>Request Body </strong></p>



<p class="wp-block-paragraph"></p>



<ul class="wp-block-list">
<li><strong><em>definition </em></strong>&#8211; The build number/name of the build.</li>
</ul>



<p class="wp-block-paragraph"></p>



<p class="wp-block-paragraph">Below is our sample repository,</p>



<p class="wp-block-paragraph"></p>



<p class="has-medium-font-size wp-block-paragraph"><a href="https://dev.azure.com/jan2022-thecodebuzz/globalexceptionhandler/_build">https://dev.azure.com/jan2022-thecodebuzz/globalexceptionhandler/_build</a></p>



<p class="wp-block-paragraph"></p>



<figure class="wp-block-image size-large"><img loading="lazy" decoding="async" width="1024" height="622" src="https://www.thecodebuzz.com/wp-content/uploads/2022/03/trigger-azure-pipelines-build-via-api-1024x622.jpg" alt="start-a-build-and-passing-variables-through-azure-devops-rest-api, API for automating Azure DevOps ADO Build " class="wp-image-21341" srcset="https://thecodebuzz.com/wp-content/uploads/2022/03/trigger-azure-pipelines-build-via-api-1024x622.jpg 1024w, https://thecodebuzz.com/wp-content/uploads/2022/03/trigger-azure-pipelines-build-via-api-300x182.jpg 300w, https://thecodebuzz.com/wp-content/uploads/2022/03/trigger-azure-pipelines-build-via-api-768x466.jpg 768w, https://thecodebuzz.com/wp-content/uploads/2022/03/trigger-azure-pipelines-build-via-api-1536x933.jpg 1536w, https://thecodebuzz.com/wp-content/uploads/2022/03/trigger-azure-pipelines-build-via-api-785x477.jpg 785w, https://thecodebuzz.com/wp-content/uploads/2022/03/trigger-azure-pipelines-build-via-api.jpg 1976w" sizes="auto, (max-width: 1024px) 100vw, 1024px" /></figure>



<p class="wp-block-paragraph"></p>



<h2 class="wp-block-heading" id="aioseo-configuration-and-security">Configuration and security </h2>



<p class="wp-block-paragraph"></p>



<p class="wp-block-paragraph">Let&#8217;s now configure the API to be invoked securely.</p>



<p class="wp-block-paragraph"></p>



<p class="wp-block-paragraph"><strong>Step 1-</strong> Click on the User settings and set up the <em><strong>personal access token</strong></em>.</p>



<p class="wp-block-paragraph"></p>



<figure class="wp-block-image size-large is-resized"><img loading="lazy" decoding="async" width="730" height="1024" src="https://www.thecodebuzz.com/wp-content/uploads/2022/03/UntitAPI-for-automating-Azure-DevOps-Pipelinesled-730x1024.jpg" alt="start-a-build-and-passing-variables-through-azure-devops-rest-api" class="wp-image-21342" style="width:313px;height:439px" srcset="https://thecodebuzz.com/wp-content/uploads/2022/03/UntitAPI-for-automating-Azure-DevOps-Pipelinesled-730x1024.jpg 730w, https://thecodebuzz.com/wp-content/uploads/2022/03/UntitAPI-for-automating-Azure-DevOps-Pipelinesled-214x300.jpg 214w, https://thecodebuzz.com/wp-content/uploads/2022/03/UntitAPI-for-automating-Azure-DevOps-Pipelinesled-371x520.jpg 371w, https://thecodebuzz.com/wp-content/uploads/2022/03/UntitAPI-for-automating-Azure-DevOps-Pipelinesled.jpg 765w" sizes="auto, (max-width: 730px) 100vw, 730px" /></figure>



<p class="wp-block-paragraph">Define a name for this token and authorize the scope of access with this token. You can choose this token access for the Build pipeline trigger or release pipeline trigger etc.</p>



<p class="wp-block-paragraph"></p>



<p class="wp-block-paragraph">Finally below is our URL and input request object defined,</p>



<p class="wp-block-paragraph"></p>



<p class="wp-block-paragraph"><strong>Define URL</strong></p>



<p class="wp-block-paragraph"></p>



<pre class="wp-block-preformatted has-medium-font-size">https://dev.azure.com/jan2022-thecodebuzz/globalexceptionhandler/_apis/build/builds?api-version=7.1-preview.7</pre>



<p class="wp-block-paragraph"></p>



<p class="wp-block-paragraph">Let&#8217;s now use <strong>Postman </strong>to execute the API. Please set up the Basic authentication in the Postman by setting up the Token name as UserName and Password as a personal access token.</p>



<p class="wp-block-paragraph"></p>



<p class="wp-block-paragraph">Below is my request body,</p>



<p class="wp-block-paragraph"></p>



<pre class="wp-block-syntaxhighlighter-code">{ 
        "definition": {
            "id": 5
        } 
}</pre>



<p class="wp-block-paragraph"></p>



<figure class="wp-block-image size-large is-resized"><a href="https://www.thecodebuzz.com/trigger-azure-pipelines-build-api-for-automating-azure-devops/" target="_blank" rel="noopener"><img loading="lazy" decoding="async" width="1024" height="581" src="https://www.thecodebuzz.com/wp-content/uploads/2022/03/trigger-azure-pipelines-build-via-api-devops-1024x581.jpg" alt="trigger-azure-pipelines-build-via-api" class="wp-image-21345" style="width:767px;height:435px" srcset="https://thecodebuzz.com/wp-content/uploads/2022/03/trigger-azure-pipelines-build-via-api-devops-1024x581.jpg 1024w, https://thecodebuzz.com/wp-content/uploads/2022/03/trigger-azure-pipelines-build-via-api-devops-300x170.jpg 300w, https://thecodebuzz.com/wp-content/uploads/2022/03/trigger-azure-pipelines-build-via-api-devops-768x436.jpg 768w, https://thecodebuzz.com/wp-content/uploads/2022/03/trigger-azure-pipelines-build-via-api-devops-785x445.jpg 785w, https://thecodebuzz.com/wp-content/uploads/2022/03/trigger-azure-pipelines-build-via-api-devops.jpg 1243w" sizes="auto, (max-width: 1024px) 100vw, 1024px" /></a></figure>



<p class="wp-block-paragraph"></p>



<p class="wp-block-paragraph">Once you execute the POST API, please check your pipeline. You shall see it is executed and triggered for a build successfully,</p>



<figure class="wp-block-image size-large"><img loading="lazy" decoding="async" width="1024" height="223" src="https://www.thecodebuzz.com/wp-content/uploads/2022/03/image-1024x223.png" alt="trigger-azure-pipelines-build-via-api" class="wp-image-21346" srcset="https://thecodebuzz.com/wp-content/uploads/2022/03/image-1024x223.png 1024w, https://thecodebuzz.com/wp-content/uploads/2022/03/image-300x65.png 300w, https://thecodebuzz.com/wp-content/uploads/2022/03/image-768x168.png 768w, https://thecodebuzz.com/wp-content/uploads/2022/03/image-1536x335.png 1536w, https://thecodebuzz.com/wp-content/uploads/2022/03/image-785x171.png 785w, https://thecodebuzz.com/wp-content/uploads/2022/03/image.png 1897w" sizes="auto, (max-width: 1024px) 100vw, 1024px" /></figure>



<p class="wp-block-paragraph"></p>



<p class="wp-block-paragraph"><strong>References</strong>: </p>



<p class="wp-block-paragraph"></p>



<ul class="wp-block-list">
<li><a href="https://www.thecodebuzz.com/azure-devops-build-pipelines-using-run-pipeline-api-automate/" title="Automating Azure DevOps Build Pipelines using Run Pipeline API"><em>Automating Azure DevOps Build Pipelines using Run Pipeline API</em></a></li>
</ul>



<ul class="wp-block-list">
<li><a href="https://www.thecodebuzz.com/create-https-nginx-on-linux-azure-virtual-machine-ubuntu/" target="_blank" rel="noreferrer noopener" title="Create HTTP with NGINX on Linux in Azure Virtual Machine"><em>Create HTTP with NGINX on Linux in Azure Virtual Machine</em></a></li>
</ul>



<p class="wp-block-paragraph"></p>



<p class="wp-block-paragraph" style="font-size:18px">Do you have any <strong>comments or ideas or any better </strong>suggestions to share?</p>



<p class="has-small-font-size wp-block-paragraph"></p>



<p class="wp-block-paragraph" style="font-size:18px">Please sound off your comments below.</p>



<p class="has-medium-font-size wp-block-paragraph"></p>



<p class="has-medium-font-size wp-block-paragraph"><strong>Happy Coding </strong>!!</p>



<p class="wp-block-paragraph"></p>



<hr>



<p class="wp-block-paragraph"></p>



<p class="has-background" style="background-color:#b6d9ac;font-size:18px"><br>Please <strong><em>bookmark </em></strong>this page and <em><strong>share </strong></em>it with your friends.                                                    Please <a href="https://www.thecodebuzz.com/subscription/" target="_blank" rel="noreferrer noopener"><em><mark style="background-color:rgba(0, 0, 0, 0)" class="has-inline-color has-luminous-vivid-orange-color"><strong>Subscribe</strong> </mark></em></a>to the blog to receive notifications on freshly published (2026) best practices and guidelines for software design and development.</p>




<br>



<hr>



<p class="wp-block-paragraph"></p>



<p class="wp-block-paragraph"></p><p>The post <a href="https://thecodebuzz.com/trigger-azure-pipelines-build-api-for-automating-azure-devops/">API for automating Azure DevOps ADO Build Pipelines  – Part 1</a> first appeared on <a href="https://thecodebuzz.com">TheCodeBuzz</a>.</p>]]></content:encoded>
					
					<wfw:commentRss>https://thecodebuzz.com/trigger-azure-pipelines-build-api-for-automating-azure-devops/feed/</wfw:commentRss>
			<slash:comments>0</slash:comments>
		
		
			</item>
		<item>
		<title>Automating Azure DevOps Build Pipelines using Run Pipeline API</title>
		<link>https://thecodebuzz.com/azure-devops-build-pipelines-using-run-pipeline-api-automate/</link>
					<comments>https://thecodebuzz.com/azure-devops-build-pipelines-using-run-pipeline-api-automate/#comments</comments>
		
		<dc:creator><![CDATA[admin]]></dc:creator>
		<pubDate>Sun, 20 Mar 2022 00:30:00 +0000</pubDate>
				<category><![CDATA[ADO]]></category>
		<category><![CDATA[Azure]]></category>
		<category><![CDATA[CICD]]></category>
		<category><![CDATA[Cloud]]></category>
		<category><![CDATA[automating build pipeline creation using azure devops services rest api]]></category>
		<category><![CDATA[azure devops]]></category>
		<category><![CDATA[azure devops get all pipeline runs]]></category>
		<category><![CDATA[azure devops rest api - run pipeline example]]></category>
		<category><![CDATA[azure devops rest api - run pipeline with variables]]></category>
		<category><![CDATA[Azure Pipelines]]></category>
		<category><![CDATA[create release pipeline in azure devops using rest api]]></category>
		<category><![CDATA[REST API]]></category>
		<category><![CDATA[trigger azure devops pipeline rest api]]></category>
		<guid isPermaLink="false">https://www.thecodebuzz.com/?p=21387</guid>

					<description><![CDATA[<p>Automating Azure DevOps Build Pipelines using API &#8211; Guidelines Today in this article, we will see how to use API for Automating Azure DevOps Build Pipelines using Run Pipeline API. Updated October 2026: a section on branch, parameters and variables, a section on authentication and checking results, an FAQ, and corrected api-version and PAT details. [&#8230;]</p>
<p>The post <a href="https://thecodebuzz.com/azure-devops-build-pipelines-using-run-pipeline-api-automate/">Automating Azure DevOps Build Pipelines using Run Pipeline API</a> first appeared on <a href="https://thecodebuzz.com">TheCodeBuzz</a>.</p>]]></description>
										<content:encoded><![CDATA[<h1 class="wp-block-heading">Automating Azure DevOps Build Pipelines using API &#8211; Guidelines</h1>



<figure class="wp-block-image size-full is-resized"><img loading="lazy" decoding="async" src="https://www.thecodebuzz.com/wp-content/uploads/2022/03/how-to-queue-a-new-build-using-vsts-rest-api.jpg" alt="Automating Azure DevOps Build Pipelines using Run Pipeline API" class="wp-image-21348" width="722" height="371" srcset="https://thecodebuzz.com/wp-content/uploads/2022/03/how-to-queue-a-new-build-using-vsts-rest-api.jpg 906w, https://thecodebuzz.com/wp-content/uploads/2022/03/how-to-queue-a-new-build-using-vsts-rest-api-300x155.jpg 300w, https://thecodebuzz.com/wp-content/uploads/2022/03/how-to-queue-a-new-build-using-vsts-rest-api-768x396.jpg 768w, https://thecodebuzz.com/wp-content/uploads/2022/03/how-to-queue-a-new-build-using-vsts-rest-api-785x405.jpg 785w" sizes="auto, (max-width: 722px) 100vw, 722px" /></figure>



<p class="wp-block-paragraph">Today in this article, we will see how to use API for Automating Azure DevOps Build Pipelines using Run Pipeline API.</p>



<p class="tcb-update-note"><em>Updated October 2026: a section on branch, parameters and variables, a section on authentication and checking results, an FAQ, and corrected api-version and PAT details.</em></p>




<p class="wp-block-paragraph">We will see an example of how to trigger Azure Pipelines build via API. AS we learned in the last article we have below two approaches to call REST API for Build pipeline,</p>



<p class="wp-block-paragraph"></p>



<ul class="wp-block-list"><li>Build -Queue API</li><li>Runs – Run Pipeline API</li></ul>



<p class="wp-block-paragraph"></p>



<p class="wp-block-paragraph">We already looked at the <a href="https://www.thecodebuzz.com/trigger-azure-pipelines-build-api-automating-azure-devops/" target="_blank" rel="noreferrer noopener" title="API for automating Azure DevOps Build Pipelines – Part 1">Build queue</a> approach in the previous article. </p>



<p class="wp-block-paragraph">Today in this article, we will cover below aspects,</p>



<div class="wp-block-aioseo-table-of-contents"><ul><li><a href="#aioseo-trigger-a-build-using---run-pipeline">Trigger a build using &#8211; Run Pipeline</a></li><li><a href="#aioseo-configuration-and-security">Configuration and security</a></li></ul></div>



<p class="wp-block-paragraph">For more details please see below article,</p>



<p class="wp-block-paragraph"></p>



<ul class="wp-block-list"><li><a href="https://www.thecodebuzz.com/trigger-azure-pipelines-build-api-automating-azure-devops/" title="API for automating Azure DevOps Build Pipelines – Part 1" target="_blank" rel="noreferrer noopener"><em><strong>API for automating Azure DevOps Build Pipelines – Part 1</strong></em></a></li></ul>



<p class="wp-block-paragraph"></p>



<p class="wp-block-paragraph">Both approaches have similar settings/configuration steps and hence they are easy to configure.</p>



<p class="wp-block-paragraph"></p>



<h2 class="wp-block-heading" id="aioseo-trigger-a-build-using---run-pipeline">Trigger a build using &#8211; Run Pipeline</h2>



<p class="wp-block-paragraph"></p>



<p class="wp-block-paragraph"> <strong>Build pipeline</strong> </p>



<p class="wp-block-paragraph"></p>



<pre class="wp-block-preformatted has-medium-font-size">POST https://dev.azure.com/{organization}/{project}/_apis/pipelines/{pipelineId}/runs?api-version=6.0-preview.1</pre>



<p class="wp-block-paragraph"></p>



<p class="wp-block-paragraph"><strong>Build pipeline With optional parameters</strong></p>



<p class="wp-block-paragraph"></p>



<p class="wp-block-paragraph"><strong>POST API</strong></p>



<p class="wp-block-paragraph"></p>



<pre class="wp-block-preformatted has-medium-font-size">POST POST https://dev.azure.com/{organization}/{project}/_apis/pipelines/{pipelineId}/runs?pipelineVersion={pipelineVersion}&amp;api-version=6.0-preview.1</pre>



<p class="wp-block-paragraph"></p>



<p class="wp-block-paragraph"><strong>Input Parameters</strong></p>



<p class="wp-block-paragraph"></p>



<p class="wp-block-paragraph">In the above Post request below are the input parameters,</p>



<p class="wp-block-paragraph"></p>



<ul class="wp-block-list"><li><strong><em>organization </em> </strong>&#8211; The name of the Azure DevOps organization.</li></ul>



<ul class="wp-block-list"><li><em><strong>project</strong>  </em>&#8211; Project ID or project name</li></ul>



<ul class="wp-block-list"><li><strong><em>api version </em></strong>&#8211; Version of the API to use. </li></ul>



<p class="wp-block-paragraph"></p>



<p class="wp-block-paragraph"><strong>Request Body </strong></p>



<p class="wp-block-paragraph"></p>



<ul class="wp-block-list"><li><strong><em>definition </em></strong>&#8211; The build number/name of the build.</li></ul>



<p class="wp-block-paragraph"></p>



<p class="wp-block-paragraph">Below is our sample repository,</p>



<p class="wp-block-paragraph"></p>



<p class="has-medium-font-size wp-block-paragraph"><a href="https://dev.azure.com/jan2022-thecodebuzz/globalexceptionhandler/_build">https://dev.azure.com/jan2022-thecodebuzz/globalexceptionhandler/_build</a></p>



<p class="wp-block-paragraph"></p>



<figure class="wp-block-image size-large is-resized"><img loading="lazy" decoding="async" src="https://www.thecodebuzz.com/wp-content/uploads/2022/03/trigger-azure-pipelines-build-via-api-1024x622.jpg" alt="start-a-build-and-passing-variables-through-azure-devops-rest-api" class="wp-image-21341" width="598" height="363" srcset="https://thecodebuzz.com/wp-content/uploads/2022/03/trigger-azure-pipelines-build-via-api-1024x622.jpg 1024w, https://thecodebuzz.com/wp-content/uploads/2022/03/trigger-azure-pipelines-build-via-api-300x182.jpg 300w, https://thecodebuzz.com/wp-content/uploads/2022/03/trigger-azure-pipelines-build-via-api-768x466.jpg 768w, https://thecodebuzz.com/wp-content/uploads/2022/03/trigger-azure-pipelines-build-via-api-1536x933.jpg 1536w, https://thecodebuzz.com/wp-content/uploads/2022/03/trigger-azure-pipelines-build-via-api-785x477.jpg 785w, https://thecodebuzz.com/wp-content/uploads/2022/03/trigger-azure-pipelines-build-via-api.jpg 1976w" sizes="auto, (max-width: 598px) 100vw, 598px" /></figure>



<p class="wp-block-paragraph"></p>



<h2 class="wp-block-heading" id="aioseo-configuration-and-security">Configuration and security </h2>



<p class="wp-block-paragraph"></p>



<p class="wp-block-paragraph">Let&#8217;s now configure the API to be invoked securely.</p>



<p class="wp-block-paragraph"></p>



<p class="wp-block-paragraph">Step1- Click on the User settings and set up the personal access token.</p>



<p class="wp-block-paragraph"></p>



<figure class="wp-block-image size-large is-resized"><img loading="lazy" decoding="async" src="https://www.thecodebuzz.com/wp-content/uploads/2022/03/UntitAPI-for-automating-Azure-DevOps-Pipelinesled-730x1024.jpg" alt="start-a-build-and-passing-variables-through-azure-devops-rest-api" class="wp-image-21342" width="313" height="439" srcset="https://thecodebuzz.com/wp-content/uploads/2022/03/UntitAPI-for-automating-Azure-DevOps-Pipelinesled-730x1024.jpg 730w, https://thecodebuzz.com/wp-content/uploads/2022/03/UntitAPI-for-automating-Azure-DevOps-Pipelinesled-214x300.jpg 214w, https://thecodebuzz.com/wp-content/uploads/2022/03/UntitAPI-for-automating-Azure-DevOps-Pipelinesled-371x520.jpg 371w, https://thecodebuzz.com/wp-content/uploads/2022/03/UntitAPI-for-automating-Azure-DevOps-Pipelinesled.jpg 765w" sizes="auto, (max-width: 313px) 100vw, 313px" /></figure>



<p class="wp-block-paragraph">Define a name for this token and authorize the scope of access with this token. For this API, choose the Build (Read &amp; execute) scope and nothing broader. Keep the expiry short.</p>



<p class="wp-block-paragraph"></p>



<p class="wp-block-paragraph">Finally below is our URL and input request object defined,</p>



<p class="wp-block-paragraph"></p>



<p class="wp-block-paragraph"><strong>URL</strong></p>



<pre class="wp-block-preformatted has-medium-font-size">https://dev.azure.com/jan2022-thecodebuzz/globalexceptionhandler/_apis/pipelines/5/runs?api-version=6.0-preview.1</pre>



<p class="wp-block-paragraph"></p>



<p class="wp-block-paragraph">Let&#8217;s now use <strong>Postman </strong>to execute the API. Please set up the Basic authentication in the Postman by leaving the username empty (or any value) and setting the password to the personal access token.</p>



<p class="wp-block-paragraph"></p>



<p class="wp-block-paragraph"><strong>Request Object for Build Pipeline API</strong></p>



<p class="wp-block-paragraph"></p>



<p class="wp-block-paragraph">Below is my request body,</p>



<p class="wp-block-paragraph"></p>


<div class="wp-block-syntaxhighlighter-code "><pre class="brush: csharp; title: ; notranslate">
{
    &quot;resources&quot;: {
        &quot;repositories&quot;: {
            &quot;self&quot;: {
                &quot;refName&quot;: &quot;refs/heads/master&quot;
            }
        }
    }
}
</pre></div>


<p class="wp-block-paragraph"></p>



<p class="wp-block-paragraph"><strong>Response from Build Pipeline API </strong></p>



<p class="wp-block-paragraph"></p>



<p class="wp-block-paragraph">Below is a sample response,</p>



<p class="wp-block-paragraph"></p>



<figure class="wp-block-image size-large"><img loading="lazy" decoding="async" width="1024" height="519" src="https://www.thecodebuzz.com/wp-content/uploads/2022/03/trigger-a-build-using-Run-Pipeline-azure-devops-1024x519.jpg" alt="Automating Azure DevOps Build Pipelines using Run Pipeline API" class="wp-image-21390" srcset="https://thecodebuzz.com/wp-content/uploads/2022/03/trigger-a-build-using-Run-Pipeline-azure-devops-1024x519.jpg 1024w, https://thecodebuzz.com/wp-content/uploads/2022/03/trigger-a-build-using-Run-Pipeline-azure-devops-300x152.jpg 300w, https://thecodebuzz.com/wp-content/uploads/2022/03/trigger-a-build-using-Run-Pipeline-azure-devops-768x389.jpg 768w, https://thecodebuzz.com/wp-content/uploads/2022/03/trigger-a-build-using-Run-Pipeline-azure-devops-1536x778.jpg 1536w, https://thecodebuzz.com/wp-content/uploads/2022/03/trigger-a-build-using-Run-Pipeline-azure-devops-2048x1037.jpg 2048w, https://thecodebuzz.com/wp-content/uploads/2022/03/trigger-a-build-using-Run-Pipeline-azure-devops-785x398.jpg 785w" sizes="auto, (max-width: 1024px) 100vw, 1024px" /></figure>



<p class="wp-block-paragraph"></p>



<p class="wp-block-paragraph">Once you execute the POST API, please check your pipeline. You shall see it is executed and triggered for a build successfully,</p>



<figure class="wp-block-image size-large"><img loading="lazy" decoding="async" width="1024" height="223" src="https://www.thecodebuzz.com/wp-content/uploads/2022/03/image-1024x223.png" alt="trigger-azure-pipelines-build-via-api" class="wp-image-21346" srcset="https://thecodebuzz.com/wp-content/uploads/2022/03/image-1024x223.png 1024w, https://thecodebuzz.com/wp-content/uploads/2022/03/image-300x65.png 300w, https://thecodebuzz.com/wp-content/uploads/2022/03/image-768x168.png 768w, https://thecodebuzz.com/wp-content/uploads/2022/03/image-1536x335.png 1536w, https://thecodebuzz.com/wp-content/uploads/2022/03/image-785x171.png 785w, https://thecodebuzz.com/wp-content/uploads/2022/03/image.png 1897w" sizes="auto, (max-width: 1024px) 100vw, 1024px" /></figure>



<p class="wp-block-paragraph"><strong>References</strong>: </p>



<p class="wp-block-paragraph"></p>



<ul class="has-medium-font-size wp-block-list"><li><a href="https://www.thecodebuzz.com/trigger-azure-pipelines-build-api-for-automating-azure-devops/" title="API for automating Azure DevOps Build Pipelines – Part 1" target="_blank" rel="noreferrer noopener"><em>API for automating Azure DevOps Build Pipelines – Part 1</em></a></li></ul>



<ul class="has-medium-font-size wp-block-list"><li><a href="https://www.thecodebuzz.com/create-https-nginx-on-linux-azure-virtual-machine-ubuntu/" target="_blank" rel="noreferrer noopener"><em>Create HTTP with NGINX on Linux in Azure Virtual Machine</em></a></li></ul>



<p class="wp-block-paragraph"></p>



<p class="wp-block-paragraph"></p>



<p class="wp-block-paragraph" style="font-size:18px">Do you have any <strong>comments or ideas or any better </strong>suggestions to share?</p>



<p class="has-small-font-size wp-block-paragraph"></p>



<p class="wp-block-paragraph" style="font-size:18px">Please sound off your comments below.</p>



<p class="has-medium-font-size wp-block-paragraph"></p>



<p class="has-medium-font-size wp-block-paragraph"><strong>Happy Coding </strong>!!</p>



<p class="wp-block-paragraph"></p>



<h2>Authenticate without a PAT and check whether the run passed</h2>

<p>A personal access token (PAT) with the <strong>Build (Read &amp; execute)</strong> scope is the minimum you need to call the Run Pipeline endpoint. You can avoid PATs entirely with Microsoft Entra tokens, or with <code>System.AccessToken</code> when the call comes from inside a pipeline.</p>

<h3>How do you use a PAT safely?</h3>

<p>Send it as Basic auth with an <strong>empty username</strong> and the PAT as the password. In curl, that means a Base64-encoded <code>:PAT</code> string in the Authorization header. Set a short expiry and <a href="https://thecodebuzz.com/secure-secrets-azure-key-vault-examples-csharp-java-python-nodejs/">keep the token in a secret store</a> or secret variable, never in the script.</p>

<h3>Which options avoid PATs?</h3>

<p>Pick the identity that matches where the call runs:</p>
<ul>
<li><strong>Service principal or managed identity:</strong> request a Microsoft Entra access token and send it as a Bearer token. Microsoft&#8217;s current samples use this approach.</li>
<li><strong>System.AccessToken:</strong> inside a pipeline, use the job&#8217;s built-in token. The build identity needs the <strong>Queue Build</strong> permission on the target pipeline, or the call is rejected.</li>
<li><strong>az rest:</strong> the Azure CLI attaches the credentials for you, so you don&#8217;t build headers by hand.</li>
<li><strong>InvokeRestAPI@1:</strong> this task now supports Azure DevOps service connections natively, so you no longer need a generic connection.</li>
</ul>

<blockquote class="tcb-plain-english" style="border-left:4px solid #f59e0b;background:#fffbeb;margin:18px 0;padding:10px 16px;font-style:normal"><p><strong>In plain English:</strong> A service principal is a staff badge issued to a program instead of a person. It can be revoked or limited without touching anyone&#8217;s personal login, which a PAT tied to your account can&#8217;t offer.</p></blockquote>

<h3>How do you check whether the run passed?</h3>

<p>The POST only starts the run. To learn the outcome, poll <code>GET pipelines/{id}/runs/{runId}</code> until <code>state</code> is <code>completed</code>, then read the <code>result</code> field.</p>

<ol>
<li><strong>Set a timeout:</strong> stop polling after a fixed time so a stuck run can&#8217;t hang your script.</li>
<li><strong>Wait between calls:</strong> a delay of several seconds is plenty for most pipelines.</li>
<li><strong>Honor throttling:</strong> on HTTP 429, wait for the number of seconds in the <code>Retry-After</code> header before the next request.</li>
<li><strong>Fail on the result:</strong> treat anything other than a successful <code>result</code> as a failure in your automation.</li>
</ol>

<h3>Runs API or Build Queue API: which should you call?</h3>

<p>Use the Runs API for YAML pipelines, and the Build Queue API if you already work with definition IDs. This table compares the two.</p>

<figure class="wp-block-table"><table>
<thead>
<tr><th>Aspect</th><th>Pipelines Runs API</th><th>Build Queue API</th></tr>
</thead>
<tbody>
<tr><td><strong>Endpoint</strong></td><td><code>pipelines/{id}/runs</code></td><td><code>build/builds</code></td></tr>
<tr><td><strong>Targets</strong></td><td>YAML pipelines</td><td>A build definition</td></tr>
<tr><td><strong>Identifier</strong></td><td>Pipeline ID in the URL</td><td>Definition ID in the body</td></tr>
<tr><td><strong>Inputs</strong></td><td><code>templateParameters</code>, <code>variables</code>, <code>resources</code></td><td>A <code>parameters</code> string</td></tr>
</tbody>
</table></figure><p>The post <a href="https://thecodebuzz.com/azure-devops-build-pipelines-using-run-pipeline-api-automate/">Automating Azure DevOps Build Pipelines using Run Pipeline API</a> first appeared on <a href="https://thecodebuzz.com">TheCodeBuzz</a>.</p>]]></content:encoded>
					
					<wfw:commentRss>https://thecodebuzz.com/azure-devops-build-pipelines-using-run-pipeline-api-automate/feed/</wfw:commentRss>
			<slash:comments>1</slash:comments>
		
		
			</item>
		<item>
		<title>Azure CLI &#8211; Push a container to Azure Private Registry</title>
		<link>https://thecodebuzz.com/azure-cli-push-a-docker-container-to-azure-private-registry/</link>
					<comments>https://thecodebuzz.com/azure-cli-push-a-docker-container-to-azure-private-registry/#respond</comments>
		
		<dc:creator><![CDATA[admin]]></dc:creator>
		<pubDate>Sun, 13 Feb 2022 17:41:00 +0000</pubDate>
				<category><![CDATA[Azure]]></category>
		<category><![CDATA[Azure HowTo]]></category>
		<category><![CDATA[Container]]></category>
		<category><![CDATA[Azure CLI]]></category>
		<category><![CDATA[Azure CLI - Push a container to Azure Private Registryazure container registry]]></category>
		<category><![CDATA[Azure Container Registry]]></category>
		<category><![CDATA[azure container registry url az acr push]]></category>
		<category><![CDATA[Docker]]></category>
		<category><![CDATA[docker login azure container registry]]></category>
		<category><![CDATA[docker push to azure container registry]]></category>
		<category><![CDATA[kubernetes pull image from azure container registry]]></category>
		<category><![CDATA[push docker image to azure container registry from jenkins]]></category>
		<guid isPermaLink="false">https://www.thecodebuzz.com/?p=21609</guid>

					<description><![CDATA[<p>Azure CLI &#8211; Push a container to Azure Private Registry Today in this article, we will cover how to push a container to Azure private registry using Azure CLI. Updated November 2026: a Cloud Shell/&#8211;expose-token login section, a 401 troubleshooting and CI/CD auth section, and an FAQ. The Azure Container Registry (ACR) is a private [&#8230;]</p>
<p>The post <a href="https://thecodebuzz.com/azure-cli-push-a-docker-container-to-azure-private-registry/">Azure CLI – Push a container to Azure Private Registry</a> first appeared on <a href="https://thecodebuzz.com">TheCodeBuzz</a>.</p>]]></description>
										<content:encoded><![CDATA[<h1 class="wp-block-heading">Azure CLI &#8211; Push a container to Azure Private Registry</h1>



<figure class="wp-block-image size-large is-resized"><img loading="lazy" decoding="async" src="https://www.thecodebuzz.com/wp-content/uploads/2022/04/Azure-clie-for-Docker-comamnds-1024x478.jpg" alt="Push a container to Azure private registry" class="wp-image-21652" width="629" height="294" srcset="https://thecodebuzz.com/wp-content/uploads/2022/04/Azure-clie-for-Docker-comamnds-1024x478.jpg 1024w, https://thecodebuzz.com/wp-content/uploads/2022/04/Azure-clie-for-Docker-comamnds-300x140.jpg 300w, https://thecodebuzz.com/wp-content/uploads/2022/04/Azure-clie-for-Docker-comamnds-768x359.jpg 768w, https://thecodebuzz.com/wp-content/uploads/2022/04/Azure-clie-for-Docker-comamnds-1536x718.jpg 1536w, https://thecodebuzz.com/wp-content/uploads/2022/04/Azure-clie-for-Docker-comamnds-2048x957.jpg 2048w, https://thecodebuzz.com/wp-content/uploads/2022/04/Azure-clie-for-Docker-comamnds-785x367.jpg 785w" sizes="auto, (max-width: 629px) 100vw, 629px" /></figure>



<p class="wp-block-paragraph">Today in this article, we will cover how to push a container to Azure private registry using <em><strong>Azure CLI</strong></em>.</p>



<p class="tcb-update-note"><em>Updated November 2026: a Cloud Shell/&#8211;expose-token login section, a 401 troubleshooting and CI/CD auth section, and an FAQ.</em></p>




<p class="wp-block-paragraph"></p>



<p class="wp-block-paragraph">The <strong><em>Azure Container Registry</em></strong> (ACR) is a private registry that allows you to create, store, and manage container images and related artifacts. The <strong><em>Azure CLI</em></strong> lets you create an Azure container registry instance then, using Docker&#8217;s existing widely used commands we can tag and push, pull or run the container image to/from your Azure registry.</p>



<p class="wp-block-paragraph"></p>



<p class="wp-block-paragraph">In today&#8217;s article, we will cover the below aspects,</p>



<p class="wp-block-paragraph"></p>



<ul class="wp-block-list"><li>Create an Azure cloud resource group</li><li>Create an Azure Container Registry</li><li>Log in to the ACR(Azure Container Registry)</li><li>Use Docker command to Push Image to registry</li><li>Run Image from ACR instance</li></ul>



<p class="wp-block-paragraph"></p>



<h2 class="wp-block-heading">Prerequisites:</h2>



<p class="wp-block-paragraph"></p>



<p class="wp-block-paragraph">Before getting started, please make sure to install the below prerequisites on your local machine.</p>



<p class="wp-block-paragraph"></p>



<ul class="wp-block-list"><li>Install Docker &#8211; Please see <a href="https://docs.docker.com/get-docker/" target="_blank" rel="noreferrer noopener">here</a> for instruction </li><li>Install Azure CLI  &#8211; Please see <a href="https://docs.microsoft.com/en-us/cli/azure/install-azure-cli" target="_blank" rel="noreferrer noopener">here</a> for instruction</li><li>Azure Account with a valid subscription</li></ul>



<p class="wp-block-paragraph"></p>



<p class="wp-block-paragraph"></p>



<h1 class="wp-block-heading">Getting started </h1>



<p class="wp-block-paragraph"></p>



<h2 class="wp-block-heading">Step 1 &#8211; Login to Azure cloud subscription account </h2>



<p class="wp-block-paragraph"></p>



<p class="wp-block-paragraph">Please login to the Azure cloud subscription account  using Azure CLI,</p>



<p class="wp-block-paragraph"></p>



<p class="wp-block-paragraph"><strong>Command</strong></p>



<p class="wp-block-paragraph"></p>



<pre class="wp-block-preformatted has-medium-font-size">az login</pre>



<p class="wp-block-paragraph"></p>



<h2 class="wp-block-heading">Step 2 &#8211; Create a Resource Groupe</h2>



<p class="wp-block-paragraph"></p>



<p class="wp-block-paragraph">Create a resource group with the&nbsp;<em><strong>az group create</strong></em>&nbsp;command. </p>



<p class="wp-block-paragraph">This resource will be the logical container to manage all Azure resources.</p>



<p class="wp-block-paragraph"></p>



<p class="wp-block-paragraph"><strong>Command</strong></p>



<p class="wp-block-paragraph"></p>



<pre class="wp-block-preformatted has-medium-font-size">az group create --name myResourceGroup --location eastus</pre>



<p class="wp-block-paragraph"></p>



<p class="wp-block-paragraph"><strong>Example </strong></p>



<p class="wp-block-paragraph"></p>



<pre class="wp-block-preformatted has-medium-font-size">az group create --name thecodebuzz-group --location eastus</pre>



<p class="wp-block-paragraph"></p>



<figure class="wp-block-image size-large"><img loading="lazy" decoding="async" width="1024" height="273" src="https://www.thecodebuzz.com/wp-content/uploads/2022/04/Azure-CLI-Push-a-container-to-Azure-private-registry-1-1024x273.jpg" alt="Terminal showing the Azure CLI command to create resource group thecodebuzz-group in eastus, with a succeeded provisioning state JSON response." class="wp-image-21638" srcset="https://thecodebuzz.com/wp-content/uploads/2022/04/Azure-CLI-Push-a-container-to-Azure-private-registry-1-1024x273.jpg 1024w, https://thecodebuzz.com/wp-content/uploads/2022/04/Azure-CLI-Push-a-container-to-Azure-private-registry-1-300x80.jpg 300w, https://thecodebuzz.com/wp-content/uploads/2022/04/Azure-CLI-Push-a-container-to-Azure-private-registry-1-768x205.jpg 768w, https://thecodebuzz.com/wp-content/uploads/2022/04/Azure-CLI-Push-a-container-to-Azure-private-registry-1-785x209.jpg 785w, https://thecodebuzz.com/wp-content/uploads/2022/04/Azure-CLI-Push-a-container-to-Azure-private-registry-1.jpg 1245w" sizes="auto, (max-width: 1024px) 100vw, 1024px" /></figure>



<p class="wp-block-paragraph"></p>



<h2 class="wp-block-heading">Step 3 &#8211; Create an Azure container registry </h2>



<p class="wp-block-paragraph"></p>



<p class="wp-block-paragraph"><strong>Command </strong></p>



<p class="wp-block-paragraph"></p>



<pre class="wp-block-preformatted has-medium-font-size">az acr create --resource-group myResourceGroup
--name myRegistry --sku Basic</pre>



<p class="wp-block-paragraph"></p>



<p class="wp-block-paragraph"><strong>Example </strong></p>



<p class="wp-block-paragraph"></p>



<pre class="wp-block-preformatted has-medium-font-size">az acr create --resource-group thecodebuzz-group --name TheCodeBuzzRegistry --sku basic</pre>



<p class="wp-block-paragraph"></p>



<figure class="wp-block-image size-large"><img loading="lazy" decoding="async" width="1024" height="186" src="https://www.thecodebuzz.com/wp-content/uploads/2022/04/Azure-CLI-Push-a-container-to-Azure-private-registry-Create-a-Azure-container-registry-1-1024x186.jpg" alt="Terminal running az acr create to make a basic Azure Container Registry named TheCodeBuzzRegistry, with its JSON properties output." class="wp-image-21641" srcset="https://thecodebuzz.com/wp-content/uploads/2022/04/Azure-CLI-Push-a-container-to-Azure-private-registry-Create-a-Azure-container-registry-1-1024x186.jpg 1024w, https://thecodebuzz.com/wp-content/uploads/2022/04/Azure-CLI-Push-a-container-to-Azure-private-registry-Create-a-Azure-container-registry-1-300x54.jpg 300w, https://thecodebuzz.com/wp-content/uploads/2022/04/Azure-CLI-Push-a-container-to-Azure-private-registry-Create-a-Azure-container-registry-1-768x139.jpg 768w, https://thecodebuzz.com/wp-content/uploads/2022/04/Azure-CLI-Push-a-container-to-Azure-private-registry-Create-a-Azure-container-registry-1-785x143.jpg 785w, https://thecodebuzz.com/wp-content/uploads/2022/04/Azure-CLI-Push-a-container-to-Azure-private-registry-Create-a-Azure-container-registry-1.jpg 1239w" sizes="auto, (max-width: 1024px) 100vw, 1024px" /></figure>



<p class="wp-block-paragraph"></p>



<blockquote class="wp-block-quote is-layout-flow wp-block-quote-is-layout-flow"><p>Note &#8211; Registry name must conform to the following pattern <em><strong> &#8216;^[a-zA-Z0-9]*$</strong></em></p></blockquote>



<p class="wp-block-paragraph"></p>



<p class="wp-block-paragraph">For More details on the command, please visit <a href="https://docs.microsoft.com/en-US/cli/azure/acr#az_acr_create" target="_blank" rel="noreferrer noopener">this</a> guideline.</p>



<p class="wp-block-paragraph"></p>



<p class="wp-block-paragraph">Once the registry is created, you will see the below output. Please make a note of the <strong><em>loginServer </em></strong>alone which we will need in the next step,</p>



<p class="wp-block-paragraph"></p>


<div class="wp-block-syntaxhighlighter-code "><pre class="brush: csharp; highlight: [14]; title: ; notranslate">
{
  &quot;adminUserEnabled&quot;: false,
  &quot;anonymousPullEnabled&quot;: false,
  &quot;creationDate&quot;: &quot;2022-02-01T16:48:39.075263+00:00&quot;,
  &quot;dataEndpointEnabled&quot;: false,
  &quot;dataEndpointHostNames&quot;: &#x5B;],
  &quot;encryption&quot;: {
    &quot;keyVaultProperties&quot;: null,
    &quot;status&quot;: &quot;disabled&quot;
  },
  &quot;id&quot;: &quot;/subscriptions/000000000000000/resourceGroups/thecodebuzz-group/providers/Microsoft.ContainerRegistry/registries/TheCodeBuzzRegistry&quot;,
  &quot;identity&quot;: null,
  &quot;location&quot;: &quot;eastus&quot;,
  &quot;loginServer&quot;: &quot;thecodebuzzregistry.azurecr.io&quot;,
  &quot;name&quot;: &quot;TheCodeBuzzRegistry&quot;,
  &quot;networkRuleBypassOptions&quot;: &quot;AzureServices&quot;,
  &quot;networkRuleSet&quot;: null,
  &quot;policies&quot;: {
    &quot;exportPolicy&quot;: {
      &quot;status&quot;: &quot;enabled&quot;
    },
    &quot;quarantinePolicy&quot;: {
      &quot;status&quot;: &quot;disabled&quot;
    },
    &quot;retentionPolicy&quot;: {
      &quot;days&quot;: 7,
      &quot;lastUpdatedTime&quot;: &quot;2022-02-01T16:48:40.870939+00:00&quot;,
      &quot;status&quot;: &quot;disabled&quot;
    },
    &quot;trustPolicy&quot;: {
      &quot;status&quot;: &quot;disabled&quot;,
      &quot;type&quot;: &quot;Notary&quot;
    }
  },
  &quot;privateEndpointConnections&quot;: &#x5B;],
  &quot;provisioningState&quot;: &quot;Succeeded&quot;,
  &quot;publicNetworkAccess&quot;: &quot;Enabled&quot;,
  &quot;resourceGroup&quot;: &quot;thecodebuzz-group&quot;,
  &quot;sku&quot;: {
    &quot;name&quot;: &quot;Basic&quot;,
    &quot;tier&quot;: &quot;Basic&quot;
  },
  &quot;status&quot;: null,
  &quot;systemData&quot;: {
    &quot;createdAt&quot;: &quot;2022-02-01T16:48:39.075263+00:00&quot;,
    &quot;createdBy&quot;: &quot;000000000@outlook.com&quot;,
    &quot;createdByType&quot;: &quot;User&quot;,
    &quot;lastModifiedAt&quot;: &quot;2022-02-01T16:48:39.075263+00:00&quot;,
    &quot;lastModifiedBy&quot;: &quot;00000000@outlook.com&quot;,
    &quot;lastModifiedByType&quot;: &quot;User&quot;
  },
  &quot;tags&quot;: {},
  &quot;type&quot;: &quot;Microsoft.ContainerRegistry/registries&quot;,
  &quot;zoneRedundancy&quot;: &quot;Disabled&quot;
}
</pre></div>


<h2 class="wp-block-heading"><br>Step 4 &#8211; Log in to the Azure container registry  </h2>



<p class="wp-block-paragraph"></p>



<p class="wp-block-paragraph">Let&#8217;s now login to the Azure container registry created in the above step,</p>



<p class="wp-block-paragraph"></p>



<p class="wp-block-paragraph"><strong>Command</strong></p>



<p class="wp-block-paragraph"></p>



<pre class="wp-block-preformatted has-medium-font-size">az acr login --name myRegistry 

</pre>



<p class="wp-block-paragraph"><strong>Example </strong></p>



<p class="wp-block-paragraph"></p>



<pre class="wp-block-preformatted has-medium-font-size"> az acr login --name TheCodeBuzzRegistry 

</pre>



<p class="wp-block-paragraph"></p>



<figure class="wp-block-image size-full"><img loading="lazy" decoding="async" width="1015" height="112" src="https://www.thecodebuzz.com/wp-content/uploads/2022/04/Push-a-container-to-Azure-private-registry-Login-to-Azure-container-registry.jpg" alt="Terminal output of az acr login for thecodebuzzregistry.azurecr.io, showing the suffix note and Login Succeeded message." class="wp-image-21645" srcset="https://thecodebuzz.com/wp-content/uploads/2022/04/Push-a-container-to-Azure-private-registry-Login-to-Azure-container-registry.jpg 1015w, https://thecodebuzz.com/wp-content/uploads/2022/04/Push-a-container-to-Azure-private-registry-Login-to-Azure-container-registry-300x33.jpg 300w, https://thecodebuzz.com/wp-content/uploads/2022/04/Push-a-container-to-Azure-private-registry-Login-to-Azure-container-registry-768x85.jpg 768w, https://thecodebuzz.com/wp-content/uploads/2022/04/Push-a-container-to-Azure-private-registry-Login-to-Azure-container-registry-785x87.jpg 785w" sizes="auto, (max-width: 1015px) 100vw, 1015px" /></figure>



<p class="wp-block-paragraph"></p>




<h2>Log in to ACR without Docker: az acr login &#8211;expose-token</h2>

<p>Run <code>az acr login --name &lt;registry&gt; --expose-token</code> to get an access token instead of having the Azure CLI call Docker for you. You then pass that token to <code>docker login</code> (or <code>helm registry login</code>) yourself.</p>

<h3>Why does plain az acr login fail in Cloud Shell?</h3>

<p>Plain <code>az acr login</code> hands the Entra token to the Docker client, so it needs Docker installed and <a href="https://thecodebuzz.com/docker-error-daemon-is-not-running/">a running daemon</a>. Cloud Shell has no Docker daemon. The command fails there with an error saying the docker daemon isn&#8217;t supported, and the suggested fix is <code>--expose-token</code>. The same applies to any build agent or container where Docker isn&#8217;t running.</p>

<blockquote class="tcb-plain-english" style="border-left:4px solid #f59e0b;background:#fffbeb;margin:18px 0;padding:10px 16px;font-style:normal"><p><strong>Note: </strong> An access token is like a temporary visitor badge. Normally the CLI pins the badge on Docker for you. With <code>--expose-token</code>, it hands you the badge and you pin it on yourself.</p></blockquote>

<h3>How do you pass the exposed token to docker login?</h3>

<p>Use the all-zero GUID <code>00000000-0000-0000-0000-000000000000</code> as the username and the token as the password. Feed the token through <code>--password-stdin</code> so it doesn&#8217;t land in your shell history or show up in the process list. Treat the token as short-lived and request a new one when it stops working.</p>

<h3>Which registry name goes where?</h3>

<p>The two commands expect different forms of the name, and mixing them up is a common cause of failed logins.</p>

<ul>
<li><strong>az acr login &#8211;name:</strong> use the bare registry name, such as <code>thecodebuzzregistry</code>, with no <code>.azurecr.io</code> suffix.</li>
<li><strong>docker login:</strong> use the full login server hostname, such as <code>thecodebuzzregistry.azurecr.io</code>, in lowercase.</li>
</ul>

<p>If you see an <a href="https://thecodebuzz.com/docker-denied-requested-access-to-the-resource-is-denied/">authentication error right after a login</a> that looked successful, check these two values first.</p>

<h3>Can you use Podman instead of Docker?</h3>

<p>Yes. <code>az acr login</code> calls the <code>docker</code> tool by default. Set the <code>DOCKER_COMMAND</code> environment variable to another container tool, such as <code>podman</code>, and the CLI will call that tool instead. This is handy on machines that have Podman but no Docker client.</p>



<h2 class="wp-block-heading"><br>Step 5 &#8211; Create Target TAG from Source Tag</h2>



<p class="wp-block-paragraph"></p>



<p class="wp-block-paragraph">This step is required to push an image to an azure registry. </p>



<p class="wp-block-paragraph"></p>



<p class="wp-block-paragraph">Please use an existing image that you want to push to the Azure registry.</p>



<p class="wp-block-paragraph"></p>



<p class="wp-block-paragraph">Please visit the below article,  on how to create .NET Core application container and push it to DockerHub, </p>



<p class="wp-block-paragraph"></p>



<ul class="wp-block-list"><li><a href="https://www.thecodebuzz.com/build-app-in-a-docker-container-getting-started/" title="Build App in a Docker Container-Getting Started" target="_blank" rel="noreferrer noopener"><em><strong>Build App in a Docker Container &#8211; Getting Started</strong></em></a></li></ul>



<p class="wp-block-paragraph"></p>



<p class="wp-block-paragraph">I already have the below docker images locally available </p>



<p class="wp-block-paragraph"></p>



<figure class="wp-block-image size-full is-resized"><img loading="lazy" decoding="async" src="https://www.thecodebuzz.com/wp-content/uploads/2022/04/Push-a-docker-image-to-Azure-private-registry.jpg" alt="Terminal listing local Docker images with repository, tag, image ID, creation time, and size columns, including thecodebuzzapp." class="wp-image-21646" width="653" height="139" srcset="https://thecodebuzz.com/wp-content/uploads/2022/04/Push-a-docker-image-to-Azure-private-registry.jpg 1006w, https://thecodebuzz.com/wp-content/uploads/2022/04/Push-a-docker-image-to-Azure-private-registry-300x64.jpg 300w, https://thecodebuzz.com/wp-content/uploads/2022/04/Push-a-docker-image-to-Azure-private-registry-768x164.jpg 768w, https://thecodebuzz.com/wp-content/uploads/2022/04/Push-a-docker-image-to-Azure-private-registry-785x168.jpg 785w" sizes="auto, (max-width: 653px) 100vw, 653px" /></figure>



<p class="wp-block-paragraph"></p>



<p class="wp-block-paragraph">We will be using &#8220;<strong><em>thecodebuzzapp</em></strong>&#8221; image with TAG as &#8220;<em><strong>latest </strong></em>&#8220;</p>



<p class="wp-block-paragraph"></p>



<p class="wp-block-paragraph"></p>



<blockquote class="wp-block-quote is-layout-flow wp-block-quote-is-layout-flow"><p>Before pushing an image to registry,you must TAG your image with the fully qualified name of your registry login server.</p></blockquote>



<p class="wp-block-paragraph"></p>



<h2 class="wp-block-heading">Command</h2>



<p class="wp-block-paragraph"></p>



<pre class="wp-block-preformatted has-medium-font-size">docker tag local-image:tagname &lt;login-server&gt;/new-repo:tagname</pre>



<p class="wp-block-paragraph"></p>



<p class="wp-block-paragraph">Where,</p>



<p class="wp-block-paragraph"></p>



<ul class="wp-block-list"><li><strong>local-image &#8211; </strong>Is the name or Id of th<strong>e </strong>local image. In the above example &#8220;<strong><em>thecodebuzzapp</em></strong>&#8221; is the image name.</li></ul>



<p class="wp-block-paragraph"></p>



<ul class="wp-block-list"><li> <strong>tagname </strong>&#8211; TAG name used for the local image. In the above example &#8220;<strong><em>latest</em></strong>&#8221; is the TAG name.</li></ul>



<p class="wp-block-paragraph"></p>



<ul class="wp-block-list"><li> <strong>login-server</strong> &#8211; Fully qualified login server name for your ACR instance</li></ul>



<p class="wp-block-paragraph"></p>



<ul class="wp-block-list"><li><strong> new-repo</strong>  &#8211; This is the target/remote repository name where you would like to push the docker local image. This new repository will be your image name as well.</li></ul>



<p class="wp-block-paragraph"></p>



<ul class="wp-block-list"><li> <strong>tagname  </strong>&#8211;  TAG name used for target/remote image</li></ul>



<p class="wp-block-paragraph"> </p>



<p class="wp-block-paragraph"></p>



<h2 class="wp-block-heading">Example </h2>



<p class="wp-block-paragraph"></p>



<pre class="wp-block-preformatted has-normal-font-size">docker tag thecodebuzzapp:latest thecodebuzzregistry.azurecr.io/myfirstapp:v1


</pre>



<figure class="wp-block-image size-large"><img loading="lazy" decoding="async" width="1024" height="125" src="https://www.thecodebuzz.com/wp-content/uploads/2022/04/Azure-tag-image-registry-docker-push-1024x125.jpg" alt="" class="wp-image-21647" srcset="https://thecodebuzz.com/wp-content/uploads/2022/04/Azure-tag-image-registry-docker-push-1024x125.jpg 1024w, https://thecodebuzz.com/wp-content/uploads/2022/04/Azure-tag-image-registry-docker-push-300x37.jpg 300w, https://thecodebuzz.com/wp-content/uploads/2022/04/Azure-tag-image-registry-docker-push-768x94.jpg 768w, https://thecodebuzz.com/wp-content/uploads/2022/04/Azure-tag-image-registry-docker-push-785x96.jpg 785w, https://thecodebuzz.com/wp-content/uploads/2022/04/Azure-tag-image-registry-docker-push.jpg 1254w" sizes="auto, (max-width: 1024px) 100vw, 1024px" /></figure>



<p class="wp-block-paragraph"></p>



<p class="wp-block-paragraph">Above we have created <strong><em>myfirstapp </em></strong>as a repository or placeholder and the same will also be your image name with the V1 as a tag name.</p>



<p class="wp-block-paragraph"></p>



<p class="wp-block-paragraph"></p>



<p class="wp-block-paragraph"></p>



<h2 class="wp-block-heading"> Step 6 &#8211; Push the Image to the Azure registry</h2>



<p class="wp-block-paragraph"></p>



<p class="wp-block-paragraph">Finally, let&#8217;s use the above target path of the registry to push the image to the <strong><em>Azure ACR</em></strong> instance</p>



<p class="wp-block-paragraph"></p>



<p class="wp-block-paragraph"><strong>Command</strong></p>



<p class="wp-block-paragraph"></p>



<pre class="wp-block-preformatted has-medium-font-size">docker push &lt;login-server&gt;/new-repo:tag-name</pre>



<p class="wp-block-paragraph"></p>



<p class="wp-block-paragraph"><strong>Example </strong></p>



<p class="wp-block-paragraph"></p>



<pre class="wp-block-preformatted has-medium-font-size">docker push thecodebuzzregistry.azurecr.io/myfirstapp:v1</pre>



<p class="wp-block-paragraph"></p>



<figure class="wp-block-image size-large"><img loading="lazy" decoding="async" width="1024" height="236" src="https://www.thecodebuzz.com/wp-content/uploads/2022/04/Azure-push-docker-image-ACR-instance-azure-registry-1024x236.jpg" alt="" class="wp-image-21648" srcset="https://thecodebuzz.com/wp-content/uploads/2022/04/Azure-push-docker-image-ACR-instance-azure-registry-1024x236.jpg 1024w, https://thecodebuzz.com/wp-content/uploads/2022/04/Azure-push-docker-image-ACR-instance-azure-registry-300x69.jpg 300w, https://thecodebuzz.com/wp-content/uploads/2022/04/Azure-push-docker-image-ACR-instance-azure-registry-768x177.jpg 768w, https://thecodebuzz.com/wp-content/uploads/2022/04/Azure-push-docker-image-ACR-instance-azure-registry-785x181.jpg 785w, https://thecodebuzz.com/wp-content/uploads/2022/04/Azure-push-docker-image-ACR-instance-azure-registry.jpg 1278w" sizes="auto, (max-width: 1024px) 100vw, 1024px" /></figure>



<p class="wp-block-paragraph"></p>



<h2 class="wp-block-heading">Verify or List container images from Azure Registry</h2>



<p class="wp-block-paragraph"></p>



<p class="wp-block-paragraph">Please use the below command to list and verify available images in the Azure registry,</p>



<p class="wp-block-paragraph"></p>



<p class="wp-block-paragraph"><strong>Command </strong></p>



<p class="wp-block-paragraph"></p>



<pre class="wp-block-preformatted has-medium-font-size">az acr repository list --name myRegistryName --output table</pre>



<p class="wp-block-paragraph"></p>



<p class="wp-block-paragraph"><strong>Example </strong></p>



<p class="wp-block-paragraph"></p>



<pre class="wp-block-preformatted has-medium-font-size">az acr repository list --name thecodebuzzregistry --output table</pre>



<p class="wp-block-paragraph"></p>



<p class="wp-block-paragraph">OR</p>



<p class="wp-block-paragraph"></p>



<pre class="wp-block-preformatted has-medium-font-size">az acr repository list --name thecodebuzzregistry.azurecr.io --output table</pre>



<p class="wp-block-paragraph"></p>



<p class="wp-block-paragraph">You shall see the result below,</p>



<p class="wp-block-paragraph"></p>



<pre class="wp-block-preformatted has-medium-font-size">The login server endpoint suffix '.azurecr.io' is automatically omitted.

<span class="has-inline-color has-luminous-vivid-orange-color">Result
</span>
<span class="has-inline-color has-luminous-vivid-orange-color">----------
myfirstapp</span></pre>



<p class="wp-block-paragraph"></p>



<h2 class="wp-block-heading">Run Docker Image from Azure Registry</h2>



<p class="wp-block-paragraph"></p>



<p class="wp-block-paragraph">Now, Let&#8217;s run the container image i.e <em><strong>myfirstapp:v1</strong></em> from our container registry by using&nbsp;the docker run command.</p>



<p class="wp-block-paragraph"></p>



<p class="wp-block-paragraph"><strong>Command </strong></p>



<p class="wp-block-paragraph"></p>



<pre class="wp-block-preformatted has-medium-font-size">docker run &lt;login-server&gt;/new-repo:tag-name</pre>



<p class="wp-block-paragraph"></p>



<p class="wp-block-paragraph"><strong>Example</strong> </p>



<p class="wp-block-paragraph"></p>



<pre class="wp-block-preformatted has-medium-font-size">docker run thecodebuzzregistry.azurecr.io/myfirstapp:v1</pre>



<p class="wp-block-paragraph"></p>



<p class="wp-block-paragraph">And you will see you are running docker Image right from the Azure Registry.</p>



<p class="wp-block-paragraph"></p>



<p class="wp-block-paragraph"></p>



<p class="wp-block-paragraph"><strong><em>References </em></strong>: </p>



<p class="wp-block-paragraph"></p>



<ul class="has-medium-font-size wp-block-list"><li><a href="https://www.thecodebuzz.com/angular-app-dockerize-containerize-using-ngnix/" target="_blank" rel="noreferrer noopener" title="Docker- Containerize an Angular App with NGNIX"><em>Docker- Containerize an Angular App with NGNIX</em></a></li></ul>



<ul class="has-medium-font-size wp-block-list"><li><a href="https://www.thecodebuzz.com/build-app-in-a-docker-container-getting-started/" title="Build App in a Docker Container-Getting Started" target="_blank" rel="noreferrer noopener"><em>Build App in a Docker Container &#8211; Getting Started</em></a></li></ul>



<p class="wp-block-paragraph"></p>



<p class="wp-block-paragraph" style="font-size:18px">Do you have any <strong>comments or ideas or any better </strong>suggestions to share?</p>



<p class="has-small-font-size wp-block-paragraph"></p>



<p class="wp-block-paragraph" style="font-size:18px">Please sound off your comments below.</p>



<p class="has-medium-font-size wp-block-paragraph"></p>



<p class="has-medium-font-size wp-block-paragraph"><strong>Happy Coding </strong>!!</p>



<p class="wp-block-paragraph"></p>



<hr>



<p class="wp-block-paragraph"></p>



<p class="has-background" style="background-color:#b6d9ac;font-size:18px"><br>Please <strong><em>bookmark </em></strong>this page and <em><strong>share </strong></em>it with your friends.                                                    Please <a href="https://www.thecodebuzz.com/subscription/" target="_blank" rel="noreferrer noopener"><em><mark style="background-color:rgba(0, 0, 0, 0)" class="has-inline-color has-luminous-vivid-orange-color"><strong>Subscribe</strong> </mark></em></a>to the blog to receive notifications on freshly published (2026) best practices and guidelines for software design and development.</p>




<br>



<hr>



<p class="wp-block-paragraph"></p>



<p class="wp-block-paragraph"></p>



<p class="wp-block-paragraph"></p><p>The post <a href="https://thecodebuzz.com/azure-cli-push-a-docker-container-to-azure-private-registry/">Azure CLI – Push a container to Azure Private Registry</a> first appeared on <a href="https://thecodebuzz.com">TheCodeBuzz</a>.</p>]]></content:encoded>
					
					<wfw:commentRss>https://thecodebuzz.com/azure-cli-push-a-docker-container-to-azure-private-registry/feed/</wfw:commentRss>
			<slash:comments>0</slash:comments>
		
		
			</item>
		<item>
		<title>Create HTTP with NGINX on Linux in Azure Virtual Machine</title>
		<link>https://thecodebuzz.com/create-https-nginx-on-linux-azure-virtual-machine-ubuntu/</link>
					<comments>https://thecodebuzz.com/create-https-nginx-on-linux-azure-virtual-machine-ubuntu/#respond</comments>
		
		<dc:creator><![CDATA[admin]]></dc:creator>
		<pubDate>Sun, 23 Jan 2022 21:36:00 +0000</pubDate>
				<category><![CDATA[Azure]]></category>
		<category><![CDATA[azure app service nginx reverse proxy]]></category>
		<category><![CDATA[azure linux vm user data]]></category>
		<category><![CDATA[install nginx on azure app service]]></category>
		<category><![CDATA[linux server on azure]]></category>
		<category><![CDATA[nginx ha azure]]></category>
		<category><![CDATA[nginx on azure]]></category>
		<category><![CDATA[run nginx in azure app service]]></category>
		<category><![CDATA[task 1 create a linux virtual machine and install nginx]]></category>
		<guid isPermaLink="false">https://www.thecodebuzz.com/?p=20030</guid>

					<description><![CDATA[<p>Create HTTP with NGINX on Linux in Azure Virtual Machine Today in this article, we shall see how to Create HTTP with NGINX on Linux in Azure Virtual Machine. We shall create a Linux Virtual machine with an NGINX webserver and deploy our first application using basic commands and later we will also see how [&#8230;]</p>
<p>The post <a href="https://thecodebuzz.com/create-https-nginx-on-linux-azure-virtual-machine-ubuntu/">Create HTTP with NGINX on Linux in Azure Virtual Machine</a> first appeared on <a href="https://thecodebuzz.com">TheCodeBuzz</a>.</p>]]></description>
										<content:encoded><![CDATA[<h1 class="wp-block-heading">Create HTTP with NGINX on Linux in Azure Virtual Machine</h1>



<figure class="wp-block-image size-large is-resized"><img loading="lazy" decoding="async" src="https://www.thecodebuzz.com/wp-content/uploads/2022/01/HTTPS-with-Nginx-on-Azure-Ubuntu-virtual-machine-1024x510.jpg" alt="HTTP with NGINX on Linux in Azure Virtual Machine" class="wp-image-20045" width="677" height="337" srcset="https://thecodebuzz.com/wp-content/uploads/2022/01/HTTPS-with-Nginx-on-Azure-Ubuntu-virtual-machine-1024x510.jpg 1024w, https://thecodebuzz.com/wp-content/uploads/2022/01/HTTPS-with-Nginx-on-Azure-Ubuntu-virtual-machine-300x150.jpg 300w, https://thecodebuzz.com/wp-content/uploads/2022/01/HTTPS-with-Nginx-on-Azure-Ubuntu-virtual-machine-768x383.jpg 768w, https://thecodebuzz.com/wp-content/uploads/2022/01/HTTPS-with-Nginx-on-Azure-Ubuntu-virtual-machine-1536x766.jpg 1536w, https://thecodebuzz.com/wp-content/uploads/2022/01/HTTPS-with-Nginx-on-Azure-Ubuntu-virtual-machine-785x391.jpg 785w, https://thecodebuzz.com/wp-content/uploads/2022/01/HTTPS-with-Nginx-on-Azure-Ubuntu-virtual-machine.jpg 1695w" sizes="auto, (max-width: 677px) 100vw, 677px" /></figure>



<p class="wp-block-paragraph">Today in this article, we shall see how to Create HTTP with NGINX on Linux in Azure Virtual Machine. </p>



<p class="wp-block-paragraph"></p>



<p class="wp-block-paragraph">We shall create a Linux Virtual machine with an <strong>NGINX</strong> webserver and deploy our first application using basic commands and later we will also see how to create an ASP.NET MVC Core application.</p>



<p class="wp-block-paragraph"></p>



<p class="wp-block-paragraph">Below are the steps we will follow,</p>



<p class="wp-block-paragraph"></p>



<div class="wp-block-aioseo-table-of-contents"><ul><li><a href="#aioseo-getting-started">Getting started</a></li><li><a href="#sign-in-to-azure">Sign in to Azure</a></li><li><a href="#create-virtual-machine">Create a VM on Ubuntu using SSH and HTTP</a></li><li><a href="#aioseo-download-the-private-key">Download the private key</a></li><li><a href="#aioseo-installing-nginix-on-azure-virtual-machine">Installing NGINX on Azure Virtual Machine</a></li><li><a href="#aioseo-connect-to-virtual-machine">Connect to Virtual Machine</a></li><li><a href="#aioseo-using-cloudshell-to-run-ssh-commands">Using Cloudshell to run SSH commands</a></li><li><a href="#aioseo-install-nginx">Install NGINX</a></li><li><a href="#aioseo-view-webserver-with-webapplicaiton">View Webserver with web application</a></li><li><a href="#aioseo-setup-https-for-secured-access">Setup HTTPS for secured access</a></li></ul></div>



<p class="wp-block-paragraph"></p>



<h2 class="wp-block-heading" id="aioseo-getting-started"><strong>Getting started </strong></h2>



<p class="wp-block-paragraph"></p>



<h2 class="wp-block-heading" id="sign-in-to-azure">Sign in to Azure</h2>



<p class="wp-block-paragraph"></p>



<p class="wp-block-paragraph">Sign in to the&nbsp;<a href="https://portal.azure.com/" target="_blank" rel="noreferrer noopener">Azure portal</a>&nbsp;if you haven&#8217;t already.</p>



<p class="wp-block-paragraph"></p>



<h2 class="wp-block-heading" id="create-virtual-machine">Create a VM on Ubuntu using SSH and HTTP </h2>



<p class="wp-block-paragraph"></p>



<ul class="wp-block-list">
<li>On the <strong>Virtual machines</strong> page, select <strong>Create</strong>. The <strong>Create a virtual machine</strong> page opens.</li>
</ul>



<p class="wp-block-paragraph"></p>



<ul class="wp-block-list">
<li>In the <strong>Basics</strong> tab, under <strong>Project details</strong>, please use the correct subscription and then choose to Create a new resource group. Type the <em>name of your choice </em>for the name.*</li>
</ul>



<p class="wp-block-paragraph"></p>



<figure class="wp-block-image size-large is-resized"><img loading="lazy" decoding="async" src="https://www.thecodebuzz.com/wp-content/uploads/2022/01/Setup-HTTPS-with-Nginx-on-Azure-Ubuntu-VM-1024x499.jpg" alt="Create VM on Ubuntu using SSH and HTTP " class="wp-image-20031" width="706" height="344" srcset="https://thecodebuzz.com/wp-content/uploads/2022/01/Setup-HTTPS-with-Nginx-on-Azure-Ubuntu-VM-1024x499.jpg 1024w, https://thecodebuzz.com/wp-content/uploads/2022/01/Setup-HTTPS-with-Nginx-on-Azure-Ubuntu-VM-300x146.jpg 300w, https://thecodebuzz.com/wp-content/uploads/2022/01/Setup-HTTPS-with-Nginx-on-Azure-Ubuntu-VM-768x374.jpg 768w, https://thecodebuzz.com/wp-content/uploads/2022/01/Setup-HTTPS-with-Nginx-on-Azure-Ubuntu-VM-785x383.jpg 785w, https://thecodebuzz.com/wp-content/uploads/2022/01/Setup-HTTPS-with-Nginx-on-Azure-Ubuntu-VM.jpg 1063w" sizes="auto, (max-width: 706px) 100vw, 706px" /></figure>



<p class="wp-block-paragraph"></p>



<ul class="wp-block-list">
<li>Under <strong>Instance details</strong>,-><em> </em>for the <strong>Virtual machine name</strong> -type VM name <em>&lt;vm-name></em>,</li>
</ul>



<p class="wp-block-paragraph">Example</p>



<ul class="wp-block-list">
<li>choose&nbsp;<em>East US</em> as <strong>region </strong>or region of your choice&nbsp;and </li>



<li>choose&nbsp;<strong><em>Ubuntu 20.04 LTS</em>&nbsp;</strong>for your&nbsp;<strong>Image</strong>. </li>
</ul>



<p class="wp-block-paragraph"></p>



<p class="wp-block-paragraph"></p>



<figure class="wp-block-image size-full"><img loading="lazy" decoding="async" width="749" height="293" src="https://www.thecodebuzz.com/wp-content/uploads/2022/01/Setup-HTTPS-with-Nginx-on-Azure-Ubuntu-Virtual-machine.jpg" alt="Linux Virtual machine with NGINX" class="wp-image-20032" srcset="https://thecodebuzz.com/wp-content/uploads/2022/01/Setup-HTTPS-with-Nginx-on-Azure-Ubuntu-Virtual-machine.jpg 749w, https://thecodebuzz.com/wp-content/uploads/2022/01/Setup-HTTPS-with-Nginx-on-Azure-Ubuntu-Virtual-machine-300x117.jpg 300w" sizes="auto, (max-width: 749px) 100vw, 749px" /></figure>



<p class="wp-block-paragraph"></p>



<ul class="wp-block-list">
<li>Under <strong>Administrator account</strong>, select <strong>SSH public key</strong> as<em><strong> Authentication Type</strong></em></li>
</ul>



<p class="wp-block-paragraph"></p>



<ul class="wp-block-list">
<li>In&nbsp;Username*&nbsp;specify the user name of your choice</li>
</ul>



<p class="wp-block-paragraph"></p>



<figure class="wp-block-image size-full"><img loading="lazy" decoding="async" width="759" height="313" src="https://www.thecodebuzz.com/wp-content/uploads/2022/01/Setup-HTTPS-with-Nginx-on-Azure-Ubuntu-Virtual-machine-Administrator.jpg" alt="HTTP with NGINX on Linux in Azure Virtual Machine " class="wp-image-20033" srcset="https://thecodebuzz.com/wp-content/uploads/2022/01/Setup-HTTPS-with-Nginx-on-Azure-Ubuntu-Virtual-machine-Administrator.jpg 759w, https://thecodebuzz.com/wp-content/uploads/2022/01/Setup-HTTPS-with-Nginx-on-Azure-Ubuntu-Virtual-machine-Administrator-300x124.jpg 300w" sizes="auto, (max-width: 759px) 100vw, 759px" /></figure>



<p class="wp-block-paragraph"></p>



<ul class="wp-block-list">
<li>For <strong>Key pair name</strong> </li>
</ul>



<ul class="wp-block-list">
<li>For&nbsp;<strong>SSH public key source</strong>, you can leave the default of&nbsp;<strong>Generate new key pair</strong>.</li>
</ul>



<p class="wp-block-paragraph"></p>



<p class="wp-block-paragraph"></p>



<ul class="wp-block-list">
<li>For <strong>Inbound port rules</strong> > <strong>Public inbound ports</strong>,
<ul class="wp-block-list">
<li>choose to&nbsp;<strong>Allow selected ports</strong>&nbsp;and then </li>



<li>select&nbsp;<strong>SSH (22)</strong>&nbsp;and&nbsp;<strong>HTTP (80)</strong>&nbsp;from the drop-down.</li>
</ul>
</li>
</ul>



<p class="wp-block-paragraph"></p>



<p class="wp-block-paragraph"><img decoding="async" src="https://docs.microsoft.com/en-us/azure/virtual-machines/linux/media/quick-create-portal/inbound-port-rules.png" alt="Screenshot of the inbound port rules section where you select what ports inbound connections are allowed on"></p>



<p class="wp-block-paragraph"></p>



<ul class="wp-block-list">
<li>Select the&nbsp;<strong>Review + create</strong>&nbsp;</li>
</ul>



<p class="wp-block-paragraph"></p>



<p class="wp-block-paragraph">On the&nbsp;<strong>Create a virtual machine</strong>&nbsp;page, you get an option to create the Virtual machine.</p>



<p class="wp-block-paragraph"></p>



<h2 class="wp-block-heading" id="aioseo-download-the-private-key">Download the private key  </h2>



<figure class="wp-block-image size-full"><img loading="lazy" decoding="async" width="346" height="234" src="https://www.thecodebuzz.com/wp-content/uploads/2022/01/HTTPS-with-Nginx-on-Azure-Ubuntu-VM.jpg" alt="" class="wp-image-20035" srcset="https://thecodebuzz.com/wp-content/uploads/2022/01/HTTPS-with-Nginx-on-Azure-Ubuntu-VM.jpg 346w, https://thecodebuzz.com/wp-content/uploads/2022/01/HTTPS-with-Nginx-on-Azure-Ubuntu-VM-300x203.jpg 300w" sizes="auto, (max-width: 346px) 100vw, 346px" /></figure>



<p class="wp-block-paragraph">From the <strong>Generate new key pair</strong>&nbsp;window,-&gt;select&nbsp;<strong>Download private key and create the resource</strong>. </p>



<p class="wp-block-paragraph">A private key file will be downloaded to your machine </p>



<pre class="wp-block-preformatted has-medium-font-size">Example- <strong>vmfirst_key.pem</strong></pre>



<p class="wp-block-paragraph"></p>



<h2 class="wp-block-heading" id="aioseo-installing-nginix-on-azure-virtual-machine"><strong>Installing NGINX</strong> <strong>on Azure Virtual Machine</strong></h2>



<p class="wp-block-paragraph"></p>



<p class="wp-block-paragraph">In previous steps, we created VM successfully. Let&#8217;s first connect to VM.</p>



<p class="wp-block-paragraph"></p>



<h2 class="wp-block-heading" id="aioseo-connect-to-virtual-machine">Connect to Virtual Machine</h2>



<p class="wp-block-paragraph"></p>



<p class="wp-block-paragraph">Please go to <strong>VM ->Overview-> Connect </strong></p>



<p class="wp-block-paragraph"></p>



<p class="wp-block-paragraph">Here you will get the <strong><em>Connect </em></strong>option using either SSH or RDP or Bastion</p>



<p class="wp-block-paragraph"></p>



<figure class="wp-block-image size-full is-resized"><img loading="lazy" decoding="async" src="https://www.thecodebuzz.com/wp-content/uploads/2022/01/Connect-with-SSH-in-Azure-VM.jpg" alt="" class="wp-image-20036" width="619" height="368" srcset="https://thecodebuzz.com/wp-content/uploads/2022/01/Connect-with-SSH-in-Azure-VM.jpg 727w, https://thecodebuzz.com/wp-content/uploads/2022/01/Connect-with-SSH-in-Azure-VM-300x178.jpg 300w" sizes="auto, (max-width: 619px) 100vw, 619px" /></figure>



<p class="wp-block-paragraph"></p>



<p class="wp-block-paragraph">Copy the above command <strong><em>highlighted</em></strong>. </p>



<p class="wp-block-paragraph"></p>



<p class="wp-block-paragraph">The above commands grab your IP along with the command sample for establishing the connection with the VM. </p>



<p class="wp-block-paragraph"></p>



<p class="wp-block-paragraph">We will use the above commands in the next step.</p>



<p class="wp-block-paragraph"></p>



<p class="wp-block-paragraph"><strong>Commands copied from above are as below</strong></p>



<p class="wp-block-paragraph"></p>



<pre class="wp-block-preformatted has-medium-font-size">chmod 400 azureuser.pem</pre>



<p class="wp-block-paragraph"></p>



<pre class="wp-block-preformatted has-medium-font-size">ssh -i azureuser@&lt;Your Public IP for VM&gt;</pre>



<p class="wp-block-paragraph"></p>



<h2 class="wp-block-heading" id="aioseo-using-cloudshell-to-run-ssh-commands">Using Cloudshell to run SSH commands </h2>



<p class="wp-block-paragraph"></p>



<p class="wp-block-paragraph">Open the Cloudshell CLI command line lets upload the downloaded<strong><em> private key  </em></strong></p>



<p class="wp-block-paragraph"></p>



<figure class="wp-block-image size-full is-resized"><img loading="lazy" decoding="async" src="https://www.thecodebuzz.com/wp-content/uploads/2022/01/Azure-upload-Private-key.jpg" alt="" class="wp-image-20037" width="288" height="104" srcset="https://thecodebuzz.com/wp-content/uploads/2022/01/Azure-upload-Private-key.jpg 883w, https://thecodebuzz.com/wp-content/uploads/2022/01/Azure-upload-Private-key-300x109.jpg 300w, https://thecodebuzz.com/wp-content/uploads/2022/01/Azure-upload-Private-key-768x279.jpg 768w, https://thecodebuzz.com/wp-content/uploads/2022/01/Azure-upload-Private-key-785x285.jpg 785w" sizes="auto, (max-width: 288px) 100vw, 288px" /></figure>



<p class="wp-block-paragraph"></p>



<p class="wp-block-paragraph">Please run the below set of commands to connect.</p>



<p class="wp-block-paragraph"></p>



<pre class="wp-block-preformatted has-medium-font-size">ls

chmod 400 azureuser.pem

ssh -i vmfirst_key.pem azureuser@20.127.10.153</pre>



<p class="wp-block-paragraph"></p>



<figure class="wp-block-image size-full"><img loading="lazy" decoding="async" width="525" height="267" src="https://www.thecodebuzz.com/wp-content/uploads/2022/01/Connect-with-SSH-in-Azure-VM-Ubuntu.jpg" alt="" class="wp-image-20038" srcset="https://thecodebuzz.com/wp-content/uploads/2022/01/Connect-with-SSH-in-Azure-VM-Ubuntu.jpg 525w, https://thecodebuzz.com/wp-content/uploads/2022/01/Connect-with-SSH-in-Azure-VM-Ubuntu-300x153.jpg 300w" sizes="auto, (max-width: 525px) 100vw, 525px" /></figure>



<p class="wp-block-paragraph"></p>



<h2 class="wp-block-heading" id="aioseo-install-nginx">Install NGINX</h2>



<p class="wp-block-paragraph"></p>



<p class="wp-block-paragraph">Please run the below set of commands,</p>



<p class="wp-block-paragraph"></p>



<pre class="wp-block-preformatted has-medium-font-size">sudo apt-get -y update</pre>



<pre class="wp-block-preformatted has-medium-font-size">sudo apt-get -y install nginx
</pre>



<figure class="wp-block-image size-full"><img loading="lazy" decoding="async" width="700" height="270" src="https://www.thecodebuzz.com/wp-content/uploads/2022/01/Install-NGNIX-Webserver-using-SSH-in-Azure-VM-Ubuntu-1.jpg" alt="Install NGNIX Azure" class="wp-image-20040" srcset="https://thecodebuzz.com/wp-content/uploads/2022/01/Install-NGNIX-Webserver-using-SSH-in-Azure-VM-Ubuntu-1.jpg 700w, https://thecodebuzz.com/wp-content/uploads/2022/01/Install-NGNIX-Webserver-using-SSH-in-Azure-VM-Ubuntu-1-300x116.jpg 300w" sizes="auto, (max-width: 700px) 100vw, 700px" /></figure>



<p class="wp-block-paragraph"></p>



<h2 class="wp-block-heading" id="aioseo-view-webserver-with-webapplicaiton">View Webserver with web application </h2>



<p class="wp-block-paragraph"></p>



<p class="wp-block-paragraph">Once you hit the IP &#8211; you shall see a Welcome message from  NGINX,</p>



<p class="wp-block-paragraph"></p>



<pre class="wp-block-preformatted has-medium-font-size">Welcome to nginx!
If you see this page, the nginx web server is successfully installed and working. Further configuration is required.</pre>



<p class="wp-block-paragraph"></p>



<p class="wp-block-paragraph">Let&#8217;s add a custom hello message to the Webserver using <strong><em>index.html</em></strong></p>



<p class="wp-block-paragraph"></p>



<pre class="wp-block-preformatted has-medium-font-size">azureuser@vmfirst:~$ sudo su

root@vmfirst:/home/azureuser# echo "Hello TheCodeBuzz"&gt; /var/www/html/index.html
</pre>



<figure class="wp-block-image size-large is-resized"><img loading="lazy" decoding="async" src="https://www.thecodebuzz.com/wp-content/uploads/2022/01/Install-NGNIX-Webserver-using-index.html-with-hello-world-1024x424.jpg" alt="NGINX" class="wp-image-20041" width="440" height="181" srcset="https://thecodebuzz.com/wp-content/uploads/2022/01/Install-NGNIX-Webserver-using-index.html-with-hello-world-1024x424.jpg 1024w, https://thecodebuzz.com/wp-content/uploads/2022/01/Install-NGNIX-Webserver-using-index.html-with-hello-world-300x124.jpg 300w, https://thecodebuzz.com/wp-content/uploads/2022/01/Install-NGNIX-Webserver-using-index.html-with-hello-world-768x318.jpg 768w, https://thecodebuzz.com/wp-content/uploads/2022/01/Install-NGNIX-Webserver-using-index.html-with-hello-world-785x325.jpg 785w, https://thecodebuzz.com/wp-content/uploads/2022/01/Install-NGNIX-Webserver-using-index.html-with-hello-world.jpg 1367w" sizes="auto, (max-width: 440px) 100vw, 440px" /></figure>



<p class="wp-block-paragraph"><strong><em>Note</em></strong>: Please run the command <strong><em>Sudo su</em></strong> to make you a superuser. </p>



<p class="wp-block-paragraph">Without Sudo su you will get a <em><strong>Permission denied</strong></em> error.</p>



<p class="wp-block-paragraph"></p>



<h2 class="wp-block-heading" id="aioseo-setup-https-for-secured-access">Setup HTTPS for secured access </h2>



<p class="wp-block-paragraph"></p>



<p class="wp-block-paragraph">As we can see in the screenshot access to our web application is not secure.</p>



<p class="wp-block-paragraph">To make it secure, we will need to install an SSL certificate and we will enable PORT 443 for Secured access. </p>



<p class="wp-block-paragraph"></p>



<p class="wp-block-paragraph">I shall cover this in my next article. Until then kindly stay tuned!</p>



<p class="wp-block-paragraph"></p>



<p class="wp-block-paragraph"><strong>O<em>ther References:</em></strong></p>



<p class="wp-block-paragraph"></p>



<ul class="wp-block-list">
<li><a href="https://www.thecodebuzz.com/angular-app-dockerize-containerize-using-ngnix/" target="_blank" rel="noreferrer noopener" title=" Dockerize Angular app with NGINX"> <em>Dockerize Angular app with NGINX</em></a></li>
</ul>



<p class="wp-block-paragraph"></p>



<p class="wp-block-paragraph"></p>



<p class="wp-block-paragraph"></p>



<p class="wp-block-paragraph" style="font-size:18px">Do you have any <strong>comments or ideas or any better </strong>suggestions to share?</p>



<p class="has-small-font-size wp-block-paragraph"></p>



<p class="wp-block-paragraph" style="font-size:18px">Please sound off your comments below.</p>



<p class="has-medium-font-size wp-block-paragraph"></p>



<p class="has-medium-font-size wp-block-paragraph"><strong>Happy Coding </strong>!!</p>



<p class="wp-block-paragraph"></p>



<p class="wp-block-paragraph"></p>



<hr>



<p class="wp-block-paragraph"></p>



<p class="has-background" style="background-color:#b6d9ac;font-size:18px"><br>Please <strong><em>bookmark </em></strong>this page and <em><strong>share </strong></em>it with your friends.                                                    Please <a href="https://www.thecodebuzz.com/subscription/" target="_blank" rel="noreferrer noopener"><em><mark style="background-color:rgba(0, 0, 0, 0)" class="has-inline-color has-luminous-vivid-orange-color"><strong>Subscribe</strong> </mark></em></a>to the blog to receive notifications on freshly published (2026) best practices and guidelines for software design and development.</p>




<br>



<hr>



<p class="wp-block-paragraph"></p>



<p class="wp-block-paragraph"></p><p>The post <a href="https://thecodebuzz.com/create-https-nginx-on-linux-azure-virtual-machine-ubuntu/">Create HTTP with NGINX on Linux in Azure Virtual Machine</a> first appeared on <a href="https://thecodebuzz.com">TheCodeBuzz</a>.</p>]]></content:encoded>
					
					<wfw:commentRss>https://thecodebuzz.com/create-https-nginx-on-linux-azure-virtual-machine-ubuntu/feed/</wfw:commentRss>
			<slash:comments>0</slash:comments>
		
		
			</item>
	</channel>
</rss>
