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.



Figure 1. Microsoft Azure Portal Settings.

The request will be as follows:
  • https://management.core.windows.net/{subscription-id}/cloudservices



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

The response will look like:



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:
  • https://management.core.windows.net/subscription-id/cloudservices/CloudServiceName/resources/biztalkservices/~/biztalk/resource-name/properties



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

The response might look like:



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:
  • https://management.core.windows.net/{subscription-id}/cloudservices/{cloud-service-name}/resources/biztalkservices/biztalk/{resource-name}



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

The response might look like:



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.



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.