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

The Power BI Data Visualization World Championships is back! Get ahead of the game and start preparing now! Learn more

Reply
jragan
Frequent Visitor

Access OneLake Storage from Runbook

Hello,

I would like to write a CSV or Parquet directly into OneLake storage from a runbook.

I am using the following code in the runbook:

 

$ctx = New-AzStorageContext -StorageAccountName 'onelake' -UseConnectedAccount -endpoint 'fabric.microsoft.com' 
New-AzDataLakeGen2Item -Context $ctx -FileSystem $workspaceGUID -Path $uploadPath -Source $csvFilePath -Force

 

However I am receiving a 403 error that the user doesn't have access. I can't find a way to grant the managed identity for the automation account access to the workspace nor the datalake. I was able to wire up Azure Storage Explorer to the location however trying to add the managed identity to the ACL fails with an access error upon saving.

 

One additional note is that the Fabric Workspace in question is tied to a Trial Fabric license while we wait for Microsoft to figure out how to move our P1 capacity into a region that actually supports Fabric.

1 ACCEPTED SOLUTION

@GilbertQ After a lot of trial and error and following dark paths into rabbit holes, I came across this Post which highlights the new Tenant option to allow Service Principal Authentication.

 

once I enabled it and granted my Service Principal, the code in my OP executed perfectly. 

View solution in original post

2 REPLIES 2
GilbertQ
Super User
Super User

Hi @jragan 

 

As far as I am aware, it is currently not supported to use managed identities or automation accounts into one lake. You might. be able to do this using your account, which I know is not great, but that is the only current workaround I am aware of.





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

Proud to be a Super User!







Power BI Blog

@GilbertQ After a lot of trial and error and following dark paths into rabbit holes, I came across this Post which highlights the new Tenant option to allow Service Principal Authentication.

 

once I enabled it and granted my Service Principal, the code in my OP executed perfectly. 

Helpful resources

Announcements
Power BI DataViz World Championships

Power BI Dataviz World Championships

The Power BI Data Visualization World Championships is back! Get ahead of the game and start preparing now!

December 2025 Power BI Update Carousel

Power BI Monthly Update - December 2025

Check out the December 2025 Power BI Holiday Recap!

FabCon Atlanta 2026 carousel

FabCon Atlanta 2026

Join us at FabCon Atlanta, March 16-20, for the ultimate Fabric, Power BI, AI and SQL community-led event. Save $200 with code FABCOMM.