4 Why is ALM important in a BizTalk context? Business critical solutions.Changes need to be controlled and reversible.Complex solutions from a technical perspective.Complex solutions from a organizational perspective.
5 What can you expect today? Our humble opinions.No silver bullet, there are many ways to skin a cat.Can we reach 80 % with 20 % effort?
6 Packaging and reference management Continuous Integration workflow Fix it!Ok! I’ll get to work!Three days laterStop everything! And fix this.BOOMCode workflowWorkValueIntegration testUnit testAutomated testsPackaging and reference managementContinuous Integration workflow
9 CVCS - Subversion One shared central repository When you check in code, everybody else gets it
10 Problems with CVCS Do you write perfect code the first time? ChangesCommit buggy codeAvoid checking inDo you write perfect code the first time?New code is buggyFear of checking inWhy have version control if you can’t use it?
11 DVCS - Git Every developer has their own private repository Commit whenever you likePush changes to central repository when it’s ready.Separates the act of committing new code from the act of inflicting it on everybody else
12 The dreaded merge Subversion thinks about revisions OK, I have version 1. And now I have version 2. And now I have version 3Git thinks about change setsI had nothing. And then I got these changes. And then I got these other changes.So what is the difference?When it comes to merge Git knows a lot more about what we have done than SubversionFeel free to branch because merge isn’t going to be a nightmareKeeping stable and dev code separate is what source control is all about
13 Git and Visual StudioVisual Studio update 2 required
14 Demo: DVCS Workflow This is what you’ll see A typical code workflow with an ongoing change from one developer (dev 1), while an other developer (dev 2) has to fix a critical bug, in the same solution!
15 Add logic to handle additional costs masterAdd logic to handle additional costsOk! I’ll get to work!CustomerDev1Dev2fix in masterCreates dev1/addadditional-costsMaking change in branch ”dev1/AddAdditionalCost”Critical bug!Merges dev1/additional-costs to masterWe’ll fix it at once!Fix the bug. It’s prioritized!Fixing bug in directly in masterBug fixed and deployed!Great. The Additional cost fix is tested and ready for prodGreat. I’ll make a deployment package!Merge additional cost fix to master for deployment
16 Takeaways: Code workflow A DVCS makes it possible to commit new code with out stepping on everybody's toesIn a DVCS branching and merging actually works …A local repository is powerful once one gets the hang of itGit and DVCSs has a learning curve
20 ”Integration tests” vs. ”Unit tests” in BizTalk Server BizTalk Server EngineReceiveSendIntegration tests in BizTalk requires all artifacts to be installed on the server!RememberHard to pinpoint the error once test fails.Require fully automated installation on build server to work – on each test run!Integration testsDllsTransformationsSchemasOrchestrationsPipelinesOtherUnit tests
21 Demo: Unit test map This is what you’ll see Use BizTalk Servers built-in features to test mapsExpose a few interfaces to interact with the artifact from test toolUse MsTest to execute the tests
23 Problems Lives inside a pipeline Often has a lot of pre-conditions Component1Component2Component3Component4IBaseMessageIPipelineContextComponent to testLives inside a pipelineIBaseMessage and IPipelineContextOften has a lot of pre-conditionsAnnoying build-deploy-test-bounce cycle
24 Demo: Unit test pipeline component This is what you’ll see Utility classes for creating IBaseMessage from XML stringPipeline wrappers to set pipeline contextEnables debugging of component without deploymenthttps://github.com/tomasr/pipelinetesting/blob/master/Winterdom. BizTalk.PipelineTesting.Tests/Simple/PipelineUsageTests.cs
25 Takeaways: Automated testing Keep it simple stupid – unit test takes us far!Enables testing from build server and directly from Visual Studio with minimal effort – without any installation. Quickly becomes important part of development workflow.Test logic and code directly without testing framework codeEasy to isolate tests and logic and pinpoint failing tests
28 Why is there so many dependencies? BizTalk Server solutions typically include artifacts like schemas, maps, pipelines and orchestrations.When it comes to grouping these artifacts into assemblies we want them to be:Small and easy to deployReusable when possibleLogically related When one artifact needs to use another artifact, it is said to be dependent on that artifact.If the artifacts are located in different assemblies, we have an assembly reference.
29 Challenges – a developer’s perspective Assembly references needs to be satisfied before we can buildHopefully the dependencies are properly documentedTrial and errorHow can we share components?Hard to target a specific version of a shared resourceBuild all dependenciesBuild initial projectBuild initial project
30 What if… Only need a binary for all references Publish shared assemblies as part of the build process to a designated deploy areaAutomatically resolving references
32 Is NuGet the solution?NuGet is a package manager for the Microsoft developer platformCan create NuGet-packages from assembliesNuGet packages can be published to a feed serverDevelopers can browse and download NuGet packages in Visual StudioPackages are versionedVisual Studio can automatically resolve and restore references to packagesA NuGet feed can be private or public.Only one problem…
33 Is NuGet the solution? …NuGet does not support btproj projects nuget.codeplex.com/SourceControl/network/forks/robinhultm an/NuGetWithBizTalkProjectExtension/contribution/5960
34 Demo: NuGet packaging of BizTalk artefacts This is what you’ll see How we can package a shared BizTalk Schema in NuGet packageHow we can use the NuGet package to solve a needed dependency on one of our solutionsHow a version updates of dependencies are handled and managed using NuGet
35 Azure Shared EDI Schema Solution Source control server Build server CustomerInvoice SolutionDev1AzureBuild serverSource control serverChange to shared solutionDev2CustomerInvoice SolutionShared EDI Schema Solution
36 Demo: NuGet packaging of BizTalk pipeline components This is what you’ll see How we can package a pipeline component as a NuGet package.How we can use the NuGet package to solve a needed dependency on one of our solutions.
37 Takeaways: Packaging and dependency management Dependency management in BizTalk is a small problems but can be tricky enough on a build server – NuGet offers a nice solution to the problemSharing of pipeline components is important to not reinvent the wheel over and overNuGet has a nice solution to versioning!
38 Questions and comments: Packaging and dependency management
40 What’s Continuous Integration/delivery/deployment really? DevelopersSource control serverBuild serverCompileTestPackageVersion/labelDllsDeployment areaAutomateddeploymentBizTalk Server
41 Why bother using CI etc? Continuous Integration Continuous Delivery All build code is actual check-in code in source control.Code has been build on a machine with no special settings or dependencies – ”it works on my machine”All build are versioned and labeledContinuous DeliveryAll packages are stored in one common area and one can always roll back to previous versionsAlways has ready-to-go packages for new or recovered environmentsContinuous DeploymentCan save a lot of installation time ;)Get small changes out early, no big bang deployment
42 Continuous Integration/delivery/deployment in BizTalk 3. Traditionally we had to install in a server before we could get a deployable package.Sweet spot!2. This is usually tricky in a BizTalk solution …1. Here we want a deployable package
43 Deployment Framework for BizTalk is an option Deploy a complex solution containing orchestrations, schemas, maps, rules, custom components, pipeline components, pipelines -- even ESB itineraries -- in minutes, with no human interventionEliminate ALL manual steps in your BizTalk deploymentsConsolidate all of your environment- specific configuration and runtime settings into one, easy-to-use Excel spreadsheetMaintain a SINGLE binding file that works for all deployment environmentsMake automated deployment a native part of the BizTalk development cycle, then use the same script to deploy to your serversBonus Reason: It's free!PowerShell and MSBuild are fun too!
44 Automated installation Can we reach our “sweet spot” - Continuous Delivery - without installation?Option 1MSIBuild ServerBizTalk ServerCompileDllsAutomated installationExport MSIBTDFBTDF/BTS taskMSIBuild ServerCompileDllsExport MSIBtsMsiTaskOption 2
45 Demo: BtsMsiTask and TFS This is what you’ll see Build a MSI directly from Visual Studio without any installation in BizTalk Server using BtsMsiTask and MSBuildExecute BtsMsiTask as part of a TFS build
46 Bonus demo: BtsMsiTask and TeamCity This is what you’ll see We do as the NuGet team and show you how it’s done in TeamCity
47 Takeaways: Continuous Integration CI is an important pattern to develop and maintain high quality software over time in teamsCI can be hard to do with BizTalk Server but there are tricks that will help you to keep it simple – and still get you a lot of value
49 Final thoughtsAgain, it all our opinions – different solutions for different needs.A workflow and build solution needs to be simple – the actual solution usually gets complicated enough!One can get far using unit tests and simple Continuous Integration and Continuous Delivery.