Skip to content

Latest commit

 

History

History
67 lines (48 loc) · 2.52 KB

File metadata and controls

67 lines (48 loc) · 2.52 KB

Continuous Integration with Azure DevOps

In this lab, we setup our DevOps Project in Azure to create our CI/CD pipeline. This will provide us with a standard code base to work with.

Based on this tutorial.

Prerequisites

Tasks

  1. Go to your Azure Portal and create a new DevOps Project. Make sure it meets the following demands:

    • .NET Runtime
    • ASP.NET Core application
    • Linux Web App
    • Linked to your existing Azure DevOps account
  2. When the azure resources are created, go to your Azure DevOps account and make sure that:

    • The first Build and Release are successful
    • The App is deployed and accessable
  3. Clone your code repository to your development environment and open your solution in Visual Studio:

    • Upgrade all projects to ASP.NET Core 2.1 (Right-click project > Properties)
    • Update all NuGet packages to their 2.x counterparts (Right-click project > Manage NuGet packages > Select all packages > Update)
    • Add NuGet package to the web project: "Microsoft.NET.Sdk.Razor"
  4. Unload the web project and unit test project. Make the following change to both project files:

    • Remove the line
    <PackageTargetFallback>$(PackageTargetFallback);portable-net45+win8+wp8+wpa81;</PackageTargetFallback>
  5. Set the functional tests to be ignored (this will be enabled in another lab).
    In the FunctionalTests project, make the following change:

    SampleFunctionalTests.cs
    
    [Ignore] // <-- ignore test
    public void SampleFunctionalTest1()
  6. Reload all the projects, build your solution and run the unit tests. Make sure that the unit tests pass

  7. Open the folder "ArmTemplates" in your source, and edit the file "linux-webapp-template.json":

    • Change the dotnetcore version to 2.1:
    "linuxFxVersion": {
        "type": "string",
        "defaultValue": "dotnetcore|2.1"
    },
  8. Go to your Azure Devops project site and edit the Release definition

    • In the step "Deploy Azure App Service" change the Runtime Stack to .NET Core 2.1
  9. Push your code to trigger a build/release

  10. When the Release is finished, visit your web app url to verify it is still working

Stretch goals

  1. Add custom logging to Application Insights through your Web App

Next steps

Return to the lab index and continue with the next lab.