It´s a common factor that before users can view data from a BAM model in the BAM Portal website, they must be granted access to the views. However, and contrary to what I thought, the user who makes the deployment of the BAM Definition doesn’t necessarily have access to this particular view in the BAM Portal! (I was being misled because usually, I am the owner… hehe).
Instead, the only user that always has access to the view and cannot be added to or removed from the view(s) is the Database Owner (BAMPrimaryImport)!
📝 One-Minute Brief
If you’ve successfully deployed your BAM definition but can’t see the views in the BAM Portal, the issue is likely missing permissions. Unlike the deployment user, specific viewers must be explicitly granted access to each BAM View. This guide explains how to use the bm.exe command-line tool to add users or groups to a BAM view so they appear correctly in the portal.
You can check who the database owner is by running the following query:
[sourcecode language="sql"]
SELECT SUSER_SNAME(owner_sid),name
FROM sys.DATABASES
So after I run this query, I realize that another user was the owner, and to solve this “problem”, I had to give permissions to my user to access this View in the BAM Portal by running the following BAM Management Utility command:
bm.exe add-account -AccountName:DOMAIN\USER -View:MyView
Mystery solved.
Hope you find this helpful! If you liked the content or found it useful and would like to support me in writing more, consider buying (or helping to buy) a Star Wars Lego set for my son.


we are also facing the same issue, but SQL Query is not fetching any expired users list,
how to resolve the issue, your help will be extremely helpful for us