如何将Power BI服务连接到Google Cloud Storage (Bucket)



我正在使用Azure Blob Storage,在那里我存储了一些csv文件。然后,我使用这些 csv 文件在 PowerBI 上构建一些仪表板。 Power BI 和 Azure Blob 存储之间的连接很容易。 现在我想使用相同的概念,但只是将Azure Blob Storage替换为Google Cloud Storage Bucket(GCS-B(。 我的问题是,我无法将Power BI连接到GCS-B。有什么想法吗?

经过长时间的谷歌搜索,文档阅读...有我得到的。 - 将 Power BI 服务连接到 google 云存储的唯一方法是将虚拟机作为 Getway 运行,然后在此虚拟机中运行一些脚本,该脚本从 gcs 获取数据,然后将其加载到 Power BI。我认为这不是一个有用的方法。 - 我尝试过并且工作正常,但不幸的是,只有 Power BI 桌面是以下 R 脚本。我在Power Bi中运行作为数据源选项:

wd <-getwd()
setwd(wd)
file.create("service_account.json")
json <- '{"type": "service_account",
"project_id": "xxxxxxx",
"private_key_id": "xxxxx"
"private_key": "-----BEGIN PRIVATE KEY-----\n...
...}'
write(json, "service_account.json")
write(j, "service_account.json")
options(googleAuthR.scopes.selected = "https://www.googleapis.com/auth/cloud- 
platform")
library(googleCloudStorageR)
Sys.setenv("GCS_AUTH_FILE" = "service_account.json")
### optional, if you haven't set environment argument GCS_AUTH_FILE
gcs_auth()
gcs_global_bucket("xxxxx")
gcs_get_global_bucket()
df <- gcs_get_object(gcs_list_objects()$name[[1]])

使用此脚本,可以将第一个 CSV 文件从指定的存储桶加载到 Power BI 桌面。

只需将存储桶或对象公开,如何操作即可阅读此处: 然后从每个文件(列公共访问(复制链接并将其添加到 Power Bi 中,如 Web 源。

最新更新