BizTalk Application Deployment

download BizTalk Application Deployment

of 41

  • date post

    12-Nov-2014
  • Category

    Technology

  • view

    2.941
  • download

    8

Embed Size (px)

description

Managing the migration and elevation of your BizTalk applications

Transcript of BizTalk Application Deployment

  • 1. BizTalk DeploymentManaging Migration of Your BizTalk AppsDaniel Toomeypresenter

2. Scope Not about BizTalk Server product/platforminstallation BizTalk Application/Solution deployment BizTalk Server 2006+ only Key concepts & principles Out-of-the-Box tools only 3. BizTalk Deployment Artefacts Assemblies: BizTalk Assemblies (maps, schemas, orchestrations, pipelines) .NET Helper Assemblies Physical Bindings (send/receive ports) Runtime Components: Hosts / Host Instances Handlers Database Scripts Rules & Policies Configuration Files COM Components BAM definitions BAS Artefacts (partner profiles, templates, etc) Security Certificates Virtual Directories Custom / Third-Party Adapters 4. BizTalk Applications Introduced in BizTalk Server 2006 Logical container for a collection of relatedsolution artefacts Facilitates application level: Deployment (export MSI) Start / Stop Resource management Dependencies DEFAULT: BizTalk Application 1 5. BizTalk Applications 6. Binding Files Describe BTS artefacts stored in the BizTalkMgmt Database and their relationships Exportable / Importable from BizTalk Groupor Application Represented in XML How to validate binding schema:xsd.exe "C:Program FilesMicrosoft BizTalk Server2006Microsoft.BizTalk.Deployment.dll" /type:BindingInfo Sample binding file:C:Program FilesMicrosoft BizTalk Server 2006SDKSamplesApplicationDeploymentCreateAppBindingsCreateApplicationSampleBindings.xml 7. Binding File Structure ModuleRefCollection: Declares all the BizTalk assemblies andorchestrations used within the application. It also specifieswhich physical ports are used for each orchestration. SendPortCollection: Contains all the information necessary tocreate or update all the send ports. DistributionListCollection: Contains all the informationnecessary to create or update all the distribution lists (send portgroups). ReceivePortCollection: Contains all the information necessaryto create or update all the receive ports and receive locations. PartyCollection: Contains all the information necessary tocreate or update all the parties. 8. Importing Binding Files Binding Files will create: Send Ports Receive Ports Receive Locations Parties Binding Files will not create: Host Definitions Host Instances Directory Structures Passwords for credentials 9. Processing Scripts Can be bundled within an MSI file Automatically run when importing, installing, oruninstalling a BizTalk application Two types: Pre-processing (run at beginning of import/installationprocess) Post-processing (run at end of import/installationprocess) Multiple script types supported:.bat, .cmd., .com, .exe, .vbs, .vbe, .js, .wsh, .wsf Any action that can be done in a script can beexecuted within the exported MSI* *excluding certain BTSTask commands during application import 10. Processing Scripts Ideal tasks for a processing script:Create directory structureAdd assemblies to the GACRegister COM componentsCreate/populate a databaseInstall a config file Sample scripts: C:Program FilesMicrosoft BizTalk Server 2006 SDKSamplesApplicationDeploymentTemplate 11. Processing Scripts Use environment variables to control execution:%BTAD_InstallMode%CreateUpdate Delete%BTAD_ChangeRequestAction%ImportInstallUninstall Example:REM ### Create directories prior to BizTalk assembly deploymentif "%BTAD_InstallMode%"=="Install" AND "%BTAD_ChangeRequestAction%"=="Update( REM ### Create the folders which will drop messages mkdir %BTAD_InstallDir%TestDocumentsIn mkdir %BTAD_InstallDir%TestDocumentsOut) 12. Environment VariablesDeployment BTAD_ChangeRequestAction BTAD_InstallMode BTAD_HostClassStates Values Values ValuesImport without CreateImport ConfigurationDboverwrite flagImport withUpdate Import ConfigurationDboverwrite flagInstall Update InstallBizTalk Host InstanceUninstallDelete Uninstall BizTalk Host InstanceImport DeleteImport ConfigurationDbRollbackInstall DeleteInstallBizTalk Host InstanceRollback 13. Import vs. Install STEP ONE: Import Import application to BizTalk Group Registers components in BizTalkMgmtDb Covers all BizTalk servers in group STEP TWO: Install Must be performed on each machine in theBizTalk Group Installs physical copies of registeredcomponents GAC, COM, Certificates, Virtual Directories 14. Typical Manual Install Steps Create an application Add references (optional) Add assemblies Create Receive Ports Create Receive Locations Create Send Ports Configure application Start application 15. Typical Deployment Cycle SOURCE SERVER: Deploy solution from Visual Studio Configure the BizTalk application Export bindings Add artefacts to the application Export application to MSI file TARGET SERVER: Import the MSI file Install the MSI file Start the application and test it 16. Visual Studio Deployment Steps In Visual Studio 2005: In Project Properties, specific BizTalk Application name Choose Deploy from Solution file In BizTalk Admin Console: Create Receive Ports Create Receive Locations Create Send Ports Configure application (bindings) Start application Re-deployment from VS usually maintainsconfiguration, assuming same version number 17. Exporting a BizTalk Application Export the Bindings From BizTalk Admin Console Right-click app choose Export Bindings Save multiple copies Edit each copy in an XML editor (environmentspecific settings) Binding files can be added to application asresources (next slide) Copies can be given a target environmentlabel (e.g. TEST, PROD) 18. Exporting a BizTalk Application Add resource files From BizTalk Admin Console Right-click app choose Add Resources Choose resource type: Assembly (BizTalk or .NET helper) Binding (can specify target environment) Pre/Post-Processing Script BAM File COM (can choose to register) Overwrite all replaces version in GAC 19. Exporting a BizTalk Application Export the MSI From BizTalk Admin Console Right-click app choose Export MSI file Step through the wizard Choose/Specify: Resources (assemblies, bindings) IIS Hosts Dependencies (specified for you) Destination 20. Importing/Installing a BizTalkApplication Import the MSI From BizTalk Admin Console Right-click app choose Import MSI file Step through the wizard Choose/Specify: Application name Overwrite resources Environment (for binding files) Adds references/component/binding files to BizTalk Management DB Only need to do this once for BizTalk Group 21. Importing/Installing a BizTalkApplication Install the MSI Double-click the MSI file itself (Windows Explorer) Step through the wizard Choose/Specify: Application name Overwrite resources Environment (for binding files) Adds physical components to current machine Need to do this on each server in the BizTalk Group 22. Command Line Import/Install Import:BTSTask ImportApp /Package:C:SampleApp.msi/Environment:TEST/ApplicationName:SampleAppName" /Overwrite Install:msiexec /i C:SampleApp.msi" /passive /logC:SampleApp.log 23. Whats Missing?? Creating hosts / host instances Modifying host / host instance properties Starting / Stopping host instances Creating send/receive handlers Adding Message Boxes Modifying Message Box properties The Answer?? ExplorerOM WMI BTSTask 24. ExplorerOM BizTalk Explorer Object Model Set of .NET classes/interfaces providing APIto the BizTalk Management Database Add reference:[BizTalk Installation directory]Developer ToolsMicrosoft.Biztalk.ExplorerOM.dll Three container classes: BtsCalalogExplorer BtsApplication Assembly 25. What Can You Do With ExplorerOM? Create / modify / delete Applications Browse orchestration artefacts Bind / enlist / start orchestrations Stop / unenlist / unbind orchestrations Add / enlist / start send & receive ports Stop / unenlist / delete send & receive ports Add / remove maps for inbound / outboundtransformations Enable / disable receive locations Add / delete parties 26. BtsCatalogExplorer Class Fundamental class: provides access to theBizTalk Management Database All BizTalk artefacts within a group areaccessible once this class is instantiated Must set the ConnectionString property onthe instance 27. Enumerate Send Ports Sampleusing System;using System.Text;using Microsoft.BizTalk.ExplorerOM;namespace SendPorts{ class Program {static void Main(string[] args){ EnumerateSendPorts(); Console.ReadKey();}public static void EnumerateSendPorts(){ BtsCatalogExplorer catalog = new BtsCatalogExplorer(); catalog.ConnectionString ="Server=.;Initial Catalog=BizTalkMgmtDb;Integrated Security=SSPI;"; foreach (SendPort sendPort in catalog.SendPorts ) { Console.WriteLine("tPortName:{0},Status:{1}", sendPort.Name ,sendPort.Status); }} }} 28. BtsCatalogExplorer MethodsMethod Name DescriptionAddNewApplication*Creates and adds a new Application object to the Application collection.RemoveApplication*Removes the specified application from Application collection.AddNewParty Creates and adds a new Party object to the Parties collection.RemoveParty Removes the specified party from the Parties collection.AddNewReceivePort Creates and adds a new ReceivePort object to the ReceivePorts collection.RemoveReceivePort Removes the specified receive port from the ReceivePorts collection.AddNewSendPortCreates and adds a new SendPort object to the SendPorts collection.RemoveSendPortRemoves the specified send port from the SendPorts collection.AddNewSendPortGroup Creates and adds a new SendPortGroup object to the SendPortGroupsRemoveSendPortGroup Removes the specified send port group.SaveChanges Commits all BtsCatalogExplorer object changes to the Management Database.DiscardChangesDiscards all BtsCatalogExplorer object changes.*Specific to BizTalk Server 2006. 29. Application Class Similar to BtsCatalogExplorer class, butspecific to an application Allows you to start, stop applications Allows you to add & remove references toother applications Requires reference to an instance 30. ApplicationStartOption EnumerationApplicatio