Sibeesh Passion

Top Menu

  • Home
  • Search
  • About
  • Privacy Policy

Main Menu

  • Articles
    • Azure
    • .NET
    • IoT
    • JavaScript
    • Career Advice
    • Interview
    • Angular
    • Node JS
    • JQuery
    • Knockout JS
    • Jasmine Framework
    • SQL
    • MongoDB
    • MySQL
    • WordPress
  • Contributions
    • Medium
    • GitHub
    • Stack Overflow
    • Unsplash
    • ASP.NET Forum
    • C# Corner
    • Code Project
    • DZone
    • MSDN
  • Social Media
    • LinkedIn
    • Facebook
    • Instagram
    • Twitter
  • YouTube
    • Sibeesh Venu
    • Sibeesh Passion
  • Awards
  • Home
  • Search
  • About
  • Privacy Policy

logo

Sibeesh Passion

  • Articles
    • Azure
    • .NET
    • IoT
    • JavaScript
    • Career Advice
    • Interview
    • Angular
    • Node JS
    • JQuery
    • Knockout JS
    • Jasmine Framework
    • SQL
    • MongoDB
    • MySQL
    • WordPress
  • Contributions
    • Medium
    • GitHub
    • Stack Overflow
    • Unsplash
    • ASP.NET Forum
    • C# Corner
    • Code Project
    • DZone
    • MSDN
  • Social Media
    • LinkedIn
    • Facebook
    • Instagram
    • Twitter
  • YouTube
    • Sibeesh Venu
    • Sibeesh Passion
  • Awards
  • Linux Azure Function Isolated Dot Net 9 YAML Template Deployment

  • Build, Deploy, Configure CI &CD Your Static Website in 5 mins

  • Post Messages to Microsoft Teams Using Python

  • Get Azure Blob Storage Blob Metadata Using PowerShell

  • Deploy .net 6 App to Azure from Azure DevOps using Pipelines

Azure
Home›Azure›Azure Multi-Stage Pipeline for Asp.Net Core and Azure, Deploy to Azure App Service

Azure Multi-Stage Pipeline for Asp.Net Core and Azure, Deploy to Azure App Service

By SibeeshVenu
November 6, 2020
0
2
Share:

When do you actually think about the deployment? Is it from the day you start developing your application or once after finished developing? If you are in the second category, it is already late to move to the first category. The word pipeline comes into the picture when we talk about deployment. This way we can easily achieve Continuous Integration and Continuous Delivery. So, here in this post, we are going to see how we can create a multi-stage pipeline, for our Asp.Net core and Angular application, and at the end to deploy it to the Azure App Service. I am going to use Azure DevOps, but the steps may look similar if you use any other public cloud. Let’s start then.

Asp.Net Core Application with Angular

I already created both Asp.Net and Angular applications using the Angular project template. There are many advantages that I can think of if you are using this template. Some of them are listed below.

  • Angular CLI integration. In development mode, there’s no need to run ng serve. It runs in the background automatically, so your client-side resources are dynamically built on demand and the page refreshes when you modify any file.
  • Efficient production builds. In production mode, development-time features are disabled, and your dotnet publish configuration automatically invokes ng build to produce minified, ahead-of-time compiled JavaScript files.

You can read more about this template here. Open your application once it is created, and you should be able to see your Angular application in the ClientApp folder. Now, go to the file Startup.cs and check the method ConfigurationServices, here we are setting to serve the angular project from dist folder for the production.

Look the Configure method and that is where we set the SPA.

Enough of the details about the application. Let’s start creating the pipeline now.

Azure Multi-Stage Pipeline

Go to your Azure DevOps project and click on the Pipelines, you should see an option to create a dummy YAML file there. And when it is created, just replace it with the preceding content.

From the pipeline, you can see that we have 4 stages Build, Deploy_to_dev_environment, Deploy_to_staging_environment, Deploy_to_production_environment. In the stage build, we build the application and save the output to the publish_out folder. If you don’t provide any folder name, most likely you will get an error “Program does not contain a static ‘Main’ method suitable for an entry point”, and I have already answered this question on StackOverflow. Please feel free to check that.

After the build, we run the task publish, and please remember that your Angular application will also be ready for production as we use the Angular template from Visual Studio. In the other stages, we added a task to deploy the package to the Azure App Service. Please be noted that you need Azure Service Connection to do this. Please follow this doc to do that.

Once everything is done, just go to your Azure DevOps project and run your pipeline. If everything goes well, you should now see the output as in the preceding image. Please remember that the stages depend on the branch you run, that is the condition we added. For example, for dev we added the condition condition: and(succeeded(‘Build’), eq(variables[‘build.sourceBranch’], ‘refs/heads/dev’))

Multi stage pipeline output

Conclusion

Here in this post, we have seen how to create an azure multi-stage pipeline fou our Asp.Net core and Angular application, that will also deeply to an Azure App Service.

About the Author

I am yet another developer who is passionate about writing and video creation. I have written close to 500 blogs on my blog. And I upload videos on my YouTube channels Njan Oru Malayali and Sibeesh Passion. Please feel free to follow me.

  • GitHub
  • medium
  • Twitter

Your turn. What do you think?

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

Kindest Regards

Sibeesh Venu

Tagsasp net core and angular azure pipelineasp net core and angular pipelineAzure app service multi stage pipelineazure app service pipelineazure app service ymlAzure DevOpsmulti stage pipeline azuremulti stage pipeline for asp net core and angular
Previous Article

Validating Azure ARM Template Never Been Easier

Next Article

Why Not Secure Your Keys and Secrets? ...

0
Shares
  • 0
  • +
  • 0
  • 0
  • 0

SibeeshVenu

