Slide 1

Slide 1 text

No content

Slide 2

Slide 2 text

No content

Slide 3

Slide 3 text

No content

Slide 4

Slide 4 text

No content

Slide 5

Slide 5 text

No content

Slide 6

Slide 6 text

No content

Slide 7

Slide 7 text

▪ ▪ ▪ ▪ ▪ ▪ ▪

Slide 8

Slide 8 text

No content

Slide 9

Slide 9 text

No content

Slide 10

Slide 10 text

Code Test & Stabilize Code Test & Stabilize Code Complete Planning

Slide 11

Slide 11 text

No content

Slide 12

Slide 12 text

▪ ▪ ▪ ▪ ▪

Slide 13

Slide 13 text

▪ ▪ ▪ ▪

Slide 14

Slide 14 text

No content

Slide 15

Slide 15 text

▪ ▪ ▪

Slide 16

Slide 16 text

No content

Slide 17

Slide 17 text

▪ ▪ ▪ ▪ ▪

Slide 18

Slide 18 text

▪ ▪ ▪

Slide 19

Slide 19 text

No content

Slide 20

Slide 20 text

▪ ▪ ▪ ▪ ▪

Slide 21

Slide 21 text

▪ ▪ ▪ ▪

Slide 22

Slide 22 text

No content

Slide 23

Slide 23 text

Base Infrastructure CD Service CD Base Infrastructure Template Resource Template Resource Template Dev/Test Prod Service CI Build Stage PR Stage Testing PreProd Prod Compile Service DB Schema Compile System Tests Infrastructure Artifacts Pipeline Artifacts Task / Job Templates Task / Job Templates Resource Groups, vNets, VMs, Azure SQL, CosmosDB, … App Deployment, DB instance, DB Schema, Managed Identities, Storage, … Deplyoment Verification

Slide 24

Slide 24 text

▪ ▪ ▪ ▪ ▪

Slide 25

Slide 25 text

CI build for every changed service

Slide 26

Slide 26 text

Require a successful deployment for every changed service

Slide 27

Slide 27 text

Additional security scans

Slide 28

Slide 28 text

Frontend deployment Backend deployment

Slide 29

Slide 29 text

▪ ▪ ▪ ▪ ▪ ▪ ▪

Slide 30

Slide 30 text

No content

Slide 31

Slide 31 text

No content

Slide 32

Slide 32 text

No content

Slide 33

Slide 33 text

No content

Slide 34

Slide 34 text

No content

Slide 35

Slide 35 text

No content

Slide 36

Slide 36 text

No content

Slide 37

Slide 37 text

▪ ▪ ▪ ▪ ▪

Slide 38

Slide 38 text

PR Version Release Version

Slide 39

Slide 39 text

No content

Slide 40

Slide 40 text

Service and DB Schema Testdata Automated system tests

Slide 41

Slide 41 text

Identify PR Context Add PR status check which is used as policy

Slide 42

Slide 42 text

▪ ▪ ▪ ▪

Slide 43

Slide 43 text

PR Version Release Version Build Version + Deployment Attempt

Slide 44

Slide 44 text

CI pipeline as resource (trigger and artifacts)

Slide 45

Slide 45 text

Calculate release number CI version + release revision

Slide 46

Slide 46 text

Calculate PR specific variables Setup PR environment (k8s namespace, database, identities) Deploy service Initialize test data

Slide 47

Slide 47 text

Run system tests in PR environment

Slide 48

Slide 48 text

Update PR status (collect deployment and test results)

Slide 49

Slide 49 text

Calculate the overall status Update the PR status

Slide 50

Slide 50 text

Extract deployment URL (PR specific) Only run for PR Add a PR comment with deployment info

Slide 51

Slide 51 text

▪ ▪ ▪ ▪ ▪

Slide 52

Slide 52 text

▪ ▪

Slide 53

Slide 53 text

No content

Slide 54

Slide 54 text

▪ ▪ ▪ ▪

Slide 55

Slide 55 text

▪ ▪ ▪

Slide 56

Slide 56 text

▪ ▪ ▪

Slide 57

Slide 57 text

▪ ▪ ▪ ▪ ▪ ▪ ▪ ▪ ▪ ▪ ▪ ▪ ▪ ▪ ▪ ▪ ▪ ▪ ▪ ▪ ▪ ▪ ▪

Slide 58

Slide 58 text

No content

Slide 59

Slide 59 text

No content

Slide 60

Slide 60 text

No content

Slide 61

Slide 61 text

https://dev.azure.com/4tecture-demo/_apis/public/distributedtask/webhooks/prupdated?api-version=6.0-preview

Slide 62

Slide 62 text

No content

