Git Product home page Git Product logo

mcw-continuous-delivery-in-azure-devops's Introduction

Continuous delivery in Azure DevOps

This workshop is archived and no longer being maintained. Content is read-only.

Fabrikam Medical Conferences provides conference web site services tailored to the medical community. They started out 10 years ago building a few conference sites for a small conference organizer. Since then, word of mouth has spread, and Fabrikam MedicalConferences is now a well-known industry brand. They currently handle over 100 conferences per year and growing.

Websites for medical conferences are typically low budget web sites because the conferences usually have between 100 to 1500 attendees. At the same time, the conference owners have significant customization and change demands that require turnaround on a dime to the live sites. These changes can impact various aspects of the system from UI through to the back end, including conference registration and payment terms.

The VP of Engineering at Fabrikam, Susan Withers, has a team of 12 developers who handle all aspects of development, testing, deployment, and operational management of their customer sites. Due to customer demands, they have issues with the efficiency and reliability the conference websites. This mainly caused by an inefficient development and operations workflow.

November 2021

Target audience

  • Application Developer

Abstracts

Workshop

In this workshop, you will learn how to setup and configure continuous delivery within Azure and GitHub. You will do this through the use of a new Azure DevOps project, GitHub repository for source control, GitHub actions for continuous delivery and deployment automation, and an Azure Resource Manager (ARM) template for Azure resource deployment and configuration management.

At the end of this workshop, you will be able to build templates to automate cloud infrastructure and reduce error-prone manual processes. In addition, you'll create an ARM template to provision Azure resources, configure continuous delivery with Azure DevOps, and create an Azure DevOps project and Git repository.

Whiteboard design session

In this whiteboard design session, you will learn how to design a solution with a combination of ARM templates, Azure DevOps, and GitHub actions to enable continuous delivery with several Azure PaaS services.

At the end of this workshop, you will be better able to build templates to automate cloud infrastructure and reduce error-prone manual processes. In addition, you'll learn how to design a deployment and monitoring architecture using ARM templates to provision Azure resources, Application Insights for deep application monitoring, and GitHub as a source code repository and build/deploy pipeline.

Hands-on lab

In this hands-on lab, you will learn how to implement a solution with a combination of ARM templates and Azure DevOps to enable continuous delivery with several Azure PaaS services.

At the end of this workshop, you will be better able to implement solutions for continuous delivery with GitHub in Azure, as well create an ARM template to provision Azure resources, create an Azure DevOps project with a GitHub repository, and configure continuous delivery with GitHub.

Azure services and related products

  • Azure App Service
  • Azure Cosmos DB API for MongoDB
  • Application Insights
  • Azure Resource Manager
  • Azure DevOps

Related references

Help & Support

We welcome feedback and comments from Microsoft SMEs & learning partners who deliver MCWs.

Having trouble?

  • First, verify you have followed all written lab instructions (including the Before the Hands-on lab document).
  • Next, submit an issue with a detailed description of the problem.
  • Do not submit pull requests. Our content authors will make all changes and submit pull requests for approval.

If you are planning to present a workshop, review and test the materials early! We recommend at least two weeks prior.

Please allow 5 - 10 business days for review and resolution of issues.

mcw-continuous-delivery-in-azure-devops's People

Contributors

blgorman avatar darkstarclown avatar dawnmariedesjardins avatar dependabot[bot] avatar emilysaeli avatar hatboyzero avatar hkamel avatar hopero929 avatar iamalexmang avatar jimblizzard avatar jtuliani avatar kitskin avatar mgray-solliance avatar microsoftopensource avatar msftgits avatar mwasham avatar opsgilitybrian avatar paddybeaner avatar paulopsgility avatar sadukie avatar saimachi avatar sdavis3 avatar timahenning avatar waltermyersiii avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

mcw-continuous-delivery-in-azure-devops's Issues

Before the HOL

I've added the TOC from the template but the links to the tasks are not working, please review & correct formatting.

The document has a Requirements section and a Prerequisites section that look about the same. The template and TOC use Requirements. Please review & update/remove prerequisites section if possible.

Pipeline Build failed

Pipeline Build failed due to npm nan module errors:
##[error]clientapp\node_modules\nan\nan_implementation_12_inl.h(103,0): Error C2664: 'v8::MaybeLocalv8::Function v8::Function::New(v8::Localv8::Context,v8::FunctionCallback,v8::Localv8::Value,int,v8::ConstructorBehavior,v8::SideEffectType)': cannot convert argument 1 from 'v8::Isolate *' to 'v8::Localv8::Context' (compiling source file ..\src\binding.cpp) [D:\a\1\s\ClientApp\node_modules\node-sass\build\binding.vcxproj]

