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

Register now to learn Fabric in free live sessions led by the best Microsoft experts. From Apr 16 to May 9, in English and Spanish.

Reply
po
Post Prodigy
Post Prodigy

Read csv from network location in service

Hi,

 

Have a power bi desktop report which reads .csv files from a shared network drive.

 

I want to read these files using the service in order to automate.

 

A couple of questions can the service also read these shared network files if the gateway machine has the ability to see these shared files?

 

Is there a better way of accomplishing this longer term - not sure of one drive has been rolled out to everyone yet in our organization.

 

Thanks

1 ACCEPTED SOLUTION

The configuration I have mentioned is for a shared file in a local network. If you have sharepoint file you don't need to add it in the gateway. You can with auth2 credentials (AD). The windows credentials are just for the local file.

If you have a source in gateway and an online source you need to check this option in gateway configuration to make it work:

https://docs.microsoft.com/en-us/power-bi/connect-data/service-gateway-mashup-on-premises-cloud

With that option activated and the local network file configured in the gateway you might be able to schedule refresh. If you want you can add sharepoint to the gateway too but it's not necessary, you can just enter the credentials when configuring the schedule refresh.

 

 


If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

Happy to help!

LaDataWeb Blog

View solution in original post

6 REPLIES 6
ibarrau
Super User
Super User

Hi. Yes you can. The service can read files shared in network if the VM with the gateway is shared. The key is to have the same path in the power bi desktop and the manage gateway configuration in service (data source = file). Something like this:
path= \\ [IP where file is shared] \ [Folders] \ [File.csv]

The authentication should be a windows user. You have to complete the process login in with 

User: Domain\User

Password: YourPassword

Another way should be onedrive or sharepoint. In both cases you don't need a gateway and power bi service can connect directly

Hope this helps,


If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

Happy to help!

LaDataWeb Blog

Hi,

 

Thanks for reply.

 

Have below in 

 

Source = Csv.Document(File.Contents("\\<server>\bi_shareddata\PowerBI\Reports\Workspaces\BI Team\Files\app_reports.csv")

 

I can refresh file in desktop o.k. and the gateway server can see the above fileshare.

 

Not sure what mean by "if the VM with the gateway is shared".?  How ca we check this?

 

Get error belwo if try and refresh on service.

Scheduled refresh has been disabled.

Please try again later or contact support. If you contact support, please provide these details.

  • Data source errorScheduled refresh is disabled because at least one data source is missing credentials. To start the refresh again, go to this dataset's settings page and enter credentials for all data sources. Then reactivate scheduled refresh.

I can refresh other reports fine which have oracle data sources but have never tried to refresh a report using the service where data source is a csv on a shared network drive.

 

Also like idea of using sharepoint - we have a teams site which members of our team use but when try and use sharepoint.

These csv files down a tree as per below and the folders have spaces in them and when try and set up to access via sharepoint on power bi desktop.

 

https://<company>.sharepoint.com/:x:/r/sites/BI/Shared%20Documents/Power%20BI/Workspace%20Inventory/...

 get error message

 

 

error.JPG

 

sharepoint.JPG

 

 

If I try access  rro level I can see the namesof the csvs bt trying to access content of them in sharepoint.

root.JPG

Good. Next step should be adding the source on the "Manage Gateway" options like this doc:

https://docs.microsoft.com/en-us/data-integration/gateway/service-gateway-manage

In order to make this work you need a Data Gateway installed on a PC/VM/computer. That pc must be able to read that path "\\<server>\bi_shareddata\PowerBI\Reports\Workspaces\BI Team\Files\app_reports.csv". You can check it in browser explorer for example. With this configured, you can add the source in power bi service in manage gateway with that computer windows credentials.

After the source is ok (green check), you can schedule refresh the report.

 

Hope this make sense.


If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

Happy to help!

LaDataWeb Blog

Thanks for reply.

 

Have set up a new gateway source as per below and scheduled the refresh and looks to work o.k for the network share.

 

Have managed also to get sharepoint as source working in desktop.

 

However, when I try set up a data source of sharepoint in service get message below.

 

Any thoughts on how we can set up data source of sharepoint to work in the service with gateway?

 

I have managed to get thsi working without selecting gateway for the sharepoint source as says optional.

 

desktop has Source = SharePoint.Files("https://<company_name>.sharepoint.com/sites/BI/"

 and gateway server has permsiion to see this site.

 

Not sure what to put adavnace settings level - tried all but still not working.

 

sharepoint_gateway_setting.JPG

 

Thanks again.

The configuration I have mentioned is for a shared file in a local network. If you have sharepoint file you don't need to add it in the gateway. You can with auth2 credentials (AD). The windows credentials are just for the local file.

If you have a source in gateway and an online source you need to check this option in gateway configuration to make it work:

https://docs.microsoft.com/en-us/power-bi/connect-data/service-gateway-mashup-on-premises-cloud

With that option activated and the local network file configured in the gateway you might be able to schedule refresh. If you want you can add sharepoint to the gateway too but it's not necessary, you can just enter the credentials when configuring the schedule refresh.

 

 


If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

Happy to help!

LaDataWeb Blog

Thanks for reply.  Using auth2 autnetication thus avoding gateway for the sharepoint source and looks to work o.k.

 

 

Helpful resources

Announcements
Microsoft Fabric Learn Together

Microsoft Fabric Learn Together

Covering the world! 9:00-10:30 AM Sydney, 4:00-5:30 PM CET (Paris/Berlin), 7:00-8:30 PM Mexico City

PBI_APRIL_CAROUSEL1

Power BI Monthly Update - April 2024

Check out the April 2024 Power BI update to learn about new features.

April Fabric Community Update

Fabric Community Update - April 2024

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

Top Solution Authors
Top Kudoed Authors