Displaying images from a private cloud storage in Power BI report
The internet is flooded with guides showing how to use a cloud storage service to display images in a PBI report. Most of them mentioning how the URI should to be anonymously available, example. This is perfectly fine if you don’t have any sensitive data. For a company that prefers to keep their image files private, this approach falls short.

Solution:

For this solution I have chosen to go with Azure Blob Storage as my cloud storage provider. When using Power BI we are already in the Microsoft universe, so let us stay there for convenience’ sake.

Prerequisites:

Implementation(Using Azure PowerShell)

First we would have to log in to the azure account with this command:

Connect-AzAccount

Next we want to create a context of where we want the shared access signature(SAS) to be. This is done by firstly retrieving the access key of the storage account.

1. Go to Azure Portal

2. Now go to Storage Accounts

3. Click specific storage account

4. Settings > Access keys

5. Copy, paste a key

Replace <> with your account name and storage account key and run command.

$ctx = New-AzStorageContext -StorageAccountName <storage-account>

-StorageAccountKey <access-key>

To create the SAS we need first to specify the context we just created inside the parameter

-Context. Here I give read permission with ‘r’(highly recommended) as we want users ONLY to view the content.

The lifetime for the SAS token can be set by -ExpiryTime parameter which has to be of type DateTime. I created one with n-number of days into the future. The name has to be specified to generate the token based on the container we want the user to access.(see docs for more information about the parameters). Run this command and replace the <> with your container name and expiration date number.

New-AzStorageContainerSASToken -Name <container-name> -Permission r -ExpiryTime (Get-Date).adddays(<number>) -Context $ctx

This should return a SAS Token that can be used as an extension of the storage resource URI.

Storage resource URI with a SAS Token extension

WARNING: Only share the Power BI report with people who should have read permission to the container. The token can easily be retrieved through the report itself.
['Jesper Enemark']
['Business Intelligence', 'Image Processing', 'Technology', 'Power Bi', 'Azure']