I am Sibeesh Venu, an engineer by profession and writer by passion. Microsoft MVP, Author, Speaker, Content Creator, Youtuber, Programmer.

Related articles More from author

  • Azureazure devops

    Move Azure DevOps Work Items From One Organization to Another

    March 9, 2020
    By SibeeshVenu
  • Azure

    Azure Function Build and Release Pipeline in Azure DevOps CI CD

    July 9, 2019
    By SibeeshVenu
  • azure and azure devops automation dotnet 6.jpg
    Azure

    Deploy .net 6 App to Azure from Azure DevOps using Pipelines

    December 15, 2021
    By SibeeshVenu
  • Azure

    Azure DevOps Service Connection with Multiple Azure Resource Group

    November 19, 2021
    By SibeeshVenu
  • Azureazure devops

    Move Git Repositories From One to Other Organization in Azure DevOps

    March 6, 2020
    By SibeeshVenu
  • Azure

    Deploy Angular App Using Azure DevOps Build and Release Pipelines

    January 7, 2019
    By SibeeshVenu
0

My book

Asp Net Core and Azure with Raspberry Pi Sibeesh Venu

YouTube

MICROSOFT MVP (2016-2022)

profile for Sibeesh Venu - Microsoft MVP

Recent Posts

  • Linux Azure Function Isolated Dot Net 9 YAML Template Deployment
  • Build, Deploy, Configure CI &CD Your Static Website in 5 mins
  • Easily move data from one COSMOS DB to another
  • .NET 8 New and Efficient Way to Check IP is in Given IP Range
  • Async Client IP safelist for Dot NET
  • Post Messages to Microsoft Teams Using Python
  • Get Azure Blob Storage Blob Metadata Using PowerShell
  • Deploy .net 6 App to Azure from Azure DevOps using Pipelines
  • Integrate Azure App Insights in 1 Minute to .Net6 Application
  • Azure DevOps Service Connection with Multiple Azure Resource Group

Tags

Achievements (35) Angular (14) Angular 5 (7) Angular JS (15) article (10) Article Of The Day (13) Asp.Net (14) Azure (65) Azure DevOps (10) Azure Function (10) Azure IoT (7) C# (17) c-sharp corner (13) Career Advice (11) chart (11) CSharp (7) CSS (7) CSS3 (6) HighChart (10) How To (9) HTML5 (10) HTML5 Chart (11) Interview (6) IoT (11) Javascript (10) JQuery (82) jquery functions (9) JQWidgets (15) JQX Grid (17) Json (7) Microsoft (8) MVC (20) MVP (9) MXChip (7) News (18) Office 365 (7) Products (10) SQL (20) SQL Server (15) Visual Studio (10) Visual Studio 2017 (7) VS2017 (7) Web API (12) Windows 10 (7) Wordpress (9)
  • .NET
  • Achievements
  • ADO.NET
  • Android
  • Angular
  • Arduino
  • Article Of The Day
  • ASP.NET
  • Asp.Net Core
  • Automobile
  • Awards
  • Azure
  • Azure CDN
  • azure devops
  • Blockchain
  • Blog
  • Browser
  • C-Sharp Corner
  • C#
  • Career Advice
  • Code Snippets
  • CodeProject
  • Cognitive Services
  • Cosmos DB
  • CSS
  • CSS3
  • Data Factory
  • Database
  • Docker
  • Drawings
  • Drill Down Chart
  • English
  • Excel Programming
  • Exporting
  • Facebook
  • Fun
  • Gadgets
  • GitHub
  • GoPro
  • High Map
  • HighChart
  • How to
  • HTML
  • HTML5
  • Ignite UI
  • IIS
  • Interview
  • IoT
  • JavaScript
  • JQuery
  • jQuery UI
  • JQWidgets
  • JQX Grid
  • Json
  • Knockout JS
  • Linux
  • Machine Learning
  • Malayalam
  • Malayalam Poems
  • MDX Query
  • Microsoft
  • Microsoft ADOMD
  • Microsoft MVP
  • Microsoft Office
  • Microsoft Technologies
  • Microsoft Windows
  • Microsoft Windows Server
  • Mobile
  • MongoDB
  • Monthly Winners
  • MVC
  • MVC Grid
  • MySQL
  • News
  • Node JS
  • npm
  • Number Conversions
  • October 2015
  • Office 365
  • Office Development
  • One Plus
  • Outlook
  • Page
  • PHP
  • Poems
  • PowerShell
  • Products
  • Q&A
  • Raspberry PI
  • React
  • SEO
  • SharePoint
  • Skype
  • Social Media
  • Software
  • Spire.Doc
  • Spire.PDF
  • Spire.XLS
  • SQL
  • SQL Server
  • SSAS
  • SSMS
  • Storage In HTML5
  • Stories
  • Third Party Software Apps
  • Tips
  • Tools
  • Translator Text
  • Uncategorized
  • Unit Testing
  • UWP
  • VB.Net
  • Videos
  • Virtual Machine
  • Visual Studio
  • Visual Studio 2017
  • Wamp Server
  • Web API
  • Web Platform Installer
  • Webinars
  • WebMatrix
  • Windows 10
  • Windows 7
  • Windows 8.1
  • Wordpress
  • Writing

ABOUT ME

I am Sibeesh Venu, an engineer by profession and writer by passion. Microsoft MVP, Author, Speaker, Content Creator, Youtuber, Programmer. If you would like to know more about me, you can read my story here.

Contact Me

  • info@sibeeshpassion.com

Pages

  • About
  • Search
  • Privacy Policy
  • About
  • Search
  • Privacy Policy
© Copyright Sibeesh Passion 2014-2025. All Rights Reserved.
Go to mobile version