Slide 63

Slide 63 text

Method: POST URI: https://dev.azure.com/4tecture-demo/_apis/public/distributedtask/webhooks/prupdated?api-version=6.0-preview HTTP Version: 1.1 Headers: { Content-Type: application/json; charset=utf-8 } Content: { "subscriptionId": "1de80ac8-b9a7-42d0-a2fe-5441c2b7ffc2", "notificationId": 14, "id": "af07be1b-f3ad-44c8-a7f1-c4835f2df06b", "eventType": "git.pullrequest.updated", "publisherId": "tfs", "message": { "text": "Jamal Hartnett marked the pull request as completed", "html": "Jamal Hartnett marked the pull request as completed", "markdown": "Jamal Hartnett marked the pull request as completed" }, "detailedMessage": { "text": "Jamal Hartnett marked the pull request as completed\r\n\r\n- Merge status: Succeeded\r\n- Merge commit: eef717(https://fabrikam.visualstudio.com/DefaultCollection/_apis/git/repositories/4bc14d40-c903-45e2-872e-0462c7748079/commit "html": "Jamal Hartnett marked the pull request as completed\r\n
    \r\n
  • Merge status: Succeeded
  • \r\n
  • Merge commit: eef717
  • \r\n
", "markdown": "Jamal Hartnett marked the pull request as completed\r\n\r\n+ Merge status: Succeeded\r\n+ Merge commit: [eef717](https://fabrikam.visualstudio.com/DefaultCollection/_apis/git/repositories/4bc14d40-c903-45e2-872e-0462c7748079/ }, "resource": { "repository": { "id": "4bc14d40-c903-45e2-872e-0462c7748079", "name": "Fabrikam", "url": "https://fabrikam.visualstudio.com/DefaultCollection/_apis/git/repositories/4bc14d40-c903-45e2-872e-0462c7748079", "project": { "id": "6ce954b1-ce1f-45d1-b94d-e6bf2464ba2c", "name": "Fabrikam", "url": "https://fabrikam.visualstudio.com/DefaultCollection/_apis/projects/6ce954b1-ce1f-45d1-b94d-e6bf2464ba2c", "state": "wellFormed", "visibility": "unchanged", "lastUpdateTime": "0001-01-01T00:00:00" }, "defaultBranch": "refs/heads/master", "remoteUrl": "https://fabrikam.visualstudio.com/DefaultCollection/_git/Fabrikam" }, "pullRequestId": 1, "status": "completed", "createdBy": { "displayName": "Jamal Hartnett", "url": "https://fabrikam.vssps.visualstudio.com/_apis/Identities/54d125f7-69f7-4191-904f-c5b96b6261c8", "id": "54d125f7-69f7-4191-904f-c5b96b6261c8", "uniqueName": "[email protected]", "imageUrl": "https://fabrikam.visualstudio.com/DefaultCollection/_api/_common/identityImage?id=54d125f7-69f7-4191-904f-c5b96b6261c8" }, "creationDate": "2014-06-17T16:55:46.589889Z", "closedDate": "2014-06-30T18:59:12.3660573Z", "title": "my first pull request", "description": " - test2\r\n", "sourceRefName": "refs/heads/mytopic",

Slide 64

Slide 64 text

Incoming WebHook as resource with trigger Additional conditions for dynamic payload evaluation

Slide 65

Slide 65 text

Calculate PR specific variables Delete deployment Delete database Delete Identities

Slide 66

Slide 66 text

No content

Slide 67

Slide 67 text

• • • • IDE MSBuild IntelliSense Validation Code Base Consistency Design Compare CI CD

Slide 68

Slide 68 text

• • • DB Scheme Migrations (Static & Dynamic SQL) Single Pre- and Post Script Logic Microsoft.Data.Tools.Msbuild (NuGet)

Slide 69

Slide 69 text

• • • • •

Slide 70

Slide 70 text

• • • • •

Slide 71

Slide 71 text

Local DEV DB Visual Studio DB Project Git Repo → QA Dump Prod Dump

Slide 72

Slide 72 text

▪ ▪ ▪ ▪ ▪

Slide 73

Slide 73 text

Start Deployment End Deployment GENERATE Deployment Script Run Script Pre-Deployment Script Run Script Post-Deployment Script Scheme Migration Deployment Script (DacPac) Database Deployment Build Process Run Script Reference Data Deployment Script

Slide 74

Slide 74 text

• • • • • • •

Slide 75

Slide 75 text

• • • •

Slide 76

Slide 76 text

Release v2 Deploy DB Schema Deploy Binaries Prod Environment v2 Binaries v1 Prod Environment v2 Binaries v2 Release v2 Deploy Binaries Deploy DB Schema Prod Environment v1 Binaries v1 Binaries v2 Factory Prod Environment v2 Binaries v1 Binaries v2 Factory

Slide 77

Slide 77 text

CD PR CI Checkout Build App Run Unit Test Build Dacpac Publish Dacpac Publish App Create / restore DB Deploy DB Schema Deploy App QA Deploy DB Schema Deploy App Pre-Prod Clone Prod DB Deploy DB Schema Deploy App Prod Deploy DB Schema Deploy App CI Type

Slide 78

Slide 78 text

steps: - pwsh: | /opt/sqlpackage/sqlpackage /a:Publish /p:BlockOnPossibleDataLoss= ${{ parameters.blockOnDataLoss }} /p:GenerateSmartDefaults=True /tcs:"${{ parameters.connection }} /sf:"${{ parameters.dacpacFile }}" displayName: 'Deploy DACPACs' https://docs.microsoft.com/de-de/sql/tools/sqlpackage/sqlpackage-download?view=sql-server-ver16

Slide 79

Slide 79 text

▪ ▪ ▪ ▪

Slide 80

Slide 80 text

▪ ▪ ▪ ▪ ▪ https://hub.docker.com/_/microsoft-mssql-server

Slide 81

Slide 81 text

▪ ▪ ▪

Slide 82

Slide 82 text

▪ ▪ ▪ ▪

Slide 83

Slide 83 text

▪ ▪ ▪ ▪ ▪ ▪

Slide 84

Slide 84 text

No content

Slide 85

Slide 85 text

▪ ▪ ▪ ▪ ▪ ▪ ▪ ▪ ▪

Slide 86

Slide 86 text

✓ ✓ ✓ ✓

Slide 87

Slide 87 text

Infrastructure QA Namespace Fronend Backend PR-xy Namespace Fronend Backend Database Server Prod PR-xy

Slide 88

Slide 88 text

Infrastructure QA Namespace Fronend Backend PR-xy Namespace Fronend Backend Database Server Prod PR-xy

Slide 89

Slide 89 text

Infrastructure QA Namespace Fronend Backend PR-xy Namespace Fronend Database Server Prod Backend PR-xy

Slide 90

Slide 90 text

▪ ▪ ▪ ▪ ▪ ▪ ▪ ▪

Slide 91

Slide 91 text

▪ ▪ ▪ ▪

Slide 92

Slide 92 text

Helm Release Deployment App Pod App Container Init Container Job DB Migration Pod DB Migration Container Service Ingress DB

Slide 93

Slide 93 text

No content

Slide 94

Slide 94 text

▪ ▪ ▪

Slide 95

Slide 95 text

▪ ▪ ▪ Pipeline Agent Docker Container Pipeline Job

Slide 96

Slide 96 text

trigger: - master pool: #vmImage: 'windows-latest' default container: mcr.microsoft.com/dotnet/framework/sdk:4.7.2-windowsservercore-ltsc2019 variables: solution: '**/*.sln' buildPlatform: 'Any CPU' buildConfiguration: 'Release' steps: - task: NuGetToolInstaller@1 - task: NuGetCommand@2 inputs: restoreSolution: '$(solution)' - task: VSBuild@1 inputs: solution: '$(solution)' platform: '$(buildPlatform)' configuration: '$(buildConfiguration)' - task: VSTest@2 inputs: testSelector: 'testAssemblies’ searchFolder: '$(System.DefaultWorkingDirectory)' vstestLocationMethod: 'location' vstestLocation: 'C:\Program Files (x86)\Microsoft Visual Studio\2019\TestAgent\Common7\IDE\CommonExtensions\Microsoft\TestWindow\vstest.console.exe' platform: '$(buildPlatform)' configuration: '$(buildConfiguration)' - publish: $(System.DefaultWorkingDirectory)\ConsoleApp\bin\Release artifact: ConsoleApp

Slide 97

Slide 97 text

▪ ▪ ▪

Slide 98

Slide 98 text

Pipeline Agent Docker Network Container Pipeline Job Build Container Publish Container Container Job Container API App Container SQL Server Deploy DB Run Test Docker Registry

Slide 99

Slide 99 text

Container Resources

Slide 100

Slide 100 text

Matrix → run test in different environments in parallel Dynamic service container selection based on matrix variable

Slide 101

Slide 101 text

DB schema deployment Run integration / system tests

Slide 102

Slide 102 text

Docker network container alias Docker network container alias

Slide 103

Slide 103 text

No content

Slide 104

Slide 104 text

▪ ▪ ▪ ▪

Slide 105

Slide 105 text

No content

Slide 106

Slide 106 text

No content