BAM Activities and Views

Parent Previous Next

BizTalk’s Business Activity Monitoring (BAM) model consists of activities, views and security associated with the views.  The activities and views translate into physical SQL Server database artifacts, which makes it difficult to change a model once it has been deployed and real data is stored in it.


Model Deployment

The first thing that is required to deploy a BAM model is the model definition itself.  The model should be saved as an Excel XLS/XLSX binary file.  The Deployment Framework will automatically extract and export the BAM XML definition from the Excel workbook, so do not store the XML file in your source control system.


To deploy one or more BAM models, edit your Deployment Framework for BizTalk project file (.btdfproj) as follows:


1. Set the IncludeBAM property to true

The property may be included in any PropertyGroup, but is commonly placed in the first PropertyGroup in the project file.


<PropertyGroup>

 ...

 <IncludeBAM>true</IncludeBAM>

 ...

</PropertyGroup>


2. Add a BamDefinitions ItemGroup

The following is a typical example that properly follows the common ItemGroup structure:


<ItemGroup>

 <BamDefinitions Include="$(ProjectName).BAM.xls">

   <LocationPath>..\BAM</LocationPath>

 </BamDefinitions>

</ItemGroup>


The following is the default configuration, which corresponds to the optional naming conventions.  This default is in effect if you do not include any BamDefinitions elements in your project file.


<ItemGroup>

 <BamDefinitions Include="$(ProjectName).BAM.xls">

   <LocationPath>..\$(ProjectName).BAM</LocationPath>

 </BamDefinitions>

</ItemGroup>


If you have more than one BAM model, then repeat the <BamDefinitions> element for each file (usually within the same ItemGroup).


Continue reading for Steps 3 and 4 (below).


Security for Views

Before users can view data from a BAM model in the BAM Portal website, they must be granted access to the views.  The settings spreadsheet (typically EnvironmentSettings\SettingsFileGenerator.xml) contains a row titled “BAMViewsAndAccounts” that allows you to specify one or more view names and one or more accounts to be granted access to each view.  As with the other settings, this value may be different for each runtime environment.  After deploying the BAM model, the Deployment Framework will apply security to the views based on this setting.


NOTE: On an application re-deploy when the BAM model already exists, it is normal to see an error message during this phase of deployment.  The error is simply reporting that the specified users already have rights to the views and will not interrupt the script.


3. Configure permissions for the views in the settings spreadsheet

In the BAMViewsAndAccounts row in the spreadsheet, enter a formatted permissions string for each environment, and/or enter a default value in the Default Values column.  If there is no such row, just enter BAMViewsAndAccounts in the first column of an empty row and proceed to enter the values.


The format of the values is:

ViewName1:DOMAIN\GroupName1;ViewName1:DOMAIN\GroupName2;ViewName2:BUILTIN\Administrators;<etc.>


4. Add (or update) a PropsFromEnvSettings ItemGroup

In your project file (.btdfproj), add to or update a PropsFromEnvSettings ItemGroup to cause the BAMViewsAndAccounts setting from the spreadsheet to be transferred to an MSBuild property at runtime:


<ItemGroup>

 <PropsFromEnvSettings Include="BAMViewsAndAccounts" />

</ItemGroup>


If you need more than one setting value to be transferred to MSBuild properties, you may include one or more settings spreadsheet row names in the Include attribute value separated by semicolons, or include multiple PropsFromEnvSettings elements.


Data Preservation

Once a BAM model has been deployed and live data has been stored in it, very few changes are possible without data loss.  For that reason, the Deployment Framework does not automatically un-deploy the model.  If you still prefer to have automatic un-deployment, set the following property in your project file:


<PropertyGroup>

 ...

 <SkipBamUndeploy>false</SkipBamUndeploy>

 ...

</PropertyGroup>


You can also remove the model from the command line using the following command in the deployment project folder:


msbuild /t:UndeployBam /p:SkipBamUndeploy=false MyDeploymentProject.btdfproj


Created with the Personal Edition of HelpNDoc: Write eBooks for the Kindle