HOL - step-by-step

Please review line 238 - is formatting correct? Should it be in a grey box?

Issue in Exercise4 Task1

Exercise4 Task1 Step13
Pipeline got failed.
However it worked when I updated the parameter PackageForLinux from $(System.ArtifactDirectory)/**/*.zip to $(Build.ArtifactStagingDirectory)/drop/*.zip.

Exercise4 Task1 Step14
Not able to view the Tailspintoys application page.

I added a task which will swap the slots from staging to production in the yaml file, then I was able to view the tailspintoys application page.

Application Insights missing from the lab material

The abstracts has the following paragraph (emphasis mine):

At the end of this workshop, you will be better able to build templates to automate cloud infrastructure and reduce error-prone manual processes. In addition, you'll create an Azure Resource Manager (ARM) template to provision Azure resources, configure continuous delivery with Azure DevOps, configure Application Insights into an application, and create an Azure DevOps project and Git repository.

I have gone through the lab in preparation, and I have seen nothing about Application Insights in the lab material. Has the scope of the workshop changed to no longer include Application Insights, or is something missing from the lab material?

Preview feature update

Hi Preview feature in Azure DevOps has been updated :

Latest :
image

Didn't find :


image

I'll update the content accordingly as well :)

Hands-on lab step-by-step

Exercise 1, steps 9, 10 & 11 are very similar. In steps 9 and 11, you have: "Note: Your key will be different from the one shown in this screenshot." That is not there in step 10...just checking, did that get missed, or will the key be the same as the screenshot in this step?

Create Azure DevOps build pipeline - Build failed

Hi,

when implementing exercise 3, an error raised during build of the pipeline.
The Nuget restore operation failed and it looks to be related to an inconsistency between some package from AspNetCore.Authentication and NETCoreApp,Version=v2.2:

Package Microsoft.AspNetCore.Authentication.Abstractions 2.1.0 is not compatible with netcoreapp2.2 (.NETCoreApp,Version=v2.2). Package Microsoft.AspNetCore.Authentication.Abstractions 2.1.0 supports: netstandard2.0 (.NETStandard,Version=v2.0)

I tried to make the build with another agent pool and image but still get some error:
Package Microsoft.AspNetCore 2.1.0 is not compatible with netcoreapp2.2 (.NETCoreApp,Version=v2.2). Package Microsoft.AspNetCore 2.1.0 supports: netstandard2.0 (.NETStandard,Version=v2.0
pool:
Below the alternative Agent pool + vm image configuration I tried:
name: Azure pipelines
vmImage: windows-2019
demands:

  • msbuild
  • visualstudio
  • vstest

I appreciate your feedback.
Kind regards

Rebranding to Azure DevOps

Should we consider rebranding the workshop title and its relevant document to Azure DevOps instead of VSTS?

Application Insights

image

Application Insights is mentioned as part of the LAB but the actual lad does not have that part it in. Should the description be updated and or the LAB content.

Exercise 1 - Task 4 - Deployment Fails (Wrong Directory)

If you follow along with the Before The HOL steps, your Azure Shell prompt directory will be in the studentfiles directory, but your screenshot shows/expects us to be at the root directory and is looking for the azuredeploy.json file in the $HOME directory (which it is not).

It is actually located in the /studentfiles/armtemplate/ directory.

You should update the instructions to have the student CD to the right directory, or change the command used to "$HOME/studentfiles/armtemplate/azuredeploy.json"

NOTE: These instructions will also need to be updated for Exercise 1 - Task 5, and Task 6.

Content Update - Incorporate Azure DevOps Artifacts

A more realistic scenario is that development would build and then package binaries to an Artifact repository. This would represent the version of the app and would be deployed to App Services, for example.

Objectives

  • Incorporate Artifacts to expose this feature
  • Increase the realism of the deployment

References
#29

Getting Error on Template

Getting error after updating "Staging" portion of template -

Azure Error: InvalidTemplate
Message: Deployment template validation failed: 'The template variable 'webAppName' is not found. Please see https://aka.ms/arm-template/#variables forusage details.'.
Additional Information:
Type: TemplateViolation
Info: {
"lineNumber": 1,
"linePosition": 3095,
"path": "properties.template.resources[1].resources[0].dependsOn[0]"

Missing link to the Tailspin Toys repo Ex2 task 2

Instructions at Exercise 2 T2 instantly jump in to referring to source code which has no link provided, nor is this is the pre-workshop steps. This is confusing, especially since the student has just finished working with some source code (albeit a resource template) in visual studio.
Please provide a link to the Web and Test projects and make it more obvious that the next step is specifically for committing source code for the Web App to vsts / azure devops. thanks

Content Update - Automate Before HOL

the entire prerequisite steps should be automated with scripts and ARM templates in the MCW, and executed in Cloud Shell.

Objectives:

  • speed up the prereq process for all
  • demonstrate scripting and ARM templates
  • reduce dependency on screenshots

References
#29

Exercise 3, Task 1 - Retain Trigger

The final result of the YAML edits are shown in steps 11 and 12 or Exercise 3, Task 1. Neither step displays the build pipeline trigger, which had been in place after we selected the pipeline type in step 5.

If no trigger is defined in the YAML (or from the Triggers tab in the UI), any code update will trigger a build. For instance, on creation of a new branch, as in Exercise 6. I don't think it is your intent to remove the trigger on master from the YAML.

In steps 11 and 12, I recommend that you display at the top of the YAML:

trigger:
- master

Otherwise, users may assume that it should be removed, even though the instructions do not explicitly say to remove the trigger.

Thanks for listening

Exercise 2 - Task 2 - GIT Push Fails Due to MFA

I've discovered that if I have MFA setup for my Git account, even though I am prompted for the password, I am not prompted for the second factor of authentication. Therefore the Azure Cloud Shell returns a "fatal: Authentication failed" error message.

As a workaround, if you create a Personal Access Token, this allows the "git push -u origin --all" command to work.

The instructions should be updated to reflect this potential scenario, and provide alternative steps (ie. Personal Access Token).

PostgreSQL admin password requirements

Lab participants had difficulty when entering the admin password for the ARM template. The template deployment would fail with a generic message about password complexity, but the complexity requirements are not clear. Specifically the requirement that the password cannot contain 3 or more consecutive characters from the username.

I suggest adding the complexity requirements in the document as a note.

> **Note**: The password complexity requirements are as follows. *Minimum length 8 characters. Your password must contain characters from three of the following categories – English uppercase letters, English lowercase letters, numbers (0-9), and non-alphanumeric characters (!, $, #, %, etc.). Your password cannot contain all or part of the login name. Part of a login name is defined as three or more consecutive alphanumeric characters*

Az DevOps authentication through Azure Shell

Hi,

is there specific guidelines to authenticate to Azure DevOps using Azure Shell ?
In task 2, this is required to sync up local repo (Azure Shell) with Azure DevOps Project.
Work around is to use VS code + PAT with Git Bash for Windows, but I did not find a way to do it using Azure Shell.
I appreciate your feedback.

There is no linked work items in Ex6.

In Ex6-Task1, when I set the branch policy, "Check for linked work items" is enabled as required option.
and then when I tried to submit a pull request, there is no work items to link so I got an red sign in "Task 5-step 1" as attached.
However, There is no linked work item in task 3-step 5. So after submitting a pull request, there is an red sign.
Is it okay?

Using a pre-defined Resource Group

The cloudlabs.ai lab provider, along with many organizations, do not provide users full access to a Subscription to perform the tasks related to this HOL. The user will have a pre-defined Resource Group which they are given Contributor or Owner access to.

Lack of Subscription-level access causes issues with the HOL steps, specifically:

  • Users cannot initialize the Cloud Shell using the default settings, they have to go into the Advanced settings and create a custom Storage Account
  • Users have to enter the existing Resource Group name in Task 4 Step 2 (and Task 5, 6 step 2). Entering a Resource Group name that does not exist causes an error because it cannot be created
  • If users are entering an existing RG in Task 4 Step 2, they have to enter the correct location of that Resource Group. If they enter a different location than the existing RG they will get an error, because the location cannot be changed (this is the same for Task 5 and 6 step 2)

Alternative option to add an Azure Resource manager service connection

Lab step details: Exercise 4 (Create Azure Devops release pipeline) Task 1,Step 9
There is an issue in Configuring Azure Service Connection i.e after clicking Authorize, there is an error like Failed to set Azure permission & Ensure to apply permission at the Subscription level to get Authorized to Azure , which can't be provided for this lab. So, we request you to add the steps about the drop down option i.e Advanced options and then they’ll need to select subscription / existing resource group which is the alternate solution to get authorized to Azure service connection. So they do not need subscription level permission for this.
Please find the attached files.
IMG_20190904_181303
advancedoptions
step3

Exercise 1 Task 4,5,6

The path and the screenshots mentioned in the lab guide for the command
az group deployment create --resource-group $resourceGroupName --template-file "$HOME/azuredeploy.json" (Exercise1:Step 1 of task4,task5 ,task6) does not match with the actual path i.e az group deployment create --resource-group $resourceGroupName --template-file "$HOME/studentfiles/armtemplate/azuredeploy.json" .
Can you please verify and update as soon as possible.

Content Update - Technology Stack

Currently, the entire tech stack is outdated, using older stack. I suggest we update it to the following to have the latest capabilities and open source stack on the market:

  • Angular frontend plus asp.net core API backend
  • PostgreSQL backend to demonstrate a DB other than SQL Database on Azure.

Affected

  • The whiteboard and HOL would both be affected.
  • Dev environment would change to use Visual Studio Code and dotnet compile (HOL prereqs)

References:
#29

Threshold values = null

Some threshold values were created with null in Visual Studio.
I had to change them for template deployment to work.
"threshold": NULL -> "threshold": 80.0

WDS trainer presentation - grammar recommendation

The second bullet of slide 6 in WDS trainer presentation - Continuous delivery in Azure DevOps.pptx appears to be incorrect.

It reads:

He is also been tasked with automating the entire process of testing, building, and deploying to the cloud for both of the developers, so they cannot deploy any builds that fail the test suite and for the QA team, and they can fully test new builds in a realistic cloud environment.

I think it should read:

He has also been tasked with automating the entire process of testing, building, and deploying to the cloud for both the developers, so they cannot deploy any builds that fail the test suite, and the QA team, so they can fully test new builds in a realistic cloud environment.

You do not have permissions to create resource groups under subscription

... and this is the main problem.
When I've opened the step-by-step guide the first step was "From the Azure web portal, launch the Azure Cloud Shell" and you can't do this because you can't create resource group and storage in this subscription 'cause you don't have any permissions.
Ok, I've created the storage inside current resource group called "labvm-97029", but it doesn't make sense since in Task 6, 7 and 8 you won't be able to create “test”, "dev" and "production" environments.

Screenshot 2019-10-05 at 23 43 29

In the Task 5 "Create the dev environment and deploy the template to Azure" incorrect path to azuredeploy.json. azuredeploy.json is located in $HOME/studentfiles/armtemplate after unzipping, but in the guide I found that "Now that the template file has been uploaded" and It's weird because in the task 2 we opened the azuredeploy.json in built-in editor in cloud shell.

Exercise 5 - Task 1 - Updated Steps Required

The instructions for Exercise 5 - Task 1, no longer match what is displayed in Azure DevOps.
Instead of the "Queue" button, the button now says "Run pipeline". Also, you no longer see a popup, but rather, a side blade appears, so the screenshot might need to be updated (and ideally in dark mode, as it's hard to see white on white).

Merge Conflict

Merge conflict - had to create a pull request to resolve fork issue from before. Please resolve and merge - I'll re-QC when complete.

June 2020 Update Suggestions

Here are our suggested updates for the June 2020 update. Please add any other suggestions or feedback to this issue.

  • Update diagrams to use modern Azure icons
  • YAML Based Release Pipeline update (issue #33)
  • Update to use a single resource group / service connection to allow lab to be run without requiring owner role in the subscription

No ASP.NET project in the repo

When executing Exercise 5, the release pipeline fails, since there is only an ARM template in the git repo, there is no actual ASP .NET project present. I read through the previous steps again, but I don't think I missed creating this. So this additional step of creating an ASP .NET web app project in Visual Studio and checking this in as well into the repo is still needed.

Inconsistent UI/UX for build pipeline

My user experience for "Exercise 3: Create Azure DevOps build pipeline" is different from the HOL instructions.

When I click the New pipeline button, this is what I see:

image

Assuming I continue, the next steps is:

image

With the result being the visual designer, not a YAML file:

image

I can click View YAML, but the YAML is not quite the same as in the HOL instructions.

August 2019 - Content update

This MCW is scheduled for content update.
Opsgility - please review current content and any existing open issues and provide your recommended updates for SME review.

"arm" folder should be renamed since it is ignored by visualstudio .gitignore

The standard Visual Studio gitignore file contains ignores for folders named "arm" and "arm64" since these are standard output folders for arm processors.

A user may want to add his student exercise to a git repository, and then his changes will not be under source control.

Renaming the folder to "armtemplate" would solve this.

There is an Error in EX4\Task1.

I've done all of processes in this HOL but there is an error in Ex4 - Task 1.

I've done code change, indentation, and component addition all as guided, but errors occur when running the last pipeline, and the error is as follows.
"/azure-pipelines.yml (Line:22, Col:1): Unexpected value 'steps'"

I think there are more code in 'steps' section but there are no guidance for this.

For your reference, I'm attaching a final virsion of code as text.

ASP.NET Core

Build and test ASP.NET Core projects targeting .NET Core.

Add steps that run tests, create a NuGet package, deploy, and more:

https://docs.microsoft.com/azure/devops/pipelines/languages/dotnet-core

trigger:

  • master

stages:

  • stage: Build
    displayName: 'Build Stage'
    jobs:
    • job: Build

      pool:
      vmImage: 'windows-latest'
      demands:

      • msbuild
      • visualstudio
      • vstest

steps:

Nuget Tool Installer Task

  • task: NuGetToolInstaller@0
    displayName: 'Use NuGet 4.4.1'
    inputs:
    versionSpec: 4.4.1

Node.js Tool Installer Task

Finds or downloads and caches the specified version spec of Node.js and adds it to the PATH

  • task: NodeTool@0
    inputs:
    versionSpec: '10.x'

Nuget Restore Task

  • task: NuGetCommand@2
    displayName: 'NuGet restore'
    inputs:
    restoreSolution: '**/tailspintoysweb.csproj'

