问题描述
我已经能够使用与googleAuth
和bigQueryR
关联的服务帐户关联的json文件进行身份验证.
I have been able to authenticate using the json file associated with a service account using googleAuth
and bigQueryR
.
# Load Packages
global.packages <- c("bigQueryR", "googleAuthR")
### Apply require on the list of packages; load them quietly
lapply(global.packages, require, character.only = TRUE, quietly = TRUE)
Sys.setenv("GCS_AUTH_FILE" = "json_file_location")
#Authenticate Google BQ
googleAuthR::gar_attach_auto_auth("https://www.googleapis.com/auth/bigquery",
environment_var = "GCS_AUTH_FILE")
这有效,我可以开始使用bigQueryR
中的功能.
This works and I am able to start using functions from bigQueryR
.
现在假设我仅限于bigrquery
程序包,如何使用与此程序包一起使用的服务帐户进行身份验证?
Now assume I am limited to the bigrquery
package, how can I authenticate using a service account with this package?
我看了这里的文档无济于事: https://cran.r-project.org/web/packages/bigrquery/bigrquery.pdf
I have looked at the documentation here to no avail:https://cran.r-project.org/web/packages/bigrquery/bigrquery.pdf
我在互联网上遇到的资源建议使用bigQueryR
软件包代替了bigrquery
.
The resources I have come across on the internet propose using thebigQueryR
package in place of bigrquery
.
例如,这个相关的stackoverflow问题:在闪亮的应用程序中使用bigrquery身份验证.
For instance this related stackoverflow question:Use bigrquery auth in shiny application.
但是我只需要bigrquery
中可用的功能.
But I need functions only available in bigrquery
.
推荐答案
set_service_token()
现在已弃用.
改为使用bq_auth()
:
bq_auth(path = "location_of_service_token.json")
来源: https://rdrr.io/cran/bigrquery/man/bigrquery-deprecated.html
这篇关于如何使用服务帐户和bigrquery软件包进行身份验证?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!