by Sandro Pereira | Apr 26, 2022 | BizTalk Community Blogs via Syndication
Historically, deploying BizTalk Server solutions across environments is or can be a complicated process depending on how complex is your solution. There are many ways to deploy BizTalk artifacts for example:
- Importing them as part of an application by using the Deployment Wizard (from a .msi file), importing them using BTSTask.exe – this is the default way to deploy across environments.
- You can replace and use allow BTSTask, and PowerShell scripts.
- Or deploy them from Visual Studio – this is the default way to deploy to your development environment.
Throughout the years, the BizTalk Server Community created an open-source deployment framework called Deployment Framework for BizTalk (BTDF) – https://github.com/BTDF/DeploymentFramework. The Deployment Framework for BizTalk is an easy-to-use toolkit for deploying and configuring your BizTalk solutions. In reality, BTDF is an MSBuild project with custom MSBuild tasks and it can be customizable according to customer BizTalk project needs, it is also extensible. This framework brings new capabilities and advantages to deploying BizTalk Server solutions, but it also has limitations or disadvantages.
Microsoft has introduced automated deployment of BizTalk Applications in BizTalk Server 2016 Feature Packs using Azure DevOps (previously called Visual Studio Team Services – VSTS). In BizTalk Server 2016 Feature Pack 1, automatic deployment and application lifecycle management (ALM) experience was introduced. The automatic deployment process has been improved with the release of BizTalk Server 2016 Feature Pack 2. These features were only available on the Enterprise edition of BizTalk Server 2016.
BizTalk Server 2020 brings all these functionalities out-of-the-box across all editions: Enterprise, Standard, Development, or Branch.
To accomplish this, we need basically 3 main steps:
- BizTalk Server: Add a BizTalk Server Application project to your Visual Studio solution.
- DevOps: Create a build agent.
- DevOps: Create a Build and release Azure Pipeline.
This whitepaper will address and explain how you can implement CI/CD oriented to BizTalk Server using Azure DevOps Pipelines.
In this whitepaper, Pedro Almeida and I will provide a detailed introduction to CI/CD. It teaches how to Create a project collection. Learn how to prepare the visual studio for projects end to end. A well-defined pipeline. Helps you understand how to save development time by thinking long-term since it is a low-cost, high-return scenario.
What’s in store for you?
This whitepaper will give you a detailed understanding of the following:
- An introduction to:
- What is a CI/CD Pipeline?
- What are CI/CD Pipelines?
- What is Azure DevOps?
- Create an organization or project collection in Azure DevOps
- Create a project in Azure DevOps
- Preparing your Visual Studio BizTalk Server project for CI/CD
- Creating a BizTalk Server Deployment Project
- Add the application project
- Making your Bindings dynamic for deployment
- Configure the BizTalkServerInventory JSON template
- Publish your code
- Create a Personal Access Token
- Building your Azure Pipeline
- Building the Pipeline
- Building the Release Pipeline
- Defining the Variables
- Using SSO Application Configuration with CI/CD
Where I can download it
You can download the whitepaper here:
I hope you enjoy reading this paper and any comments or suggestions are welcome.
by stephen-w-thomas | May 22, 2020 | BizTalk Community Blogs via Syndication
Author Credits: Martin Peters, Senior Consultant at Codit
During deployments of BizTalk application, it is common practice to put BizTalk360 in maintenance mode before the deployment and switch to normal mode again after the deployment.
This avoids alerts being sent to various people due to stopping and starting of BizTalk during the deployment. If you are using Azure DevOps to deploy BizTalk applications automatically, you do not want to have a manual process to put BizTalk360 in and out of maintenance mode.
The good news is that BizTalk360 provides a set of APIs which allow you to automate this.
An article from Senthil Palanisamy named BizTalk Application Deployment Using Azure Pipeline with BizTalk360 API’s inspired me to implement this for a customer. In Senthil’s blog, Powershell scripts are used to access the BizTalk360 APIs and turn the maintenance mode off and on. But, as more and more customers are using Azure DevOps and BizTalk360, you need a copy of the PowerShell scripts. The PowerShell scripts might change over time (changes, bug fixing), so the next step is to put the PowerShell scripts under version control and create a DevOps extension.
The DevOps extension is maintained on GitHub, and compatible changes are automatically distributed to all organizations using this extension.
Single Server Scenario
When your Test, Acceptance, and Production environment consist of a single server, you can create a task group and use this in the release pipeline. Note that in this example, the task group uses the BTDF extension, which is useful if you are using the BizTalk Deployment Framework for deployments.
The BizTalk360 tasks require the hostname of the server where BizTalk360 is installed and the Environment ID. You can find the Environment ID in http://<yourbiztalk360server>/BizTalk360/Settings#api.
Note: You must have a license to use the BizTalk360 API.
If you do not have a license, please contact your BizTalk360 representative. The BizTalk360 API offers an extensive API that allows you to automate other tasks as well.
Multi-Server Scenario
In a multi-server scenario, you want to put BizTalk360 in maintenance mode before deployment to the first server and out of maintenance mode after deployment to the last server. This case, your release pipeline might look like;
You can find the DevOps extension on the VisualStudio Marketplace.
The source code is available on GitHub. Please feel free to make any improvements, enhancements, etc.
The post BizTalk360 Maintenance Mode with BizTalk Deployments via Azure DevOps appeared first on BizTalk360.
by Senthil Kumar Palanisamy | Nov 21, 2018 | BizTalk Community Blogs via Syndication
Introduction
The process of BizTalk Application deployment is a complex, time consuming and repetitive task. Microsoft BizTalk Server comes with capabilities to create deployment packages. However, the MSI packages you create with the out-of-the-box features of BizTalk Server have some shortcomings which lead to deployments which are error-prone.
BizTalk Deployment Framework
The BizTalk Deployment Framework (BTDF) covered these deployment issue.
- Deploy complex BizTalk solutions containing BizTalk artifacts but also for example SSO settings, ESB itineraries and SQL Server scripts, with no human intervention
- Consolidate all environment-specific configuration and runtime settings into one, easy-to-use Excel spreadsheet
Maintain a single binding file that works for all deployment environments
- Make automated deployment a native part of the BizTalk development cycle, then use the same script to deploy to BizTalk servers
To eliminate the manual process, organization’s start to adopt the DevOps practice. In this article, we will see how the BizTalk360 API’s are helpful in a BizTalk environment monitoring while deploying BizTalk Applications using Azure CI/CD Pipelines.
Deploy BizTalk Applications with Azure Pipelines
Microsoft has introduced automated deployment of BizTalk Applications in BizTalk Server 2016 Feature Packs. In BizTalk Server 2016 Feature Pack 1, automatic deployment and application lifecycle management (ALM) experience was introduced. Automatic deployment process has been improved with the release of BizTalk Server 2016 Feature Pack 2.
- Within Visual Studio for each project, set the Application Name of your BizTalk application
- In addition to using an agent-based deployment, you can also use deployment groups to deploy your BizTalk applications to multiple servers
- In the release task, you can install the BizTalk application, and enter the BizTalk management computer, and the path to the deployment package
Azure Pipelines (CICD)
With Automated build/release definitions you can set up the CI or CICD Pipelines based on environment (Development/QA/Staging/Production):
- Continuous Integration (CI) : Set up build task definitions rules to the VSTS Source code base
- Continuous Integration Continuous Deployment (CICD) : Configure both build task definition and release task definition to automate the build and test process
If you are new to Azure CI/CD Pipeline go through this article Configure automatic deployment with Visual Studio Team Services in BizTalk Server
Deployment Build Definitions
In the BizTalk Application deployment process, you can create the following build/release definitions:
- Visual Studio Build
The build and release definitions are Visual Studio Team Services tasks, and should be done by a VSTS admin. The build definition builds your project within your git or VSTS repository, and the release definitions deploys it to your BizTalk Server environment
- Publish Build Artifacts
In Publish Build Artifacts stage configure the Path to publish (Application Project Folder)
- Deploy BizTalk Server Application
A BizTalk Server application deployment build definition operation has three options available
- Create new BizTalk Application: Deploys a new application, if the application already exists, it uninstalls the current applications (full stop), and installs the new application. If continuous integration is enabled, it automatically redeploys the application when it is updated in the repository
- Update an existing BizTalk Application: Appends changes, such as schemas, to an already running application. It does not require a full redeploy of the application
- Install BizTalk Server Application: Install the application, enter the BizTalk management computer name and the deployment package path
BizTalk360 API’s in CI/CD
Customer Scenario: In Build pipeline stages the customer wants to utilize the BizTalk360 API to set the Stop Alert for Maintenance in a BizTalk environment. Once after the new build is deployed to BizTalk Server and then user wants to configure newly deployed artifacts to monitor in BizTalk360. As the last step revoke the Stop Alerts in BizTalk360 Application.
We can use the following steps in Build definitions to achieve the above scenario;
- Visual Studio Build (explained above)
- Set Stop Alert for Maintenance
BizTalk360 customers can take advantage of using the BizTalk360 API’s to set the alert maintenance during the BizTalk Application deployment.
Create the PowerShell Script stage to call the SetAlertMaintenance API method to set the BizTalk environment under the maintenance. Assign the PowerShell Script full path
SetAlertMaintenance.ps1
$Request = '{
"context": {
"callerReference": "SAMPLE_REFERENCE",
"environmentSettings": {
"id": "DC45E848-E485-41D7-92E5-7C9932D43CB8"
}
},
"alertMaintenance": {
"comment": "BizTalk Deploy",
"maintenanceStartTime": "2018-11-22T15:26:37.000",
"maintenanceTimeUnit": 0,
"maintenanceTimeLength": 2,
"isActive": false,
"expiryDateTime": ""
}
}'
$Request
$body = ConvertFrom-Json -InputObject $Request
$body
$RepsonseSet = Invoke-RestMethod -Uri http://biztalk360webserver/Services.REST/AlertService.svc/SetAlertMaintenance -Method Post -ContentType "application/json" -Body $body -UseDefaultCredentials
$RepsonseSet
Set Alert Maintenance API returns the alert maintenance object with maintenance Id (out parameter). You can refer this maintenance Id, when revoking the maintenance in the below step.
- Publish Build Artifacts (explained Above)
- Deploy BizTalk Server Application
Once after BizTalk Application deployment is completed, next step you can configure the newly artifacts to monitor. For creating BizTalk360 alarms and BizTalk Application mappings during deployments with BTDF, you could consider to BT360Deploy command-line tool. Use this GitHub project to setup pipeline stage.
- Remove the Stop alert for Maintenance
After the deployment of BizTalk Applications, the maintenance mode of BizTalk environment must be revoked in BizTalk360. To achieve this step, create a PowerShell Script stage and assign the PowerShell Script path(RemoveMaintenance.ps1)
$RequestRem = '{"context":{"callerReference":"SAMPLE_REFERENCE","environmentSettings":{"id":"DC45E848-E485-41D7-92E5-7C9932D43CB8"}},"maintenanceId":"308d8b2c-b3e0-4024-b600-845113b06b80"}'
Invoke-RestMethod -Uri http://biztalk360webserver/BizTalk360/Services.REST/AlertService.svc/RemoveAlertMaintenance -Method Post -ContentType "application/json" -Body $RequestRem -UseDefaultCredentials
Summary
Automation of Build and/or Deployment will be helpful to reduce the turnaround time. Hopefully, this article has provided insight in how you can setup the BizTalk Application Deployment automation and how you can utilize BizTalk360 API’s to stop alert during deployment and how to set up monitoring of the newly deployed BizTalk Artifacts.
Get started with the free 30 days trial. For any queries/feedback please write to us [email protected].
Author: Senthil Kumar Palanisamy
Senthil Kumar Palanisamy is the Technical Lead at BizTalk360 having 14 years of experience in Microsoft Technologies. Worked various products across domains like Health Care, Energy and Retail. View all posts by Senthil Kumar Palanisamy