<?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>Angular Release Pipeline &#8211; Sibeesh Passion</title>
	<atom:link href="https://mail.sibeeshpassion.com/tag/angular-release-pipeline/feed/" rel="self" type="application/rss+xml" />
	<link>https://mail.sibeeshpassion.com</link>
	<description>My passion towards life</description>
	<lastBuildDate>Wed, 17 Jul 2019 15:43:23 +0000</lastBuildDate>
	<language>en-US</language>
	<sy:updatePeriod>
	hourly	</sy:updatePeriod>
	<sy:updateFrequency>
	1	</sy:updateFrequency>
	<generator>https://wordpress.org/?v=6.9.4</generator>

<image>
	<url>/wp-content/uploads/2017/04/Sibeesh_Passion_Logo_Small.png</url>
	<title>Angular Release Pipeline &#8211; Sibeesh Passion</title>
	<link>https://mail.sibeeshpassion.com</link>
	<width>32</width>
	<height>32</height>
</image> 
	<item>
		<title>Deploy Angular App Using Azure DevOps Build and Release Pipelines</title>
		<link>https://mail.sibeeshpassion.com/deploy-angular-app-using-azure-devops-build-and-release-pipelines/</link>
					<comments>https://mail.sibeeshpassion.com/deploy-angular-app-using-azure-devops-build-and-release-pipelines/#disqus_thread</comments>
		
		<dc:creator><![CDATA[SibeeshVenu]]></dc:creator>
		<pubDate>Mon, 07 Jan 2019 15:59:50 +0000</pubDate>
				<category><![CDATA[Azure]]></category>
		<category><![CDATA[Angular]]></category>
		<category><![CDATA[Angular Pipeline in Azure]]></category>
		<category><![CDATA[Angular Release Pipeline]]></category>
		<category><![CDATA[Azure DevOps]]></category>
		<category><![CDATA[Deploy Angular to Azure Easily]]></category>
		<category><![CDATA[TFS]]></category>
		<guid isPermaLink="false">https://sibeeshpassion.com/?p=13530</guid>

					<description><![CDATA[[toc] Introduction I understand that there are many article on the same topic. But most of the solutions didn&#8217;t work for me with the latest pipeline configuration, so, I thought of writing this article. Here, we are going to set up our Build and Release pipeline configuration of our Angular application very easy, in fact, by following some basic tasks. We will be using Azure DevOps FTP pipeline service connection for the configuration. Let&#8217;s stop the introduction and jump in to the configuration. Background I was trying to deploy my Angular application to Azure, for that I wanted to set [&#8230;]]]></description>
										<content:encoded><![CDATA[
<p>[toc]</p>



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



<p>I understand that there are many article on the same topic. But most of the solutions didn&#8217;t work for me with the latest pipeline configuration, so, I thought of writing this article. Here, we are going to set up our Build and Release pipeline configuration of our Angular application very easy, in fact, by following some basic tasks. We will be using Azure DevOps FTP pipeline service connection for the configuration. Let&#8217;s stop the introduction and jump in to the configuration. </p>



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



<p>I was trying to deploy my <a href="https://sibeeshpassion.com/category/angular">Angular</a> application to Azure, for that I wanted to set up my build and release pipelines. I had followed some tutorials which are available already, but I was facing some issues with the same. Later, I had decided to use the Azure FTP Upload Release Task. So, basically, we will be having only one task in our Release pipeline.</p>



<h2 class="wp-block-heading">Set Up the Pipelines</h2>



<p>As I was mentioning, here, we are going to configure our Build and Release configuration. </p>



<h3 class="wp-block-heading">Build Pipeline</h3>



<p>Here we are going to configure the Azure DevOps build pipeline. But, before, we need to define our script in the package.json file. </p>



<script src="https://gist.github.com/nanotroy/6300ed763b7a9c508545b08cddd194cc.js"></script>



<p>If you have different routes, and if you need to access them directly in the URL of the browser, you should consider adding a web.config file in your src folder. </p>



<script src="https://gist.github.com/nanotroy/48ef50c3d524c3ac65e3a23fed235bd7.js"></script>



<p>Once that is done, add it as an asset in the angular.json file.</p>



<script src="https://gist.github.com/nanotroy/7cd6f89662554f217896239194b51310.js"></script>



<p>Now, go to your Azure DevOps site, and click on Pipelines and then Builds. Click on the plus icon.</p>



<h4 class="wp-block-heading">Pipeline</h4>



<p>Click on the Pipeline section. Here you can mention your pipeline name and the Agent pool, please remember to select the Agent pool as Hosted VS2017, or else you may end up seeing an error as &#8220;<a href="https://stackoverflow.com/questions/51227020/npm-failed-with-return-code-4294963238-in-ci-in-vsts/54072646#54072646">Npm failed with return code: 1 2019-01-07T10:14:37.3309955Z ##[section]Finishing: npm build</a>&#8220;.</p>



<figure class="wp-block-image"><img fetchpriority="high" decoding="async" width="650" height="304" src="https://sibeeshpassion.com/wp-content/uploads/2019/01/Select-the-Pipeline-Agent.jpg" alt="" class="wp-image-13531" srcset="/wp-content/uploads/2019/01/Select-the-Pipeline-Agent.jpg 650w, /wp-content/uploads/2019/01/Select-the-Pipeline-Agent-300x140.jpg 300w, /wp-content/uploads/2019/01/Select-the-Pipeline-Agent-400x187.jpg 400w" sizes="(max-width: 650px) 100vw, 650px" /><figcaption>Select the Pipeline Agent</figcaption></figure>



<h4 class="wp-block-heading">Phase 1</h4>



<p>I recommend you to leave this as it is, you can change the display name though. </p>



<h4 class="wp-block-heading">npm install</h4>



<p>Click on the + icon in the Phase section and search for &#8220;npm&#8221; and click add. Now we can configure this task. </p>



<figure class="wp-block-image"><img decoding="async" width="650" height="493" src="https://sibeeshpassion.com/wp-content/uploads/2019/01/npm-install-task.jpg" alt="" class="wp-image-13532" srcset="/wp-content/uploads/2019/01/npm-install-task.jpg 650w, /wp-content/uploads/2019/01/npm-install-task-300x228.jpg 300w, /wp-content/uploads/2019/01/npm-install-task-400x303.jpg 400w" sizes="(max-width: 650px) 100vw, 650px" /><figcaption>npm install task</figcaption></figure>



<p>You can also click on the ribbon View YAML, to see the <g class="gr_ gr_3 gr-alert gr_spell gr_inline_cards gr_run_anim ContextualSpelling" id="3" data-gr-id="3">yml</g> version of the task.</p>



<h4 class="wp-block-heading">npm build</h4>



<p>In this step, we will add a new npm task and configure it for our build script. </p>



<figure class="wp-block-image"><img decoding="async" width="650" height="513" src="https://sibeeshpassion.com/wp-content/uploads/2019/01/npm-run-build.jpg" alt="" class="wp-image-13533" srcset="/wp-content/uploads/2019/01/npm-run-build.jpg 650w, /wp-content/uploads/2019/01/npm-run-build-300x237.jpg 300w, /wp-content/uploads/2019/01/npm-run-build-400x316.jpg 400w" sizes="(max-width: 650px) 100vw, 650px" /><figcaption>npm run build</figcaption></figure>



<p>Please be noted that the command is custom and we have given the script which we have already set in our package.json file, which is prod-build-dev. </p>



<h4 class="wp-block-heading">Publish Artifact</h4>



<p>Here, in this step, we will publish our artifacts generated. This is very important, otherwise, the release configuration will not be able to find your package.json file in the directory. Add a new task called &#8220;Publish Build Artifacts&#8221; and configure the same as mentioned in the image below. </p>



<figure class="wp-block-image"><img decoding="async" width="650" height="486" src="https://sibeeshpassion.com/wp-content/uploads/2019/01/Publish-Build-Artifacts.jpg" alt="" class="wp-image-13534" srcset="/wp-content/uploads/2019/01/Publish-Build-Artifacts.jpg 650w, /wp-content/uploads/2019/01/Publish-Build-Artifacts-300x224.jpg 300w, /wp-content/uploads/2019/01/Publish-Build-Artifacts-400x299.jpg 400w" sizes="(max-width: 650px) 100vw, 650px" /><figcaption>Publish Build Artifacts<br></figcaption></figure>



<h4 class="wp-block-heading">Enable the Continuous Integration</h4>



<p>As we have set up the Tasks, now it is time to set up the continuous integration. Click on the Triggers section and check the Enable continuous integration.  </p>



<figure class="wp-block-image"><img decoding="async" width="650" height="216" src="https://sibeeshpassion.com/wp-content/uploads/2019/01/Enable-Continuous-Integration.jpg" alt="" class="wp-image-13535" srcset="/wp-content/uploads/2019/01/Enable-Continuous-Integration.jpg 650w, /wp-content/uploads/2019/01/Enable-Continuous-Integration-300x100.jpg 300w, /wp-content/uploads/2019/01/Enable-Continuous-Integration-400x133.jpg 400w" sizes="(max-width: 650px) 100vw, 650px" /><figcaption>Enable Continuous Integration</figcaption></figure>



<h4 class="wp-block-heading">Debugging the Build</h4>



<p>If you ever need to debug the build pipeline, you can enable the same in the Variable section. Just making the system.debug value to true will do the trick. </p>



<figure class="wp-block-image"><img decoding="async" width="651" height="137" src="https://sibeeshpassion.com/wp-content/uploads/2019/01/Debugging-Build.jpg" alt="" class="wp-image-13536" srcset="/wp-content/uploads/2019/01/Debugging-Build.jpg 651w, /wp-content/uploads/2019/01/Debugging-Build-300x63.jpg 300w, /wp-content/uploads/2019/01/Debugging-Build-400x84.jpg 400w" sizes="(max-width: 651px) 100vw, 651px" /><figcaption>Debugging Build</figcaption></figure>



<h4 class="wp-block-heading">Run the Build</h4>



<p>Once you are done everything, you can click on the Save &amp; Queue button to initiate the build. Our Agent will run now, the tasks will be executed, as we have enabled the debug property to true in the Variables, we can now see the detailed logs in the console. The following tasks will be happening.</p>



<figure class="wp-block-image"><img decoding="async" width="641" height="1008" src="https://sibeeshpassion.com/wp-content/uploads/2019/01/Build-Pipeline-Output.jpg" alt="" class="wp-image-13537" srcset="/wp-content/uploads/2019/01/Build-Pipeline-Output.jpg 641w, /wp-content/uploads/2019/01/Build-Pipeline-Output-191x300.jpg 191w, /wp-content/uploads/2019/01/Build-Pipeline-Output-400x629.jpg 400w, /wp-content/uploads/2019/01/Build-Pipeline-Output-382x600.jpg 382w" sizes="(max-width: 641px) 100vw, 641px" /><figcaption>Build Pipeline Output</figcaption></figure>



<h3 class="wp-block-heading">Release Pipeline</h3>



<p>Wow, we have successfully created our build pipeline, now it is time to create a Release pipeline. As I mentioned earlier, we are going to have only one Task in our Release pipeline, which is nothing but &#8220;FTP Upload&#8221;. Click on the Pipelines and then Releases, click on the +New icon to create a new Release pipeline. </p>



<h4 class="wp-block-heading">Select the Artifacts</h4>



<p>Here, in this step, we should select the Artifacts generated in the build.</p>



<figure class="wp-block-image"><img decoding="async" width="650" height="563" src="https://sibeeshpassion.com/wp-content/uploads/2019/01/Select-the-Artifacts.jpg" alt="" class="wp-image-13539" srcset="/wp-content/uploads/2019/01/Select-the-Artifacts.jpg 650w, /wp-content/uploads/2019/01/Select-the-Artifacts-300x260.jpg 300w, /wp-content/uploads/2019/01/Select-the-Artifacts-400x346.jpg 400w" sizes="(max-width: 650px) 100vw, 650px" /><figcaption>Select the Artifacts</figcaption></figure>



<h4 class="wp-block-heading">Select the Stage</h4>



<p>Click on the Stages and add one.</p>



<h4 class="wp-block-heading">Adding a FTP Service Connection</h4>



<p>Before we add a new FTP Upload task, we need to create a new FTP service connection in our Azure DevOps site. Click on the Project Settings on the bottom left corner, go to the Pipelines section, and then click on the Service connections. Now click on the + New service connection, in the pop up you need to provide the details which you can get from the Publish profile of your Azure Web App (Click on the Get Publish Profile in your Web App resource, overview section in the Azure portal).</p>



<figure class="wp-block-image"><img decoding="async" width="649" height="370" src="https://sibeeshpassion.com/wp-content/uploads/2019/01/Add-a-Generic-Service-Connection.jpg" alt="" class="wp-image-13540" srcset="/wp-content/uploads/2019/01/Add-a-Generic-Service-Connection.jpg 649w, /wp-content/uploads/2019/01/Add-a-Generic-Service-Connection-300x171.jpg 300w, /wp-content/uploads/2019/01/Add-a-Generic-Service-Connection-400x228.jpg 400w" sizes="(max-width: 649px) 100vw, 649px" /><figcaption>Add a Generic Service Connection</figcaption></figure>



<h4 class="wp-block-heading">Add the FTP Upload Task</h4>



<p>Now it is time to add the FTP Upload Task. Click on the + icon in the Agent Job Task and add the task FTP Upload.</p>



<figure class="wp-block-image"><img decoding="async" width="470" height="807" src="https://sibeeshpassion.com/wp-content/uploads/2019/01/FTP-Upload-Task.jpg" alt="" class="wp-image-13541" srcset="/wp-content/uploads/2019/01/FTP-Upload-Task.jpg 470w, /wp-content/uploads/2019/01/FTP-Upload-Task-175x300.jpg 175w, /wp-content/uploads/2019/01/FTP-Upload-Task-400x687.jpg 400w, /wp-content/uploads/2019/01/FTP-Upload-Task-349x600.jpg 349w" sizes="(max-width: 470px) 100vw, 470px" /><figcaption>FTP Upload Task</figcaption></figure>



<p>Here the remote directory is the folder where our application files are going to be, you should be able to see those files if you just log in to the explorer using your FTP details from your app publish profile. </p>



<h4 class="wp-block-heading">Create a Release</h4>



<p>Now, it is time to create a Release, click on the + Release button and then + Create a release. In the upcoming window, you should be able to see the pipeline and the Artifacts selected. Just click on the Create button. The Agent will be started in a few seconds, once it is ready, it will execute the tasks. Please be noted that the FTP Upload task will remove the content from the directory first and then upload the new one. </p>



<figure class="wp-block-image"><img decoding="async" width="598" height="247" src="https://sibeeshpassion.com/wp-content/uploads/2019/01/Release-Pipeline-Tasks-Output.jpg" alt="" class="wp-image-13543" srcset="/wp-content/uploads/2019/01/Release-Pipeline-Tasks-Output.jpg 598w, /wp-content/uploads/2019/01/Release-Pipeline-Tasks-Output-300x124.jpg 300w, /wp-content/uploads/2019/01/Release-Pipeline-Tasks-Output-400x165.jpg 400w" sizes="(max-width: 598px) 100vw, 598px" /><figcaption>Release Pipeline Tasks Output</figcaption></figure>



<h2 class="wp-block-heading">Change the App Service Virtual Path</h2>



<p>As we have given a custom folder in the Release configuration, we should also change the Virtual Path of the Azure App service. To do so, go to your Azure App Service and then select Virtual Path under Application Settings. Set the Virtual Path as &#8220;/&#8221; and Virtual Path as &#8220;site\wwwroot\wwwroot\yourappname(the folder name inside dist folder)&#8221; and the type as &#8220;Application&#8221;.</p>



<figure class="wp-block-image"><img decoding="async" width="653" height="94" src="https://sibeeshpassion.com/wp-content/uploads/2019/01/Set-Virtual-Physical-Path.jpg" alt="" class="wp-image-13544" srcset="/wp-content/uploads/2019/01/Set-Virtual-Physical-Path.jpg 653w, /wp-content/uploads/2019/01/Set-Virtual-Physical-Path-300x43.jpg 300w, /wp-content/uploads/2019/01/Set-Virtual-Physical-Path-400x58.jpg 400w" sizes="(max-width: 653px) 100vw, 653px" /><figcaption>Set Virtual Physical Path</figcaption></figure>



<p>Once you are done, you can see your Angular application running. </p>



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



<p>Wow!. Now we have learned,</p>



<ul class="wp-block-list"><li>How to set up the Azure DevOps Build Pipeline configuration</li><li> How to set up the Azure DevOps Release Pipeline configuration </li><li>How to create new FTP Service Connection in Azure DevOps</li><li>How to configure Azure Web App</li></ul>



<p>You can always read my articles related to Azure <a href="https://sibeeshpassion.com/category/azure">here</a>. </p>



<h2 class="wp-block-heading">Your turn. What do you think?</h2>



<p>Thanks a lot for reading. Did I miss anything that you may think which is needed in this article? Could you find this post as useful? Kindly do not forget to share me your feedback.</p>



<p>Kindest Regards<br>Sibeesh Venu</p>
]]></content:encoded>
					
					<wfw:commentRss>https://mail.sibeeshpassion.com/deploy-angular-app-using-azure-devops-build-and-release-pipelines/feed/</wfw:commentRss>
			<slash:comments>0</slash:comments>
		
		
			</item>
	</channel>
</rss>
