Share via


Managing Azure BizTalk Services with REST API

Introduction

Azure BizTalk Services (formerly called Windows Azure BizTalk Services or WABS) is one of the newest services available within Microsoft Azure. The service became general available end of November. BizTalk Services offers integration and B2B capabilities in the cloud. Both can be viewed as a Platform as a Service (PaaS) of BizTalk. A developer has the ability to:

  • Create within Visual Studio an integration solution (bridges) and deploy it to the BizTalk Service in Microsoft Azure.
  • And/or create a  B2B solution that consists of a set of trading partners and agreements that process EDI messages (bridges) in the cloud. The trading partner and agreement configuration are done through the BizTalk Service Portal.

The BizTalk Service in Microsoft Azure can be managed through a REST API. The API provides programmatic access to much of the functionality available through the Management Portal. With the REST API for managing BizTalk Services you can perform the following operations:

  • Register BizTalk Service
  • Create or Update a BizTalk Service
  • Get Cloud Service
  • Get Cloud Services
  • Get BizTalk Service Properties
  • Suspend BizTalk Service
  • Resume BizTalk Service
  • Restart BizTalk Service
  • Poll on an Async Operation on BizTalk Service
  • Sync Access Control Keys
  • Delete BizTalk Service
  • Backup BizTalk Service
  • Restore Azure BizTalk Service from Backup

This Wiki article will discuss how you can leverage the REST API to manage BizTalk Service by means of a windows form application.

Security

To send request messages through the operations of the API you will need to have authentication in place. The REST API like the Microsoft Azure Service Management API uses mutual authentication of management certificates over SSL to ensure that a request made to the service is secure. Note that anonymous requests to the API are not allowed. Therefor requests made to the REST API for managing WABS requires that a management certificate is associated with your subscription. This certificate can be self-signed using the makecert command line tool or a commercial one obtained through VeriSign or Go Daddy. See the MSDN article Create and Upload a Management Certificate for Microsoft Azure.

REST API for BizTalk Services

The REST API for BizTalk Services is documented on MSDN. Each operation mentioned in the introduction is documented. The Request URI, URI Parameters, Request Header, Request Message, Request Elements, Response, Status Code, Response Header, and Response Body of each operation is described.

A common operation to perform before any other operation is the Get Cloud Services. This general operation will provide you with the details of your BizTalk Service(s). The Get Cloud Services will get all BizTalk Services within all cloud services. With the data provided by these operations you can perform any other operations as it will provide you with a common piece information the cloud-service-name. This is the unique name for the cloud service that hosts your BizTalk Service.

Get Cloud Services operation

To perform the Get Cloud Services operation from the REST API in a Windows Form you need to provide the subscription id, which is your Azure subscription ID. You can find this id by going to the settings page of your Windows Azure Portal.

http://i208.photobucket.com/albums/bb152/Steef-Jan/WABS/SubscriptionID_zps2d8331ea.png

Figure 1. Microsoft Azure Portal Settings.

The request will be as follows:*
*

http://i208.photobucket.com/albums/bb152/Steef-Jan/WABS/62a83fc0-30b2-4063-8298-48cb7aa9286a_zps1c9170f4.png

Figure 2. Send Request to REST API operation Get Cloud Services.

The response will look like:

http://i208.photobucket.com/albums/bb152/Steef-Jan/WABS/7cb446b8-59be-4493-b8ef-11f664f3ee3d_zps87d090a7.png

Figure 3. Response message Get Cloud Services.

As you see the response provides a list of resources i.e. BizTalk Services and its details like State, Edition, and tracking details.

Get BizTalk Service Properties

Sending a request to the Get BizTalk Service Properties operation will provide you the properties of a specific Azure BizTalk Service. You specify in your request the subscription id of your Azure Account, Cloud Service Name (which can be obtained through the Get Cloud Services operation) and the resource name (name of one of your BizTalk Service(s)).

The request will have the following format:

http://i208.photobucket.com/albums/bb152/Steef-Jan/WABS/74e98051-aaea-4a95-88c8-42b326e294d0_zpsb0271486.png

Figure 4. Send Request to REST API operation Get BizTalk Service Properties.

The response might look like:

http://i208.photobucket.com/albums/bb152/Steef-Jan/WABS/0c85cb30-3c52-452a-b415-970413079e87_zps29adcd9d.png

Figure 5. Response with properties of the request BizTalk Service.

You see all the details of the request BizTalk Service in the response message.

Delete BizTalk Service

Sending a request to the Delete BizTalk Service operation will result in the deletion of the BizTalk Service. You specify in your request the subscription id of your Azure Account, Cloud Service Name (which can be obtained through the Get Cloud Services operation) and the resource name (name of one of your BizTalk Service(s)).

The request will have the following format:

http://i208.photobucket.com/albums/bb152/Steef-Jan/867b274e-1442-43ee-b71b-4d5d62da0db9_zps92b69334.png

Figure 6. Send Request to REST API operation Delete BizTalk Service.

The response might look like:

http://i208.photobucket.com/albums/bb152/Steef-Jan/3d95b6b0-200e-4a6a-b61d-212c08e5d1c1_zps099626a0.png

Figure 7. Response from Delete BizTalk Service.

The status code is 202, which means the operation was successful. You can call to check the asynchronous result through GET operation with URL provided Request URI.

http://i208.photobucket.com/albums/bb152/Steef-Jan/StatusDelete_zpsd3a3b41d.png

Figure 8. Async status call and response.

If you check within the Microsoft Azure Portal under BizTalk Services you will see that the specified BizTalk Service is no longer present.

Wrap up

This article demonstrated how you can leverage the REST API to manage the BizTalk Services. As an example a windows form application implements a few of the REST API operations for WABS. Three operations were discussed yet you can implement any of the other operations in a similar way using .NET code.

There are different ways you can leverage the API other than using a Windows Form Application. You could choose to use ASP.NET or a Mobile application. The REST API for BizTalk Service is created by Microsoft to enable you to perform various operations on the BizTalk Services. Microsoft offers various other REST API’s to manage other services offered in Microsoft Azure.

See Also

Another important place to find a huge amount of Azure BizTalk Services related articles is the TechNet Wiki itself. The best entry point is Azure BizTalk Services resources on the TechNet Wiki.

If you are also looking for BizTalk Server related articles, the best entry point is BizTalk Server Resources on the TechNet Wiki.

The code of the Azure BizTalk Services Manager can be obtained from MSDN Code Gallery: Windows Azure BizTalk Services Manager.