<?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>Fri, 24 Nov 2023 19:39:44 +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>Today in this article, we will see Azure &#8211; Get All Pull requests using ADO DevOps API feature in detail.</p>



<p></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>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></p>



<p></p>



<p>We will use the below API for the same.</p>



<p></p>



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



<p></p>



<p><strong>GET API</strong></p>



<p></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></p>



<p><strong>Build pipeline With optional parameters</strong></p>



<p></p>



<p><strong>GET API</strong></p>



<p></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></p>



<p></p>



<p></p>



<p>In the above Post request below are the input parameters,</p>



<p></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></p>



<p></p>



<p>Below is our sample repository,</p>



<p></p>



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



<p></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></p>



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



<p></p>



<p>Let&#8217;s now configure the API to be invoked securely.</p>



<p></p>



<p>Step1- Click on the User settings and set up the <em><strong>personal access token</strong></em>.</p>



<p></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>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></p>



<p>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></p>



<p></p>



<p>Once you execute the GET API, all metadata associated with Pull request can be accessed easily ,</p>



<p></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></p>



<p><strong>References</strong>: </p>



<p></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></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=""></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 (2025) best practices and guidelines for software design and development.</p>




<br>



<hr>



<p class=""></p>



<p></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>Today in this article, we will see how to use API for automating Azure DevOps ADO Build Pipelines process.</p>



<p></p>



<p>We will see an example of how to trigger Azure Pipelines build via API. </p>



<p>We will look over all 2 approaches to achieve the same,</p>



<p></p>



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



<p></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></p>



<p>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>We will use the below API for the same.</p>



<p></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></p>



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



<p></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></p>



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



<p></p>



<p>We can build a pipeline With optional parameters as explained in below example,</p>



<p></p>



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



<p></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></p>



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



<p></p>



<p>In the above Post request below are the input parameters,</p>



<p></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></p>



<p><strong>Request Body </strong></p>



<p></p>



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



<p></p>



<p>Below is our sample repository,</p>



<p></p>



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



<p></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></p>



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



<p></p>



<p>Let&#8217;s now configure the API to be invoked securely.</p>



<p></p>



<p><strong>Step 1-</strong> Click on the User settings and set up the <em><strong>personal access token</strong></em>.</p>



<p></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>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></p>



<p>Finally below is our URL and input request object defined,</p>



<p></p>



<p><strong>Define URL</strong></p>



<p></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></p>



<p>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></p>



<p>Below is my request body,</p>



<p></p>



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



<p></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></p>



<p>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></p>



<p><strong>References</strong>: </p>



<p></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></p>



<p 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"></p>



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



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



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



<p></p>



<hr>



<p class=""></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 (2025) best practices and guidelines for software design and development.</p>




<br>



<hr>



<p class=""></p>



