BAM Activity in Custom Pipeline

Sometimes requirement cannot be fulfil by using tracking profile editor for BAM logging. Here in this code I am explaining about how to use BAM in custom pipeline. And also I am using EnableContinuation method so that we can get all the details in single row in BAM table while using different stage of BAM tracking in BizTalk application. When a solution needs BAM, and you what to link the receivedTime and sendTime together you have to use continuation.

Code for BAM Activity in Custom Pipeline:

Begin BAM Activity

This custom pipeline component can be put after xml or flat dissembler pipeline component in Receive Pipeline, because we are consuming MessageType context property to log into BAM.

For creating BAM Definition Activity please click here

https://vkbiztalk.com/2017/06/14/implementation-of-bam-activity-definition-file/

 

using System;

using System.IO;

using System.Text;

using System.Drawing;

using System.Resources;

using System.Reflection;

using System.Diagnostics;

using System.Collections;

using System.ComponentModel;

using Microsoft.BizTalk.Message.Interop;

using Microsoft.BizTalk.Component.Interop;

using Microsoft.BizTalk.Component;

using Microsoft.BizTalk.Messaging;

using System.IO;

using System.Xml;

using Microsoft.BizTalk.Bam.EventObservation;

namespace BeginBAMPipeline

{

[ComponentCategory(CategoryTypes.CATID_PipelineComponent)]

[ComponentCategory(CategoryTypes.CATID_Any)]

[System.Runtime.InteropServices.Guid(“3BB6433B-CF8D-456B-AA78-70D6788C8574”)]

public class BeginBAMPipelineComponent : IBaseComponent, IComponentUI, Microsoft.BizTalk.Component.Interop.IComponent, IPersistPropertyBag

{

#region Configuration Properties

private string _BAMActivityName;

private bool _IsTrackingRequire;

public string BAMActivityName

{

get

{

return _BAMActivityName;

}

set

{

_BAMActivityName = value;

}

}

 

public bool IsTrackingRequire

{

get

{

return _IsTrackingRequire;

}

set

{

_IsTrackingRequire = value;

}

}

 

#endregion

public string Description

{

get

{

return “Pipeline component For Begin BAM Activity”;

}

}

 

public string Name

{

get

{

return “BeginBAMPipelineComponent”;

}

}

public string Version

{

get

{

return “1.0.0.0”;

}

}

public IntPtr Icon

{

get

{

return new System.IntPtr();

}

}

public System.Collections.IEnumerator Validate(object projectSystem)

{

return null;

}

public void GetClassID(out Guid classID)

{

classID = new Guid(“3BB6433B-CF8D-456B-AA78-70D6788C8574”);

}

public void InitNew()

{

}

public virtual void Load(Microsoft.BizTalk.Component.Interop.IPropertyBag pb, int errlog)

{

object val = null;

val = this.ReadPropertyBag(pb, “BAMActivityName”);

if ((val != null))

{

this._BAMActivityName = ((string)(val));

}

val = this.ReadPropertyBag(pb, “IsTrackingRequire”);

if ((val != null))

{

this._IsTrackingRequire = ((bool)(val));

}

}

public virtual void Save(Microsoft.BizTalk.Component.Interop.IPropertyBag pb, bool fClearDirty, bool fSaveAllProperties)

{

this.WritePropertyBag(pb, “BAMActivityName”, this.BAMActivityName);

this.WritePropertyBag(pb, “IsTrackingRequire”, this.IsTrackingRequire);

}

#region utility functionality

/// <summary>

/// Reads property value from property bag

/// </summary>

/// <param name=”pb”>Property bag</param>

/// <param name=”propName”>Name of property</param>

/// <returns>Value of the property</returns>

private object ReadPropertyBag(Microsoft.BizTalk.Component.Interop.IPropertyBag pb, string propName)

{

object val = null;

try

{

pb.Read(propName, out val, 0);

}

catch (System.ArgumentException)

{

return val;

}

catch (System.Exception e)

{

throw new System.ApplicationException(e.Message);

}

return val;

}

 

/// <summary>

/// Writes property values into a property bag.

/// </summary>

/// <param name=”pb”>Property bag.</param>

/// <param name=”propName”>Name of property.</param>

/// <param name=”val”>Value of property.</param>

private void WritePropertyBag(Microsoft.BizTalk.Component.Interop.IPropertyBag pb, string propName, object val)

{

try

{

pb.Write(propName, ref val);

}

catch (System.Exception e)

{

throw new System.ApplicationException(e.Message);

}

}

#endregion

public IBaseMessage Execute(IPipelineContext pContext, IBaseMessage pInMsg)

{

IBaseMessagePart bodyPart = pInMsg.BodyPart;

StringBuilder outputMessageText = null;

XmlDocument xDoc = new XmlDocument();

 

string systemPropertiesNamespace = @”http://schemas.microsoft.com/BizTalk/2003/system-properties&#8221;;

//string messageType = “”;

if (bodyPart != null)

{

if (IsTrackingRequire)

{

Stream originalStream = bodyPart.GetOriginalDataStream();

 

if (originalStream != null)

{

string ActivityName = BAMActivityName;

string messageType = Convert.ToString(pInMsg.Context.Read(“MessageType”, systemPropertiesNamespace));

 

EventStream BAMes;

 

BAMes = pContext.GetEventStream();

 

string ActivityID = Guid.NewGuid().ToString();

string corelationToken = (string)pInMsg.Context.Read(“InterchangeID”, “http://schemas.microsoft.com/BizTalk/2003/system-properties&#8221;);

 

System.Diagnostics.EventLog.WriteEntry(“InterchangeIDStart”, corelationToken);

BAMes.BeginActivity(ActivityName, ActivityID);

BAMes.UpdateActivity(ActivityName, ActivityID, “MessageType”, messageType);

BAMes.UpdateActivity(ActivityName, ActivityID, “StartTime”, DateTime.Now);

 

BAMes.UpdateActivity(ActivityName, ActivityID, “Status”, “START”);

 

BAMes.EnableContinuation(ActivityName, ActivityID, corelationToken);

 

BAMes.EndActivity(ActivityName, ActivityID);

 

BAMes.Flush();

}

}

}

return pInMsg;

}

}

}

END Bam Activity:

This custom pipeline component can be used in any stage at in send pipeline.

using System;

using System.IO;

using System.Text;

using System.Drawing;

using System.Resources;

using System.Reflection;

using System.Diagnostics;

using System.Collections;

using System.ComponentModel;

using Microsoft.BizTalk.Message.Interop;

using Microsoft.BizTalk.Component.Interop;

using Microsoft.BizTalk.Component;

using Microsoft.BizTalk.Messaging;

using System.IO;

using System.Xml;

using Microsoft.BizTalk.Bam.EventObservation;

 

 

namespace EndBAMPipeline

{

[ComponentCategory(CategoryTypes.CATID_PipelineComponent)]

 

[ComponentCategory(CategoryTypes.CATID_Any)]

 

[System.Runtime.InteropServices.Guid(“3AC1B310-C4DF-4732-8AA9-2808349CEFFA”)]

public class EndBAMComponent : IBaseComponent, IComponentUI, Microsoft.BizTalk.Component.Interop.IComponent, IPersistPropertyBag

{

#region Configuration Properties

private string _BAMActivityName;

private bool _IsTrackingRequire;

 

public string BAMActivityName

{

get

{

return _BAMActivityName;

}

set

{

_BAMActivityName = value;

}

}

 

public bool IsTrackingRequire

{

get

{

return _IsTrackingRequire;

}

set

{

_IsTrackingRequire = value;

}

}

#endregion

 

#region IBaseComponent members

public string Description

{

get

{

return “Pipeline component For End BAM Activity”;

}

}

 

public string Name

{

get

{

return “EndBAMPipelineComponent”;

}

}

public string Version

{

get

{

return “1.0.0.0”;

 

}

 

}

#endregion

 

public IntPtr Icon

{

get

{

return new System.IntPtr();

 

}

}

public System.Collections.IEnumerator Validate(object projectSystem)

{

return null;

}

 

#region IPersistPropertyBag members

public void GetClassID(out Guid classID)

{

classID = new Guid(“3AC1B310-C4DF-4732-8AA9-2808349CEFFA”);

}

public void InitNew()

{

}

public virtual void Load(Microsoft.BizTalk.Component.Interop.IPropertyBag pb, int errlog)

{

object val = null;

val = this.ReadPropertyBag(pb, “BAMActivityName”);

if ((val != null))

{

this._BAMActivityName = ((string)(val));

}

val = this.ReadPropertyBag(pb, “IsTrackingRequire”);

if ((val != null))

{

this._IsTrackingRequire = ((bool)(val));

}

}

public virtual void Save(Microsoft.BizTalk.Component.Interop.IPropertyBag pb, bool fClearDirty, bool fSaveAllProperties)

{

this.WritePropertyBag(pb, “BAMActivityName”, this.BAMActivityName);

this.WritePropertyBag(pb, “IsTrackingRequire”, this.IsTrackingRequire);

 

}

#endregion

 

#region utility functionality

/// <summary>

/// Reads property value from property bag

/// </summary>

/// <param name=”pb”>Property bag</param>

/// <param name=”propName”>Name of property</param>

/// <returns>Value of the property</returns>

private object ReadPropertyBag(Microsoft.BizTalk.Component.Interop.IPropertyBag pb, string propName)

{

object val = null;

try

{

pb.Read(propName, out val, 0);

}

catch (System.ArgumentException)

{

return val;

}

catch (System.Exception e)

{

throw new System.ApplicationException(e.Message);

}

return val;

}

 

/// <summary>

/// Writes property values into a property bag.

/// </summary>

/// <param name=”pb”>Property bag.</param>

/// <param name=”propName”>Name of property.</param>

/// <param name=”val”>Value of property.</param>

private void WritePropertyBag(Microsoft.BizTalk.Component.Interop.IPropertyBag pb, string propName, object val)

{

try

{

pb.Write(propName, ref val);

}

catch (System.Exception e)

{

throw new System.ApplicationException(e.Message);

}

}

#endregion

public IBaseMessage Execute(IPipelineContext pContext, IBaseMessage pInMsg)

{

IBaseMessagePart bodyPart = pInMsg.BodyPart;

StringBuilder outputMessageText = null;

string systemPropertiesNamespace = @”http://schemas.microsoft.com/BizTalk/2003/system-properties&#8221;;

if (bodyPart != null)

{

if (IsTrackingRequire)

{

Stream originalStream = bodyPart.GetOriginalDataStream();

if (originalStream != null)

{

string ActivityName = BAMActivityName;

string messageType = Convert.ToString(pInMsg.Context.Read(“MessageType”, systemPropertiesNamespace));

EventStream BAMes;

BAMes = pContext.GetEventStream();

string ActivityID = “seq_” + Guid.NewGuid().ToString();

string corelationToken = (string)pInMsg.Context.Read(“InterchangeID”, “http://schemas.microsoft.com/BizTalk/2003/system-properties&#8221;);

System.Diagnostics.EventLog.WriteEntry(“InterchangeIDEND”, corelationToken);

BAMes.UpdateActivity(ActivityName, corelationToken, “EndTime”, DateTime.Now);

BAMes.UpdateActivity(ActivityName, corelationToken, “Status”, “SUCCESS”);

BAMes.EndActivity(ActivityName, corelationToken);

BAMes.Flush();

}

}

}

return pInMsg;

}

}

}

 

You can see the BAM table or BAM Portal in one row start time and end time of message in BizTalk along with status and messagetype.

Advertisements

BAM in Orchestration

In BizTalk, BAM  applies on pipeline level and in orchestration. Here we are going to implement BAM in Orchestration through BAM API programming.

For more details of BAM APIs, you can refer to

https://vkbiztalk.wordpress.com/2017/07/17/bam-api/

Normally for BAM Programming below three functions are required under EventStream class.

