Skip to main content
cancel
Showing results for 
Search instead for 
Did you mean: 

Compete to become Power BI Data Viz World Champion! First round ends August 18th. Get started.

Reply
Sania198
Frequent Visitor

How to Upload PBIX file stored in Azure storage container to Power BI Service

Hi,

My requirement is to upload the PBIX file stored in Azure storage container to Power BI Service without downloading it to local drive

Normally we can upload the PBIX file by giving local path like below

$pbixFilePath = "C:\PBIXFileLocation\Test.pbix"
$import = New-PowerBIReport -Path $pbixFilePath -Workspace $workspace -ConflictAction CreateOrOverwrite
$import | Select-Object *
 
But now which path I have to use if the PBIX file is stored in Azure storage container and how the PowerShell script can be created?
 
Thanks in Advance! 
1 ACCEPTED SOLUTION

Issue can be resolved by following my similar post in Azure platform

AnuragSingh-MSFT explained me clearly and resolved the issue

 

A basic understanding of Azure Automation runbook execution should help clarify this doubt. When runbooks are designed to authenticate and run against resources in Azure, they run in an Azure sandbox. Azure Automation assigns a worker to run each job during runbook execution in the sandbox. Please see this link for more details - Runbook execution environment These sandboxes are isolated environment with access to only some of t...

The following section should help answer the question - ... which path I have to use if the PBIX file is stored in Azure storage container and how the PowerShell script can be created?

The script snippet provided by Manu above would download the blob content in the same directory inside sandbox from where script is running. You can access this path inside the script using ".\" --> for example, if the blob that you are downloading is named testBlob, it will be available in location .\testBlob. (".\" stands for current directory).

Therefore, the pbixFilePath can be initialized as $pbixFilePath = ".\Test.pbix"

Another option is to use $env:temp as mentioned in the question. It is one of the environments variable available on local machine (on your workstation) which generally resolves to C:\Users\<username>\AppData\Local\Temp

In Azure Automation sandbox environment, this variable resolves to C:\Users\Client\Temp

Therefore, you could download the blob content using the following line:

 

  1. Get-AzStorageBlobContent -Blob $blob -Container $ContainerName -Context $Ctx -Destination $env:temp #Destination parameter sets the target folder. By default it is local directory (.\)
     

    In this case, you would initialize pbixFilePath as $pbixFilePath = $env:temp+"\Test.pbix"

    Either case is fine as long as the Automation limits are not exceeded.

View solution in original post

5 REPLIES 5
GilbertQ
Super User
Super User

Hi @Sania198 

 

I would first download the PBIX from the Azure storage to a local drive and then upload to the Power BI Service.





Did I answer your question? Mark my post as a solution!

Proud to be a Super User!







Power BI Blog

Thanks for your response @GilbertQ 

I can't download the PBIX file to local drive and use it as I have to use the PowerShell script in Runbook Automation so it doesn't work in my scenario.

Also, I tried to list the blobs in the container with the Get-AzStorageBlob cmdlet and passed it as a path in above script and ended up with this error: 

Sania198_2-1667976395214.png

I don't know whether it is a correct way of acheiving my requirement but just tried it

If possible please help me with a sample PowerShell script to achieve the above requirement

Hi @Sania198 


To me that looks like it might be a PowerShell Module that is missing?

 

I am sure that there might be a way to store Runbook outputs to a location, which you could then access to upload?





Did I answer your question? Mark my post as a solution!

Proud to be a Super User!







Power BI Blog

Hi @GilbertQ 

 

I don't think it is a PowerShell Module issue, I crossed verified and every required Moudle is installed but I'm not sure

Even I feel the same,  there might be a way to store Runbook outputs to a location but don't know which location we have to use, any idea? 

There is no proper documentation regarding my ask either external or internal doc, it would be helpful if we can have one 

 

Issue can be resolved by following my similar post in Azure platform

AnuragSingh-MSFT explained me clearly and resolved the issue

 

A basic understanding of Azure Automation runbook execution should help clarify this doubt. When runbooks are designed to authenticate and run against resources in Azure, they run in an Azure sandbox. Azure Automation assigns a worker to run each job during runbook execution in the sandbox. Please see this link for more details - Runbook execution environment These sandboxes are isolated environment with access to only some of t...

The following section should help answer the question - ... which path I have to use if the PBIX file is stored in Azure storage container and how the PowerShell script can be created?

The script snippet provided by Manu above would download the blob content in the same directory inside sandbox from where script is running. You can access this path inside the script using ".\" --> for example, if the blob that you are downloading is named testBlob, it will be available in location .\testBlob. (".\" stands for current directory).

Therefore, the pbixFilePath can be initialized as $pbixFilePath = ".\Test.pbix"

Another option is to use $env:temp as mentioned in the question. It is one of the environments variable available on local machine (on your workstation) which generally resolves to C:\Users\<username>\AppData\Local\Temp

In Azure Automation sandbox environment, this variable resolves to C:\Users\Client\Temp

Therefore, you could download the blob content using the following line:

 

  1. Get-AzStorageBlobContent -Blob $blob -Container $ContainerName -Context $Ctx -Destination $env:temp #Destination parameter sets the target folder. By default it is local directory (.\)
     

    In this case, you would initialize pbixFilePath as $pbixFilePath = $env:temp+"\Test.pbix"

    Either case is fine as long as the Automation limits are not exceeded.

Helpful resources

Announcements
August Power BI Update Carousel

Power BI Monthly Update - August 2025

Check out the August 2025 Power BI update to learn about new features.

August 2025 community update carousel

Fabric Community Update - August 2025

Find out what's new and trending in the Fabric community.