<p></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 build pipeline apie]]></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-devops-build-pipelines-using-run-pipeline-api-automatazure devops api run pipeline with parameters]]></category>
		<category><![CDATA[create release pipeline in azure devops using 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. 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 [&#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>Today in this article, we will see how to use API for Automating Azure DevOps Build Pipelines using Run Pipeline API.</p>



<p>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></p>



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



<p></p>



<p>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>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>For more details please see below article,</p>



<p></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></p>



<p>Both approaches have similar settings/configuration steps and hence they are easy to configure.</p>



<p></p>



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



<p></p>



<p> <strong>Build pipeline</strong> </p>



<p></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></p>



<p><strong>Build pipeline With optional parameters</strong></p>



<p></p>



<p><strong>POST API</strong></p>



<p></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></p>



<p><strong>Input Parameters</strong></p>



<p></p>



<p>In the above Post request below are the input parameters,</p>



<p></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></p>



<p><strong>Request Body </strong></p>



<p></p>



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



<p></p>



<p>Below is our sample repository,</p>



<p></p>



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



<p></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></p>



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



<p></p>



<p>Let&#8217;s now configure the API to be invoked securely.</p>



<p></p>



<p>Step1- Click on the User settings and set up the personal access token.</p>



<p></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>Define a name for this token and authorize the scope of access with this token. You can choose this token access for Build pipeline trigger or release pipeline trigger etc.</p>



<p></p>



<p>Finally below is our URL and input request object defined,</p>



<p></p>



<p><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></p>



<p>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></p>



<p><strong>Request Object for Build Pipeline API</strong></p>



<p></p>



<p>Below is my request body,</p>



<p></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></p>



<p><strong>Response from Build Pipeline API </strong></p>



<p></p>



<p>Below is a sample response,</p>



<p></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></p>



<p>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><strong>References</strong>: </p>



<p></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></p>



<p></p>



<p 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"></p>



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



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



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



<p></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>]]></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 - Push a container to Azure Private Registryazure container registry]]></category>
		<category><![CDATA[azure container registry pricing]]></category>
		<category><![CDATA[azure container registry url az acr push]]></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. The Azure Container Registry (ACR) is a private registry that allows you to create, store, and manage container images and related artifacts. The Azure CLI lets [&#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>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></p>



<p>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></p>



<p>In today&#8217;s article, we will cover the below aspects,</p>



<p></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></p>



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



<p></p>



<p>Before getting started, please make sure to install the below prerequisites on your local machine.</p>



<p></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></p>



<p></p>



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



<p></p>



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



<p></p>



<p>Please login to the Azure cloud subscription account  using Azure CLI,</p>



<p></p>



<p><strong>Command</strong></p>



<p></p>



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



<p></p>



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



<p></p>



<p>Create a resource group with the&nbsp;<em><strong>az group create</strong></em>&nbsp;command. </p>



<p>This resource will be the logical container to manage all Azure resources.</p>



<p></p>



<p><strong>Command</strong></p>



<p></p>



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



<p></p>



<p><strong>Example </strong></p>



<p></p>



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



<p></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="" 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></p>



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



<p></p>



<p><strong>Command </strong></p>



<p></p>



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



<p></p>



<p><strong>Example </strong></p>



<p></p>



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



<p></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="" 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></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></p>



<p>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></p>



<p>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></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></p>



<p>Let&#8217;s now login to the Azure container registry created in the above step,</p>



<p></p>



<p><strong>Command</strong></p>



<p></p>



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

</pre>



<p><strong>Example </strong></p>



<p></p>



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

</pre>



<p></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="" 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></p>



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



<p></p>



<p>This step is required to push an image to an azure registry. </p>



<p></p>



<p>Please use an existing image that you want to push to the Azure registry.</p>



<p></p>



<p>Please visit the below article,  on how to create .NET Core application container and push it to DockerHub, </p>



<p></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></p>



<p>I already have the below docker images locally available </p>



<p></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="" 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></p>



<p>We will be using &#8220;<strong><em>thecodebuzzapp</em></strong>&#8221; image with TAG as &#8220;<em><strong>latest </strong></em>&#8220;</p>



<p></p>



<p></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></p>



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



<p></p>



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



<p></p>



<p>Where,</p>



<p></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></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></p>



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



<p></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></p>



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



<p> </p>



<p></p>



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



<p></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></p>



<p>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></p>



<p></p>



<p></p>



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



<p></p>



<p>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></p>



<p><strong>Command</strong></p>



<p></p>



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



<p></p>



<p><strong>Example </strong></p>



<p></p>



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



<p></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></p>



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



<p></p>



<p>Please use the below command to list and verify available images in the Azure registry,</p>



<p></p>



<p><strong>Command </strong></p>



<p></p>



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



<p></p>



<p><strong>Example </strong></p>



<p></p>



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



<p></p>



<p>OR</p>



<p></p>



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



<p></p>



<p>You shall see the result below,</p>



<p></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></p>



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



<p></p>



<p>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></p>



<p><strong>Command </strong></p>



<p></p>



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



<p></p>



<p><strong>Example</strong> </p>



<p></p>



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



<p></p>



<p>And you will see you are running docker Image right from the Azure Registry.</p>



<p></p>



<p></p>



<p><strong><em>References </em></strong>: </p>



<p></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></p>



<p 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"></p>



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



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



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



<p></p>



<hr>



<p class=""></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 (2025) best practices and guidelines for software design and development.</p>




<br>



<hr>



<p class=""></p>



<p></p>



<p></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>Today in this article, we shall see how to Create HTTP with NGINX on Linux in Azure Virtual Machine. </p>



<p></p>



<p>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></p>



<p>Below are the steps we will follow,</p>



<p></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></p>



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



<p></p>



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



<p></p>



<p>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></p>



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



<p></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></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></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></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>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></p>



<p></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></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></p>



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



<p></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></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></p>



<p></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></p>



<p><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></p>



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



<p></p>



<p>On the&nbsp;<strong>Create a virtual machine</strong>&nbsp;page, you get an option to create the Virtual machine.</p>



<p></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>From the <strong>Generate new key pair</strong>&nbsp;window,-&gt;select&nbsp;<strong>Download private key and create the resource</strong>. </p>



<p>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></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></p>



<p>In previous steps, we created VM successfully. Let&#8217;s first connect to VM.</p>



<p></p>



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



<p></p>



<p>Please go to <strong>VM ->Overview-> Connect </strong></p>



<p></p>



<p>Here you will get the <strong><em>Connect </em></strong>option using either SSH or RDP or Bastion</p>



<p></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></p>



<p>Copy the above command <strong><em>highlighted</em></strong>. </p>



<p></p>



<p>The above commands grab your IP along with the command sample for establishing the connection with the VM. </p>



<p></p>



<p>We will use the above commands in the next step.</p>



<p></p>



<p><strong>Commands copied from above are as below</strong></p>



<p></p>



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



<p></p>



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



<p></p>



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



<p></p>



<p>Open the Cloudshell CLI command line lets upload the downloaded<strong><em> private key  </em></strong></p>



<p></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></p>



<p>Please run the below set of commands to connect.</p>



<p></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></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></p>



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



<p></p>



<p>Please run the below set of commands,</p>



<p></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></p>



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



<p></p>



<p>Once you hit the IP &#8211; you shall see a Welcome message from  NGINX,</p>



<p></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></p>



<p>Let&#8217;s add a custom hello message to the Webserver using <strong><em>index.html</em></strong></p>



<p></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><strong><em>Note</em></strong>: Please run the command <strong><em>Sudo su</em></strong> to make you a superuser. </p>



<p>Without Sudo su you will get a <em><strong>Permission denied</strong></em> error.</p>



<p></p>



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



<p></p>



<p>As we can see in the screenshot access to our web application is not secure.</p>



<p>To make it secure, we will need to install an SSL certificate and we will enable PORT 443 for Secured access. </p>



<p></p>



<p>I shall cover this in my next article. Until then kindly stay tuned!</p>



<p></p>



<p><strong>O<em>ther References:</em></strong></p>



<p></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></p>



<p></p>



<p></p>



<p 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"></p>



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



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



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



<p></p>



<p></p>



<hr>



<p class=""></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 (2025) best practices and guidelines for software design and development.</p>




<br>



<hr>



<p class=""></p>



<p></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>
