Working with BAM BizTalk 2013

This space is to describe my experience working with BAM on BizTalk 2013 using SQL Server 2012.

Business Activity Monitoring (BAM) provides real-time business intelligence by capturing data as it flows through a business system. By using BAM, we monitor a business process in real time and generate alerts when the business process needs human intervention.
BAM captures data from business systems, providing real-time monitoring of a business process and makes is available to non-technical users. The main benefits of BAM are

• BAM automates data capture and aggregation.
• Bam provides real-time visibility into business processes.
• BAM can alert users. (though this functionality is not supported in BizTalk 2013 beta using SQL Server 2013 at the moment)
• BAM can capture data asynchronously.

Please follow the below steps to create BAM application.

  1. Include BAM Add-ins in your MS Excel file.

image 2.

If it is not available you can browse it from c:\..\Microsoft BizTalk Server\ExcelDir\Bam.xla.

2. Goto the BAM Add-ins and open Activity.

image

Click on “New Activity” to create new activity.

3. Give a name to the Activity “ABC_Activity”.

image

Add fields which you need to track.

image

You can also create a milestones field which shall be used for aggregation.
4. Click next and you’ll be directed to view creation.

image

5. Click on to Create a new view and provide name “ABC_View” to the view.

image
6. Select Activity, and select all the fields.
7. You can create Dimensions/Measurement (you need milestone field defined in the activity page) for creating aggregates (Pivot Table).
8. XML Export.

  • Add-Ins->BAM and click drop down
  • Select Export XML.
  • Save XML.

9. Bam Deployment.

    • Open command prompt.
    • Navigate to the folder where XML file is stored.
    • set the BM path. path %path% ; c:\Program Files\Microsoft BizTalk Server 20xx\Tracking.
    • Run the below command.
    • Bm deploy-all –DefinitionFile:.xml
    • Browse to the BAM Portal – you’ll see the view on the left panel.
      image

10. AIA BAM Usage:-
Once you have created and deployed the BAM project you can browse to the BAM portal. You’ll notice the view created above appears in the left panel. You can also create your own query.

11. Creating Tracking Profile.

  • Open tracking profile editor.

image

  • Click on “Click here to import a BAM Activity Definition”. This will provide you all the activities which are deployed to BAM database.
  • “Click here to select an event” – using this you can select your tracking fields. It can be message/context property or actual message.
  • You need to select the field and drop it to the field in left panel.
  • For the milestones field the whole orchestration shape needs to be drop e.g. Receive / Send shape.
  • Apply the tracking profile. Tools->Apply tracking profile. You can also remove the tracking profile.

12. Send some messages to BizTalk .

13. Open the BAM Portal and click on the view.

  • select the fields which needs to be included in the report.
  • Click Execute Query. You’ll get the result in the result panel.
  • Subsequently, if you have created Aggregate view, you can see the table once you click the aggregate under aggregations.

image

13. Alert and Schedule. Save the query and you can use this query to  set up an email/file alert notification for specific threshold.

Note-: The BAM Alert do not work with SQL Server 2012 because SQL Server 2012 do not comes with SQL Server Notification Service although it has it own database mail service, but this service do not work with BAM Alerts. You can generate FILE Alerts though.

BAM is a powerful tracking tools, and can be used for all reporting and tracking of all the incoming messages into BizTalk.

http://www.sharptalktech.com

Regards

Working with SFTP Adapter BizTalk 2013

The new BizTalk 2013 release will have its own SFTP adapter to connect to SFTP Servers. This facility was not available in previous version and we need to use the third party SFTP adapter from Codeplex or nSoftware and cost $$. Microsoft had included SFTP adapter in the BizTalk 2013 release. I started using it for one of the client, though it has some limitation but going forward Microsoft might improve and add more features to SFTP Adapter.

Follow the below step to set up SFTP connection.

1- Open BizTalk admin console.
2- Browse to adapters – SFTP – Add receive/send handlers.
Adapter
3- Add one way receive location. Select SFTP adapter from the type drop down.
4- Click on configuration.
5- The configuration window looks like the below.
SFTP
Below is the description for each SFTP adapter property.
1-Others
a- ConnectionLimit – Default set to 5. Maximum number of concurrent SFTP connections that can be opened to SFTP Server. A value of 0 means no limit and connection polling is turned on.
2- Polling.
a-PollingInterval – 0 – specify the poll interval.
b-Unit – Seconds. Indicates the Unit Of Time of the poll interval.
This mean the adapter will poll the SFTP server at 0 seconds. You can limit the adapter polling by increasing the polling interval or changing the unit to Minutes/Hours/days.
3-Security.
a-AcceptAnySSHServerHostKey – “False/True”. Determines if any SSH public host key fingerprint from the server should have accepted.
b-ClientAuthenticationMode – Password/PublicKeyAuthentication. The Authentication method to be used for authenticating the client to the SSH Server. You can set either Password or Public key authentication.
c- Password – Specify the password for SFTP Server. This is required if you Password authentication is selected. (It can also be required when PublicKeyAuthentication is selected).
d-PrivateKey – Specify the private key of the user. Add the full path of the private key only when PublicKeyAuthentication is selected.
e-PrivateKeyPassword – Specify the password if the user’s private key is password protected. Add password for private key only when PublicKeyAuthentication is selected.
f-SSHServerHostKeyFingerPrint- Specify the fingerprint of the public host key for the SSH Server. Add the SSHServer Host Key FingerPrint generated while creating a private key, only when AcceptAnySSHServerHostKey is set to false.
g- UserName – Specify the user name to log into the SFTP Server.
4-SSH Server
a- FileMask – The file type to use when retrieving files.
b- FolderPath – Specify the folder on the SFTP server where the files get uploaded.
c- Port – 22 – Specify the port number for this SFTP Server.
d- ServerAddress – Specify the machine name or IP address of the SFTP Server.

I’m glad to use the SFTP adapter without worrying about the extra $$ and extra installation on the BizTalk server. There is known issue with the BizTalk 2013 out of box SFTP adapter. Please refer to the below post http://thoughtsofmarcus.blogspot.co.nz/2013/06/leaving-password-blank-in-biztalk-2013.html