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

Calling all Data Engineers! Fabric Data Engineer (Exam DP-700) live sessions are back! Starting October 16th. Sign up.

Reply
Anonymous
Not applicable

library ssh in R

Hello all,

I have a simplified R script below that works fine in Power BI Desktop but no more in Power BI Service, the reason is that the library ssh I am using is not supported in Power BI Service ("Error in library("ssh") : there is no package called 'ssh'")

For some reason, despite ssh library  CRAN - Package ssh (r-project.org) is an official package it is not part of the list of supported ones Learn which R packages are supported - Power BI | Microsoft Docs

 

Any idea for another solution? I am thinking about RCurl library but I don't see why we need to provide both public and private keys in scp_upload and I don't see how to build a temporary pkey file (containing private key) and to pass it to scp_upload...

I think I need help to port the below lines from ssh to RCurl (if RCurl is a good B-plan candidate)

 

 

 

# pkey: Cloud private key .pem format
pkey<-tempfile()
write("-----BEGIN RSA PRIVATE KEY-----
MIIEowIBAAKCAQEA5Vl3nEh3NZRE1p2ek3Xb81GtOrwgqwCtFsS9oUeT5pjmkYmh
../..
-----END RSA PRIVATE KEY-----",pkey)

# csv generated file, dummy case
csv1<-tempfile(pattern="nodes",fileext=".csv")
write.csv(1:10,csv1)

# upload file using ssh private key
library("ssh")
session<-ssh_connect("root@10.157.211.173",keyfile=pkey)
scp_upload(session,csv1,to="/var/lib/neo4j/import")

 

 

 

 

 

 

 

1 ACCEPTED SOLUTION
Anonymous
Not applicable

I think I found a way, based on One Drive + Power Automate to upload on Sharepoint or Task Scheduler to upload a server using curl or pscp

 

Example : source is writetonedrive.csv file 2 columns F and Rem

"Fid","Rem"
"FA",14
"FB",19

1/ in Power BI report, open source located in your OneDrive. Take care of path format that should not contain the /:x/r/ added by default for browser compatibility matrix

If your path has the /:x/r/ you don't have OAuth2 as credential in Power BI Service

 

let
Source = Csv.Document(Web.Contents("https://nokia-my.sharepoint.com/personal/stephane.../writetoonedrive.csv"),[Delimiter=",", Columns=2, Encoding=1252, QuoteStyle=QuoteStyle.None]),
#"Promoted Headers" = Table.PromoteHeaders(Source, [PromoteAllScalars=true]),
#"Changed Type" = Table.TransformColumnTypes(#"Promoted Headers",{{"Fid", type text}, {"Rem", Int64.Type}})
in
#"Changed Type"

 

2/ in R script, here simple code is just substracting 1 to Rem field

# basic code
dataset$Rem<-dataset$Rem-1

# saving in same writetoonedrive.csv (update)
write.table(dataset,file='C:/Users/chalon1/OneDrive.../writetoonedrive.csv', sep=",", append=F, row.names=F)

library(gridExtra)
gridExtra::grid.table(dataset)

 

3/ in Power BI Service, you can edit the credentials using OAuth2 and you can schedule a refresh.

View solution in original post

2 REPLIES 2
Anonymous
Not applicable

I think I found a way, based on One Drive + Power Automate to upload on Sharepoint or Task Scheduler to upload a server using curl or pscp

 

Example : source is writetonedrive.csv file 2 columns F and Rem

"Fid","Rem"
"FA",14
"FB",19

1/ in Power BI report, open source located in your OneDrive. Take care of path format that should not contain the /:x/r/ added by default for browser compatibility matrix

If your path has the /:x/r/ you don't have OAuth2 as credential in Power BI Service

 

let
Source = Csv.Document(Web.Contents("https://nokia-my.sharepoint.com/personal/stephane.../writetoonedrive.csv"),[Delimiter=",", Columns=2, Encoding=1252, QuoteStyle=QuoteStyle.None]),
#"Promoted Headers" = Table.PromoteHeaders(Source, [PromoteAllScalars=true]),
#"Changed Type" = Table.TransformColumnTypes(#"Promoted Headers",{{"Fid", type text}, {"Rem", Int64.Type}})
in
#"Changed Type"

 

2/ in R script, here simple code is just substracting 1 to Rem field

# basic code
dataset$Rem<-dataset$Rem-1

# saving in same writetoonedrive.csv (update)
write.table(dataset,file='C:/Users/chalon1/OneDrive.../writetoonedrive.csv', sep=",", append=F, row.names=F)

library(gridExtra)
gridExtra::grid.table(dataset)

 

3/ in Power BI Service, you can edit the credentials using OAuth2 and you can schedule a refresh.

lbendlin
Super User
Super User

Power BI is a sink, not a source. Use different tools to push your data into other systems.

Helpful resources

Announcements
FabCon Global Hackathon Carousel

FabCon Global Hackathon

Join the Fabric FabCon Global Hackathon—running virtually through Nov 3. Open to all skill levels. $10,000 in prizes!

September Power BI Update Carousel

Power BI Monthly Update - September 2025

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

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.

Top Solution Authors
Top Kudoed Authors