Power BI is turning 10! Tune in for a special live episode on July 24 with behind-the-scenes stories, product evolution highlights, and a sneak peek at what’s in store for the future.
Save the dateEnhance your career with this limited time 50% discount on Fabric and Power BI exams. Ends August 31st. Request your voucher.
Hey,
I wonder if anyone can help
I am trying to run a function which leverages the RSpotify package. It works with no problems within R studio, however, it seems to have issue authorising when I try to run it in the PowerBI R scripter. I wonder if anyone has had a similar issue or has any suggestions?
Error Message: R script error. Error in httpuv::startServer(use$host, use$port, list(call = listen)) : Failed to create server Calls: Check_Genre ... init_oauth2.0 -> oauth_authorize -> oauth_listener -> Execution halted
My Function
ArtistName <- dataset$ArtistName[1] library(devtools) library(Rspotify)
Check_Genre <- function(ArtistName) {
ClientID <- "********************" Client_Secret <- "********************" keys <- spotifyOAuth("RSpotify_Project", ClientID, Client_Secret) ArtistName <- as.vector(ArtistName) artist_info <- length(ArtistName) for(i in 1:length(ArtistName)){ ifelse(length(searchArtist(ArtistName[i], token = keys))>=1, artist_info[i] <- searchArtist(ArtistName[i], token = keys)$genres[1], artist_info[i] <- "") } artist_info } Genre <- Check_Genre(ArtistName) library(wordcloud) library(tm) wordcloud(Genre, random.order = FALSE)
Thanks,
Polly
Solved! Go to Solution.
Hey,
and you should also be aware, that the Power BI Service does not allow to reach out to "foreign" web ressources. So, whatever you do with the Spotify data, the data has to be gathered locally and then published to the Power BI service manually.
There will be no way to configure an automatic refresh that allows running an RScript sourcing a "foreign" web ressource.
Regards
Tom
Hi Polly,
According to my test, the OAuth2 seems needing user interaction. However, Power BI Desktop will halt the R scripts if interactive calls happen. Please refer to desktop-r-scripts#prepare-an-r-script.
>>>Interactive calls in the R script, such as waiting for user input, halts the script’s execution
I wonder if this post could help.
Best Regards,
Dale
Hey Dale,
Ah that's what I feared!
Thanks for your response I'll read the post post and see if I can get it to work
Thanks,
Polly
Hey,
and you should also be aware, that the Power BI Service does not allow to reach out to "foreign" web ressources. So, whatever you do with the Spotify data, the data has to be gathered locally and then published to the Power BI service manually.
There will be no way to configure an automatic refresh that allows running an RScript sourcing a "foreign" web ressource.
Regards
Tom
Thanks guys
Check out the July 2025 Power BI update to learn about new features.
User | Count |
---|---|
73 | |
71 | |
38 | |
28 | |
26 |
User | Count |
---|---|
99 | |
88 | |
62 | |
42 | |
39 |