Build Task

  • task: VSBuild@1
    displayName: 'Build solution'
    inputs:
    solution: '**/tailspintoysweb.csproj'
    msbuildArgs: '/p:DeployOnBuild=true /p:WebPublishMethod=Package /p:PackageAsSingleFile=true /p:SkipInvalidConfigurations=true /p:PackageLocation="$(build.artifactstagingdirectory)\"'
    platform: 'any cpu'
    configuration: 'release'

Publish Task

  • task: PublishBuildArtifacts@1
    displayName: 'Publish Artifact'
    inputs:
    PathtoPublish: '$(build.artifactstagingdirectory)'
    ArtifactName: 'drop'
    condition: succeededOrFailed()

  • stage: DevDeploy
    displayName: 'Dev Deploy Stage'
    jobs:

    • job: Deploy
      condition: and(succeeded(), eq(variables['Build.SourceBranch'], 'refs/heads/master'))
      pool:
      name: Hosted VS2017
      steps:
      • task: DownloadBuildArtifacts@0
        inputs:
        buildType: 'current'
        downloadType: 'single'
        downloadPath: '$(Build.ArtifactStagingDirectory'
        artifactName: 'drop'
  • task: AzureRmWebAppDeployment@4
    inputs:
    ConnectionType: 'AzureRM'
    azureSubscription: 'LabConnection'
    appType: 'webApp'
    WebAppName: 'tailspintoys-dev-3ykmhcbmzxvfc'
    deployToSlotOrASE: true
    ResourceGroupName: 'TailSpinToysRG'
    SlotName: 'staging'
    packageForLinux: '$(System.DefaultWorkingDirectory)/**/*.zip'

Best-practice for Solution architecture

How is merging with the master branch before running build and test best practice? If either build or test fails your errors and bugs will propagate to other developers, because they will pull the latest code from the master branch when they develop.

Pipeline triggered after commit on the new-heading branch

Thank you for this excellent guide. However, despite having scrupulously followed the indicated steps, I have a strange behavior on one of the exercise.

In Exercise 6 (Setup a pull request policy, create a task branch and submit a pull request), Task 3, Step 3, I do a commit after change the home.compenent.html in the new-heading branch.

For some reason that I don't understand, this commit caused the pipeline to run and, therefore, the deployment to Dev, Test, and Production environments.

image

Normally (if I understood correctly) this should only have happened when merging with the master branch (after completed the pull request).

Did I miss a step?

2021 Q3 Updates Suggestions

Suggestions for HOL improvement:

  1. Wire up the databases
  2. improve/rework the deployment to work in real-world development shop

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.