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›Deploy .net 6 App to Azure from Azure DevOps using Pipelines

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

By SibeeshVenu
December 15, 2021
0
0
Share:
azure and azure devops automation dotnet 6.jpg

Working with both Azure and Azure DevOps is always fun, and the possibilities of automation are endless. I have written many articles on these topics and you can read them here. As you all know that the .net6 is been a talk in the market and I can’t wait to try out things there. Here in this post, we will see how to use the Azure DevOps pipeline to build, restore and deploy the .net6 application to Azure Web App Service. Let’s get started.

At this point, I will assume that you have a .net6 application, Azure Web App Service, and Azure DevOps project with permission to configure the Pipeline and to add a new service connection to the Azure Resource Group. If you are not sure about how to configure the Service Connection to the Azure Resource Group, this post will help you.

Create the YAML files needed

We will be creating 3 YAML files as listed below.

  1. A template file with the all the tasks, so that we can reuse them for the environment specific pipelines
  2. A pipeline for Test environment
  3. A pipeline for the production environment

Template file

Let’s configure all the tasks needed in our template file. We will have 2 stages in our template. You can read this post if you are not sure how to configure the stages in the pipeline.

  1. Build stage, for performing the tasks below
    • Install .Net Core SDK
    • .Net restore
    • .Net build
    • .Net publish
    • Publish to Azure DevOps artefacts
  2. Deploy stage, to deploy the artefacts generated to the Azure Web App Service. This will involves the taks below.
    • Download the artefact
    • Deploy

Our final template file will look like this.

Add pipeline for Test environment

As we have a template available, we can use this to configure the pipeline for our test environment. All you have to do is to refer to this template and pass the required parameters. This is how our pipeline for our test environment can look like.

Here, the parameter azure subscription is the service connection name that you have created in your Azure DevOps project. Refer to this to know more. The wwebAppName is the name of your Azure Web App Service.

Add pipeline for Prod environment

Let’s create a new pipeline for our Prod environment to see how easily we can reuse the template.

Wasn’t that cool?

Configure the pipelines in the Azure DevOps

Just creating the YAML field will not create the pipelines in our DevOps, as Microsoft has removed that option due to some security concerns. So we will have to configure them manually for the first time. Let’s do it.

  1. Go to the Pipelines section from your Azure DevOps and click on the New pipeline button.
  2. Select Azure Repos Git (YAML) from the next screen.
  3. Select the repository that you pushed your YAML file code changes.
  4. Azure DevOps will analyze your repository and sugges the YAML templates. Select the Existing Azure Pipeline YAML file option.
  5. Selct the branch and the path to your YAML file as in the preceding image, review the same and run the pipeline.
Configure the pipelines in Azure DevOps

That’s it. Everything else will be working as expected from the next time as we have configured the triggers in the pipelines. If you are getting an error as “Task “NETSdkError” skipped, due to false condition; (‘$(_TargetFrameworkVersionWithoutV)’ > ‘$(NETCoreAppMaximumVersion)’) was evaluated”, you will have to make sure that you are installing the correct version of the .Net Core SDK as mentioned in this answer.

Source code

You can get the complete source code from this GitHub repository. Please feel free to fork/star.

Conclusion

Here in this post, we have learned the following things.

  1. How to configure a YAML template
  2. How to reuse a YAML template in the pipelines
  3. How to deploy the .net 6 application to Azure Web 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 is needed in this article? Could you find this post useful? Kindly do not forget to share your feedback.

Kindest Regards

Sibeesh Venu

Tags.net 6AzureAzure DevOps
Previous Article

Integrate Azure App Insights in 1 Minute ...

Next Article

Get Azure Blob Storage Blob Metadata Using ...

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

  • Azure

    Configuring Mobile Services In Microsoft Azure

    March 29, 2015
    By SibeeshVenu
  • Run without debugging
    Azure

    Fix To: Bundles Are Not Working After Hosting To MVC Application

    April 24, 2016
    By SibeeshVenu
  • Azure

    Azure CDN with Azure Web App – Access to Font at CDN has been Blocked by CORS Policy

    August 14, 2020
    By SibeeshVenu
  • Azure

    Azure DevOps Service Connection with Multiple Azure Resource Group

    November 19, 2021
    By SibeeshVenu
  • Azure

    Change MFA Phone/Mobile Number Using PowerShell

    October 19, 2021
    By SibeeshVenu
  • Azure

    Create Custom Web Apps for Microsoft Teams Using Azure Function, Node Js

    June 23, 2020
    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