如何以编程方式生成OAuth2令牌以从AAS访问ADLS [英] how to generate OAuth2 token programmatically to access ADLS from AAS

查看:81
本文介绍了如何以编程方式生成OAuth2令牌以从AAS访问ADLS的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

大家好,

当前,我们在ADLS中托管文件,在表格模型中,我们将ADLS设置为数据源.

当我们通过SSDT进行部署时,一切正常.但是,当我们尝试通过静默模式下的部署向导进行部署时,会发生Erorr:

PS C:\ Users \ xxxx \ Desktop \ AAS部署测试> .\ Microsoft.AnalysisServices.Deployment.exe.\ MVPModel.asdatabase/s
读取输入文件...
完成
连接到xxxxx服务器
在服务器traasdev上找到的数据库MVPModel.正在应用配置设置和选项...
分析配置设置...
完成
分析存储信息...
完成
分析安全信息...
完成
正在生成处理顺序...
将"MVPModel"数据库部署到"xxxx".
JSON DDL请求失败,出现以下错误:无法执行XMLA.返回错误:'为DataLake源提供的凭据无效.(源位于https://xxxxxx.azuredatalakestore.net/Outputs /tabularPOC.).例外 由IDbCommand接口引发.
'..

技术细节:
RootActivityId:cd8e6cc6-312a -------
日期(UTC):2018/10/16下午9:11:58


通过拖放参考bim文件,我们认识到它需要数据源的凭证"属性中的特殊类型的属性.部分.我们通过服务主体生成OAuth2令牌,然后将access_token复制到bim文件:

Hi all, 

Currently we host files in ADLS and in tabular model we set ADLS as data source.

When we deploy through SSDT, everything works fine. But when we trying to deploy through the deployment wizard in silent mode, Erorr happens:

PS C:\Users\xxxx\Desktop\AAS Deployment Test> .\Microsoft.AnalysisServices.Deployment.exe .\MVPModel.asdatabase /s
Reading input files...
Done
Connecting to the xxxxx server
Database, MVPModel, found on server, traasdev. Applying configuration settings and options...
Analyzing configuration settings...
Done
Analyzing storage information...
Done
Analyzing security information...
Done
Generating processing sequence...
Deploying the 'MVPModel' database to 'xxxx'.
The JSON DDL request failed with the following error: Failed to execute XMLA. Error returned: 'The credentials provided for the DataLake source are invalid. (Source at https://xxxxxx.azuredatalakestore.net/Outputs/tabularPOC.). The exception was raised by the IDbCommand interface.
'..

Technical Details:
RootActivityId: cd8e6cc6-312a-------
Date (UTC): 10/16/2018 9:11:58 PM


By reference the bim file through drag and drop, we realize that the it requires special kind of properties in the DataSource's "credential" section. We generate the OAuth2 token through service principal and copy the access_token to the bim file:

凭据":{
          "AuthenticationKind":"OAuth2",
          种类":"DataLake",
          路径":"https://xxxxxx.azuredatalakestore.net/",
          "Expires":星期二,2018年10月16日22:07:51 GMT",
          "RefreshToken":"xxxxx",
          " token_type" ;:" xxxxx" ;,
          "scope":"********",
          "ext_expires_in":"********",
          " expires_on":"********",
          " not_before":"********",
          资源":"********",   //资源应该是什么? ?
          " id_token" ;:" xxxxx" ;,
          " AccessToken" ;:" xxxxx"
        }

"credential": {
          "AuthenticationKind": "OAuth2",
          "kind": "DataLake",
          "path": "https://xxxxxx.azuredatalakestore.net/",
          "Expires": "Tue, 16 Oct 2018 22:07:51 GMT",
          "RefreshToken": "xxxxx",
          "token_type": "xxxxx",
          "scope": "********",
          "ext_expires_in": "********",
          "expires_on": "********",
          "not_before": "********",
          "resource": "********",    //whats the resource should be? ?
          "id_token": "xxxxx",
          "AccessToken": "xxxxx"
        }

有人可以分享一些有关如何以编程方式获取OAuth2令牌的想法吗?

谢谢



大卫

Could someone please share some ideas how to get the OAuth2 tokens programmatically

Thanks,



David

推荐答案

您使用的是哪个版本的ADLS? v1还是v2?

What version of ADLS are you using?  v1 or v2?

还要尝试使用哪种编程语言生成OAuth2令牌?

Also, what programming language are you trying to generate an OAuth2 token in?

谢谢.

詹姆斯


这篇关于如何以编程方式生成OAuth2令牌以从AAS访问ADLS的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