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.
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.
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.