I'm working on integrating Azure Blob Storage with Power BI to display HTML content stored in a blob within my Power BI dashboard. The blob is hosted in an Azure Storage Account set to a private access level. While I can access this blob directly when logged into my Azure account, I encounter access issues when trying to display its content in both Power BI Desktop and the Power BI Service.
I have designed a table that includes destinations and the corresponding Blob URLs for HTML content. The visualization contains a destination filter. My goal is that when a user selects a destination from this filter, the HTML content associated with the chosen destination will be displayed on the dashboard.
Here's what I'm trying to achieve:
Display HTML content from a private blob in Azure Blob Storage on a Power BI dashboard. Use AAD and RBAC for authentication and authorization, avoiding SAS tokens. Ensure that Power BI Desktop and Power BI Service users can view the content based on their assigned roles. Questions:
How can I configure AAD and RBAC to allow Power BI to access and display content from a private Azure Blob Storage? What specific roles or permissions are required for Power BI users to access the blob content without making the blob public or using SAS tokens? Are there any specific configurations needed on the Power BI side to support AAD authentication for accessing Azure Blob Storage? Any guidance or insights on setting this up would be greatly appreciated. Thank you!
PS: I don't want to load the blob (html content) through Get data in my dashboard, but I want to directly use the Blob URL of the content.
The common solution involving Shared Access Signatures (SAS) tokens is known to me, but for security and management reasons, I prefer not to use SAS tokens for this scenario. Instead, I'm interested in leveraging Azure Active Directory (AAD) and Role-Based Access Control (RBAC) to manage access. I aim to assign appropriate roles to Power BI dashboard users to facilitate access without compromising the private nature of the blob storage.
If you need to use the Azure Active Directory and RBAC to manage access the azure blob storage, you can follow the steps below.
First, create an app registration and assign
Storage Blob Data Contributor role(read, write, delete, etc.) to access the blob storage.You can generate the bearer token using the Python code below.
Code:
Output:
Now, use the above
access tokenandx-ms-version=2020-04-08in headers in theWebrequest in PowerBI to access the blob URI.PowerBI:
Output:
Reference:
Assign an Azure role for access to blob data - Azure Storage | Microsoft Learn