  • BizTalk.Bam.EventObservation.OrchestrationEventStream.BeginActivity
  • BizTalk.Bam.EventObservation.OrchestrationEventStream.UpdateActivity
  • BizTalk.Bam.EventObservation.OrchestrationEventStream.EndActivity

If you want some more advance feature in BAM tracking then you can refer below reference:

https://msdn.microsoft.com/en-us/library/microsoft.biztalk.bam.eventobservation.eventstream.aspx

Requirements:

Add below Dlls in BizTalk project references:

  • Biztalk.BAM.Xlangs.dll
  • BizTalk.Bam.EventObservation.dll

Write below code in orchestration expression shapes:

//Create a new, unique activity identifier to use as the ActivityID in BAM

string activityId = Guid.NewGuid().ToString();

Microsoft.BizTalk.Bam.EventObservation.OrchestrationEventStream.BeginActivity(ActivityName, activityID);

// Updates the activity record.

Microsoft.BizTalk.Bam.EventObservation.OrchestrationEventStream.UpdateActivity ActivityName, activityID, “FIleName”, msg(BTS.FileName), “ProcessStart”, DateTime.UtcNow,);

// End the activity record.

Microsoft.BizTalk.Bam.EventObservation.OrchestrationEventStream.EndActivity(ActivityName, activityID);

Here you can use different expression shape for above methods, Be sure EndActivity method should be in last of orchestration. And StartActivity methad in starting of Orchestration.

Below is explanation of data and function which are used in orchestration expression shapes:

ActivityName: BAM Definition File Name

ActivityID: It can be a GUID or any unique id

UpdateActivity function:

public virtual void UpdateActivity( string activityName, string ctivityInstance,                     params object[] data)

In Update activity, after first two parameters, data items are next parameters which are defined in key value pairs.

These data items can be defined in single UpdateActivity function as well as in separate activity function. E.g. In below BAM table, there are following data items.

Data1, data2, starttime, endtime, errordetails, status, lastmodified.

Here we can write update function as per requirements, it’s not mandatory to define all data items in one time.

UpdateActivity(“BAMSample”, ActivityID, “starttime”, DateTime.Now);

UpdateActivity(“BAMSample”, ActivityID, “Status”, “OperationStart”);

BAMTable.jpg

You can track info on BAM Portal or BAM definition table in BAM Primary Import Database.

When you defining BAM Definition file then BAM creates five table in BAMPrimaryImport table.

https://vkbiztalk.wordpress.com/2017/06/14/implementation-of-bam-activity-definition-file/

You can check data in Bam_<BAM Definition File>_Completed table.

e.g. bam_BAMSample_Completed

How does EventStream work in Orchestration?

The OES API stores tracking data first in the BizTalk MessageBox database. Periodically the data is processed and persisted to the BAM Primary Import database by the Tracking Data Decode Service (TDDS).

The OES API is found in the Microsoft.BizTalk.Bam.EventObservation namespace.

BAM in Custom Pipeline

In BizTalk, BAM can be applied on pipeline level and in orchestration. Here we are going to implement BAM in BizTalk through BAM API programming.

For more details of BAM APIs, you can refer to

https://vkbiztalk.wordpress.com/2017/07/17/bam-api/

Normally for BAM Programming below three functions are required under EventStream class.

