如何为 Azure Analysis Services 和 PowerBI Embedded 配置 UPN mapping/CustomData

How to configure UPN mapping/CustomData for Azure Analysis Services and PowerBI Embedded

类似于this question

我有一个嵌入 PowerBI 报告的 .Net Core Web 应用程序,此报告需要在 Azure Analysis Services 中的数据级别应用行级安全性,使用内部部署数据网关。

我已经配置了 EffectiveIdentity to pass through the UPN using the CustomData 选项,我还设置了角色和角色上的 DAX 查询以过滤行。

我还根据 this post 设置了 SQL Server Profiler,并且可以确认 CustomData 中设置的值正在传递给分析服务。

在非 Azure 版本的 Analysis Services 中,您可以将 PowerBI 门户网站内的数据网关配置为[映射用户名](https://docs.microsoft.com/en-us/power-bi/service-gateway-enterprise-manage-ssas#map-user-names. Since someone else setup the gateway (in Azure), and Azure Analysis Services is not a supported Data Source Type (not an option in the dropdown). I need to know if it is possible to view/change the Effective User names/CustomData setting.

所以我终于弄明白了,据我所知,UPN 映射是默认启用的。

在我的具体情况下,我最终根据 the docs. Initially this wasn't behaving as expected because on my Azure Analysis Services Database I had two row filters, one on the main data table that was comparing the user's email against the USERPRINCIPAL() DAX function, then the filter that I added against the user table comparing the user's email against CUSTOMDATA() DAX 函数使用了 CustomData 选项。

为了让它工作,我最终删除了我自己的针对用户 table 的过滤器,并将初始过滤器中 USERPRINCIPAL() 函数的使用替换为 CUSTOMDATA() - 我验证了我们的 BI 人员对此进行了更改,他对此很满意。

我希望这能为其他人省去我遇到的麻烦。