Your first simple Windows Azure BizTalk Service implementation

Ok, enough of the setting up and configuring already! Let’s go down to business and create your very first, simple, integration in WABS….

What we will do is to create a Bridge (I’ll get back to the term Bridge shortly), that picks up text files from an FTP location and sends them to another location.

Gathering all your credentials to get started

The first then we will do is pick up all the stuff we collected in my first two blogs about WABS, you will need the following:

  • The name of your WABS
  • The WABS ACCESS CONTROL NAMESPACE (Found in the WABS Dashboard)
  • The DEFAULT ISSUER and DEFAULT KEY (Found in the WABS CONNECTION INFORMATION).
  • The SSL Certificate (Can be downloaded from the WABS Dashboard)

Test your credentials from your developing environment

With these things in place, we will now test that everything is working and that all credentials are in place, before we will start working in Visual Studio.

To do that we will use PowerShell.

  1. On your development environment where we installed the WABS SDK, open PowerShell in Administrator mode.
  2. Execute the following command to load the WABS module:

import-module “C:\Program Files\Windows Azure BizTalk Services Tools\Microsoft.BizTalk.Services.Powershell.dll”

The WABS module should now be loaded, take a look at the commands available by executing the following:

get-command -module Microsoft.BizTalk.Services.PowerShell

Now let’s load all of our credentials into variables for re-usability.

$acsns = ‘Your ACS Namepsace
$in = ‘The Issuer Name (most likely owner)’
$ik = ‘The Issuer Key
$du = ‘https://WABSName.biztalk.windows.net/default’

Now try to execute the following command, to get a list of all bridges deployed in your WABS:

Get-AzureBizTalkBridge –AcsNamespace $acsns -IssuerName $in -IssuerKey $ik –DeploymentUri $du

You should now see the following error:

01

what the error is saying is that the HTTPS address it is trying to communicate with is using a certificate that is not trusted (the certificate is not issued by a trusted authority, since it is a default self-signed certificate made when we setup the WABS).

To resolve this issue, we will use the .cer file we exported earlier and store it in the following certificate store (Local Machine / Trusted Root).

In PowerShell execute the following command (replace your file path and name of the certificate if needed):

Import-Certificate -FilePath C:\cert\verticablog.cer -CertStoreLocation Cert:\LocalMachine\root

With this in place, try executing the Get-AzureBizTalkBridge command from above, you should now get no errors (and no bridges, since nothing is deployed yet).

Creating our first bridge.

With all our credentials in place, open Visual Studio and create a new BizTalk Services project (Found under C#, when creating a new project).

For this project, you will need an FTP Server with two folder (In and Out) and a username and password that has sufficient permissions to access, read, write and delete from the folders.

Once created you should see a Toolbox and a Canvas similar to this:

02

Let us create our first FTP Source then. An FTP Source is a source that polls files from an FTP folder and sends them to a bridge (we will talk about bridges in a moment).

  1. From the Toolbox, choose an FTP Source, and drag it onto the Canvas in the left side.
  2. Under properties configure your FTP Source similar to this screenshot (replacing when needed).

03

Now let us create a bridge, that the source can send its documents to.

A bridge is an artifact in WABS, used for routing and transforming messages. A bridge can have multiple sources and multiple destination, but each message passing through a bridge can only be sent to one destination.

  1. From the Toolbox drag a Pass-Through Bridge to the right side of your FTP Source.
  2. Under Bridge Properties change both Entity Name and Relative Address to PassBlogBridge.
  3. From the Toolbox choose the Connector and connect the FTP Source with the left side of the bridge. (It takes a bit of practice to do this, in general you need to catch the red dots on both the source and the target).

04

This bridge will be extremely simple doing nothing but passing the file through to a destination (also FTP). Later on we will look at much more sophisticated bridges and routing mechanisms.

We will now create an FTP destination pointing at our Out folder.

  1. From the Toolbox choose FTP Destination, and drag it to the canvas on the right side of the bridge.
  2. Configure the destination as follows (change when needed):

05

  1. Now connect your bridge with the destination, using the Connector from the Toolbox.
  2. Select the newly created connection and select Filter Condition found under Properties.
  3. Choose Match All and click OK. (This means that all messages received in the bridge will be sent to this particular destination).
  4. Select Route Action and click Add.
  5. Configure the Routing Action as follows (note: this hard codes the file name for the destination file to BlogOutput.txt, and is not a proper approach for anything than this simple demo, since it requires us to delete a file before we can send an additional file).

06

Deploy the solution.

With this in place, we are ready to deploy the bridge and the FTP source to our WABS.

  1. Build your solution to verify that everything can compile.
  2. Click somewhere on your canvas where there are no artifacts, so that the canvas properties appear.
  3. Change the BizTalk Service URL servicename to the name of your WABS.
  4. Right click your project and choose Deploy.
  5. You will now be prompted for the ACS namespace and your Issuer Key (called Shared Secret here).
  6. Type the appropriate values and click deploy (leave the check box unchecked).

If the deployment was successful, you should see a Deploy: 1 succeeded…. in your Output windows.

Starting the Source

Note that when we configured the FTP Source, we set the Initial Status to Stop. We now need to manually start it, to do this we will, again, use PowerShell.

  1. If you closed your PowerShell before, open it again, load the module and set the credential variables.
  2. Verify that your bridge is now deployed:

07

Now type the following to show the Source connected to our Bridge:

Get-AzureBizTalkBridgeSource –AcsNamespace $acsns -IssuerName $in -IssuerKey $ik –DeploymentUri $du -bridgepath PASSBLOGBRIDGE

Notice that the Status is False (means that the source is stopped).

We now need to start it:

Start-AzureBizTalkBridgeSource –AcsNamespace $acsns -IssuerName $in -IssuerKey $ik –DeploymentUri $du –BridgePath PASSBLOGBRIDGE

You should see the following output: All the source in the pipeline………have been started.

Test the solution

With our Source started, all that is left to do is to create a non-empty text file and copy it to your FTP In folder. Within 15 seconds, the files should be removed and a file named BlogOutput.txt should appear in the Out folder.

Note: If the file is not removed, you have likely misspelled something when setting up either your source or destination. You will the need to go to the WABS Portal (Select MANAGE in the Azure Portal, when your WABS is selected), and examine errors in  TRACKING.

Stay tuned for more complex Bridges, mapping and submitting to bridges using REST instead of the need for an FTP Source.

Kategorier: Biztalk, Integration

Tagged as:

6 Comments »

  1. flv format, so it’s very useful to be able to convert them to
    more widely used formats such as. Leave a comment in the
    comments box below letting us know what you think about
    the i – Phone 3GS. Of course, these are but two examples of how videos can
    be used for marketing the products and services of small businesses, it does demonstrate that video marketing
    can be an effective tool even on a local level.

  2. Hi this article is helpful and working fine. but I struck with different scenario where I need to do select operation where source SQL LOB and destination is FTP can you please post an example on this.

    Thank you
    Gowtham

Skriv et svar

Udfyld dine oplysninger nedenfor eller klik på et ikon for at logge ind:

WordPress.com Logo

Du kommenterer med din WordPress.com konto. Log Out / Skift )

Twitter picture

Du kommenterer med din Twitter konto. Log Out / Skift )

Facebook photo

Du kommenterer med din Facebook konto. Log Out / Skift )

Google+ photo

Du kommenterer med din Google+ konto. Log Out / Skift )

Connecting to %s