  • BeginActivity
  • UpdateActivity
  • EndActivity

But if you want some more advance feature in BAM tracking then you can refer below reference:

https://msdn.microsoft.com/en-us/library/microsoft.biztalk.bam.eventobservation.eventstream.aspx

Click on below link for example of BAM activity in custom pipeline

https://vkbiztalk.com/2018/02/25/bam-activity-in-custom-pipeline/

Normally, we write the code to produce BAM events in the Execute method of the pipeline component.

The pipeline context has a GetEventStream method that returns a MessagingEventStream.

Requirements:

Dlls:

  • BizTalk.Bam.EventObservation.dll
  • BizTalk.ExplorerOM
  • BizTalk.Pipeline
  • BizTalk.Streaming

Namespaces:

  • usingBizTalk.Bam.EventObservation;
  • usingBizTalk.Message.Interop;
  • usingBizTalk.Component.Interop;
  • usingBizTalk.Streaming;
  • usingBizTalk.ExplorerOM;

Example:

public Microsoft.BizTalk.Message.Interop.IBaseMessage Execute(Microsoft.BizTalk.Component.Interop.IPipelineContext context, Microsoft.BizTalk.Message.Interop.IBaseMessage inMsg)

{

      EventStream BAMes;

BAMes = context.GetEventStream();

string ActivityID; // it can be a GUID

String operation; // message context properties or any custom value to track in BAM

BAMes.BeginActivity(ActivityName, ActivityID);

BAMes.UpdateActivity(ActivityName, ActivityID, “Data”, operation);

BAMes.EndActivity(ActivityName, ActivityID);

BAMes.Flush();

}

Here ActivityName: BAM Definition File Name

ActivityID: It can be a GUID or any unique id

UpdateActivity function:

public virtual void UpdateActivity( string activityName, string activityInstance,                   params object[] data )

In Update activity, after first two parameters, data items are next parameters which are defined in key value pairs.

These data items can be defined in single UpdateActivity function as well as in separate activity function. E.g. if a BAM table has following data items.

Data1, data2, starttime, endtime, errordetails, status, lastmodified.

Here we can write update function as per requirements, it’s not mandatory to define all data items in one time.

BAMes.UpdateActivity(“BAMSample”, ActivityID, “starttime”, DateTime.Now);

BAMes.UpdateActivity(“BAMSample”, ActivityID, “Status”, “OperationStart”);

You can track info on BAM Portal or BAM definition table in BAM Primary Import Database. You can check data in Bam_<BAM Definition File>_Completed table.

e.g. bam_BAMSample_Completed

BAMTable.jpg

When you defining BAM Definition file then BAM creates five table in BAMPrimaryImport table. you can refer to following reference to create BAM Definition file.

https://vkbiztalk.wordpress.com/2017/06/14/implementation-of-bam-activity-definition-file/

How does EventStream work in pipeline?

MessagingEventStream (MES) is used inside a BizTalk pipeline component to write Bam as part of the messaging transactions ensuring that your BAM event persistence remains in sync with the BizTalk pipeline transactions.

Messaging Event Streams are asynchronous and store tracking data first in the BizTalk MessageBox database. Periodically the data is processed and persisted to the BAM Primary Import database by the Tracking Data Decode Service (TDDS).

 

BAM API

In BizTalk, BAM (Business Activity Monitoring) can be applied on pipeline and in orchestration. BizTalk also provide Tracking Profile Editor tool to implement BAM in BizTalk,  You can get info about tacking profile editor from below reference:  https://msdn.microsoft.com/en-us/library/aa547038.aspx.

But this tracking tool has some limitation (for more info you can refer to https://blog.sandro-pereira.com/2010/08/20/bam-limitation-of-tracking-profile-editor-tpe ),  that’s why we need to move to apply BAM through programming. Here we are going to implement BAM in BizTalk through programming. Before going to coding we need to understand concept of BAM API, which is used in BAM Programming.

The BAM API defines four main classes:

  • DirectEventStream (Synchronous, no latency): used in a .NET application to do a buffered write of data to BAM. Here data is persisted synchronously to the BAM Primary Import database. Except for DES, all other EventStream classes are asynchronous and have some latency. The data is first persisted to MessageBox and subsequently processed by TDDS which moves data into the BAMPrimaryImport database.
  • BufferedEventStream (Asynchronous, high throughput, some latency): used in a .NET application to do an unbuffered write of data to BAM.
  • OrchestrationEventStream (Asynchronous, participates in BizTalk orchestration transactions): used within an orchestration; Provides transactional consistency with the orchestration.
  • MessagingEventStream (Asynchronous, participates in BizTalk Server pipeline transactions): used within a pipeline; Provides transactional consistency with the messaging engine.

All of these classes are derived from the base class EventStream.

Note:

For BizTalk OrchestrationEventStream (For Orchestrations) and MessagingEventStream (For Pipelines) are applicable and other two event streams are applicable for non-Biztalk e.g. WCF and WF. Link is below for how to apply BAM through BAM API in BizTalk Pipeline and Orchestration.

Apply BAM in Pipeline:

https://vkbiztalk.wordpress.com/2017/07/26/bam-in-custom-pipeline/

Apply BAM in Orchestration:

https://vkbiztalk.wordpress.com/2017/07/27/bam-in-orchestration/

The EventStream APIs for BAM reside in the Microsoft.BizTalk.BAM.EventObservation namespace. To code against the APIs, you must add the following DLLs to your project reference and include the namespace in your code with the following using statement:

using Microsoft.BizTalk.Bam.EventObservation;

  • BizTalk.BAM.EventObservation.dll (Available at C:\Program Files (x86)\Microsoft BizTalk Server 2013 R2\Tracking)
  • Biztalk.BAM.Xlangs.dll (Available at C:\Program Files (x86)\Microsoft BizTalk Server 2013 R2\Tracking): This DLL is required when coding for Orchestration event streams.
  • BizTalk.Pipeline.dll (Available at C:\Program Files (x86)\Microsoft BizTalk Server 2013 R2): This DLL required when using coding pipeline contexts for Messaging event streams.

Implementation of BAM Activity Definition file

When we install BAM in BizTalk Server then its add BAM (Business Activity Monitoring) in Add-Ins in Microsoft Excel File. For implementation of BAM or create Activity Definition file of BAM we need to follow the following process.

Open Excel File -> File -> Options -> Add-Ins

BAM1.jpg

Click on Go… Button as in above screenshot. Now below popup will open, Select the Business Activity Monitoring and click OK.

BAM2.jpg

Now click on Add-Ins Tab in Excel file as below screenshot. And select BAM Activity. as defined below.

BAM3.jpg

Now Activity Definition file will open as below:

BAM4.jpg

Here we need to define the data and milestone, which will need to capture from the BizTalk applications when message process.

Here I have defined some data as below screenshot:

BAM5.jpg

Item type as Business Milestone is related to Date Time.

BAM6.jpg

BAM7.jpg

BAM8.jpg

After defining Activity data, we can also define these things in BAM View as below to look more familiar to Business Users.

BAM9.jpg

BAM10.jpg

BAM11.jpg

BAM12.jpg

Now if require then we can go for below feature otherwise we can escape this.

BAM13.jpg

BAM14.jpg

Click next and finish the Activity Creation.

After finishing the creation of Activity details, we need to export then details in xml format as defined below:

BAM15.jpg

BAM Definition file will look like as below:

BAM16.jpg

Now we need to execute the below command to setup the activity Details in BAMPrimaryImport Database.

bm.exe deploy-all -DefinitionFile:<def file>[ -Server:<server> ][ -Database:<database> ]

BAM17.jpg

The BAM management utility deployment commands allow you to apply, modify, and remove definitions.

  • exe deploy-all: Deploys a BAM definition.
  • exe update-all: Updates a BAM definition.
  • exe remove-all: Removes a BAM definition.

BAM Portal:

Now you can check this on BAM Portal. If you run BAM Portal first time then need to set the Compatibility View Setting on Internet Explorer. If you want to open BAM Portal on Google Crome then you need to add IE Tab in Crome.

For more information about how to open BAM in different browser, you can refer below reference:

https://blog.sandro-pereira.com/2015/07/31/user-experience-running-bam-portal-in-different-browsers/

BAM18.jpg

For more information about BAM, please refer the below reference:

https://msdn.microsoft.com/en-us/library/aa558802.aspx

https://msdn.microsoft.com/en-us/library/aa560294.aspx

 

 

 

 

BAM Installation and Configuration in Multi server Environment

In Most of the Project development, BAM is always chosen as second phase. In Existing BizTalk Project, BAM will add as an additional layer to the solution.

In this blog We are explaning about BAM installation in Multi server Environment. The below BAM installation steps assumes that BizTalk is already installed and configured. To install BAM on BizTalk Servers, we need to again run the BizTalk server setup file on all BizTalk Servers and follow the below steps

Note: The Log on User account to install and configure BAM should have admin rights on SQL server and Biztalk both.

  1. When we run the set-up file, below page will be popup.

BizTalk1.jpg

  1. Click on Install Microsoft BizTalk Server 2013 R2

BizTalk2.jpg

  1. Select Modify as below:

BizTalk3.jpg

  1. Select Portal Component along with all others Component, which had already installed on the machine.

BizTalk4.jpg

Note: Please select all components which are already installed otherwise It will remove those component from the BizTalk Server and then we need to install all the components again.

  1. Select all BAM Component in Additional Software as Below:

BizTalk5.jpg

  1. Click Next and install.

Configuring BAM

As a part of multi-computer environment, while configuring BAM, we need to select the Custom Configuration option in the BizTalk Server Configuration tool on each Biztalk Server in the group.

1. Configuring BizTalk BAM Server

Here we assume that Biztalk Server is already installed and configured, we just need to add BAM Tool and BAM portal Configuration on the BizTalk Server. BAM also requires the following:

  • SQL Server Analysis Services (SSAS)
  • SQL Server Integration Services (SSIS)
  • SQL Server Database Mail or SQL Server Notification Services (SSNS)

To configure BAM

  1. Click Start, point to All Programs, point to Microsoft BizTalk Server, and then click BizTalk Server Configuration.

BizTalk6.jpg

  1. In the left pane, click BAM Tools, and then enter or select the following values:
Name Value
Enable Business Activity Monitoring tools (selected)
Enable Analysis Services for BAM aggregations (selected)
BAM Primary Import Database: Server Name the SQL Server host name
BAM Primary Import Database: Database Name the default name is BAMPrimaryImport
BAM Archive Database: Server Name the SQL Server host name
BAM Archive Database: Database Name the default name is BAMArchive
BAM Analysis Database: Server Name the SQL Server host name
BAM Analysis Database: Database Name the default name is BAMAnalysis
BAM Star Schema Database: Server Name the SQL Server host name
BAM Star Schema Database: Database Name the default name is BAMStarSchema

Screenshot as below:

BizTalk7.jpg

Note: The service account used for the OLAP service should have db_datareader permissions on the BAM Star Schema database.

  1. In the left pane, click BAM Alerts, and then enter or select the following values (Optional).
    BAM alerts require SQL Server Database Mail , and BAM tools to be enabled.
Name Value
Enable SQL Notification Services for BAM alerts (selected)
Windows service BTService
BAM Alerts SMTP Server (the SMTP server that will be used to send the BAM alerts.)
BAM Alerts File Location (the network share that will be used to store the BAM alerts.)
Note : We must manually create this share before BAM alerts can store the files.
SQL Server for Alerts Databases the name of the SQL Server
Prefix for Alerts Database Names (a prefix that will be used for the alerts databases)

Note: Do not install BAM Alerts unless you have a SMTP server available and planning to use BAM Alerts feature. SKIP installation of BAM Alerts by Unchecking the box in case it is already checked.

  1. In the left pane, click BAM Portal, and then enter or select the following values. In case you have not created domain groups for BAM , create the below three domain groups to control access to BAM:
  1. (domain)\BAM Portal Users
  2. (domain)\BAMAppPoolUser
  3. (domain)\BAMMgmtWSUser
Name Value
Enable BAM Portal (selected)
BAM Management Web Service user (domain)\BAMMgmtWSUser
BAM Application Pool Account (domain)\BAMAppPoolUser
BAM Portal Users (domain)\BAM Portal Users
BAM Portal Web Site Default Web Site

Note: BAM Management Web Service user and BAM Application Pool Account can be service account but service account will have admin access on BizTalk server.

Screen Shot as below which uses a Bam Portal users group as everyone which is not recommended in production environments and create a separate “BAM Portal Users” in domain.

BizTalk8.jpg

  1. Click Apply Configuration.
  2. On the Summary page, to apply the configuration, click Next.
  3. Verify that the Configuration Result is Success, and then click Finish.
  4. Close Microsoft BizTalk Server 2013 R2 Configuration.

2. BAM Portal Configuration

After BAM Configuration with BizTalk Server Configuration. We need to check BAM Portal and config setting (if Require) on IIS.

BizTalk9.jpg

Select BAM in Left side and open Authentication in Right side of IIS window as mentioned below screenshot:

BizTalk10.jpg

Now Select Window Authentication and Click on Provider.. as mentioned in Below Screenshot.

BizTalk11.jpg

Note: Only Enable ASP.NET Impersonation and Windows Authentication.

Select NTLM and Click Move Up Button. NTLM should be the first in the list of Providers

BizTalk12.jpg

When we browse BAM Portal, it will open as below:

BizTalk13.jpg

Note: BAM Portal works on Internet Explorer. For Chrome , a separate Extension IE tab is required.

Reference

Resource Link
Installation of BAM http://go.microsoft.com/fwlink/p/?LinkID=208597
Installation of BizTalk https://msdn.microsoft.com/en-us/library/jj248681.aspx
Installation & Configuration Issue https://blog.sandro-pereira.com/tag/bam/

BAM (Business Activity Monitoring)

BAM is the optional and important part of BizTalk. Its available when we are installing BizTalk Server.

BAM is used for monitor the data and milestone of the messages in near real time, which are passing thought the BizTalk.

Its show the tracking information of messages on web Portal to Business people who don’t know about the BizTalk inside activity. So, Business people or users will know about the details which is require when the messages processing in BizTalk. It shows when messages is processed through BizTalk, has it successful passed or not. And also generate alert message if require.

BAM is rich set of Tools for monitoring. It’s available along with BizTalk Licence. BAM Portal is ASP.NET Component.

In terms of MSDN (https://msdn.microsoft.com/en-us/library/aa560139.aspx)

Business Activity Monitoring (BAM) is a collection of tools that allow you to manage aggregations, alerts, and profiles to monitor relevant business metrics (called Key Performance Indicators, or KPIs). It gives you end-to-end visibility into your business processes, providing accurate information about the status and results of various operations, processes, and transactions so you can address problem areas and resolve issues within your business.

Benefits of BAM

  • BAM portal- Here user can track all the details for messages, aggregate data and generate alert.
  • BAM as a reporting solution provides a familiar environment to business users by taking advantage of Office and Sharepoint
  • Unlike application development, BizTalk development often does not have anything tangible which can be shown to a client. BAM will provide them information about their business processes and can help them to see the benefits of the solution
  • BAM can be implemented in easy way with some small coding if we write BAM programatically and with no code in case of Tracking Profile Editor
  • BAM is a built-in feature of BizTalk which a company who invests in BizTalk will already have made
  • In Most of the Project development, BAM is always chosen as second phase. In Existing BizTalk Project, BAM will add as an additional layer to the solution. You would simply deploy the BAM artifacts to the existing BizTalk group