如何使用Rest API将数据加载到Azure Datalake存储Gen2的表数据存储中 [英] How To load Data into Table data storage of Azure Datalake storage Gen2 using Rest API
问题描述
我想使用rest api加载数据或在Azure数据存储gen2的表数据存储中创建一个表。我正在尝试连接表数据存储但我得到
ResourceNotFound 错误(尝试获取至少连接的详细信息)。我使用了共享密钥身份验证。有人可以帮我解决这个问题吗?
I want to load the data or create a table into Table data storage of Azure datalake storage gen2 using rest api.I'm trying to connect the table data store but i'm getting
ResourceNotFound error while running the below request method(trying to get the details atleast for connecting).I have used shared key authentication. Can someone help me on this issue?
方法:获取
URI : https://Testacnt.table.core。 windows.net/Tables
HEADERS :
授权:SharedKey Testacnt:************** / ==
内容类型:application / json
x-ms-version:2011-08-18
日期:2019-05 -21
Authorisation:SharedKey Testacnt:**************/==
Content-Type:application/json
x-ms-version:2011-08-18
Date:2019-05-21
授权: API密钥:
密钥:SharedKey
key:SharedKey
值: Testacnt:************* ******** / ==
推荐答案
嗨Naveen,
Hi Naveen,
一种简单的方法是使用SAS(共享访问签名)。为此,请执行以下操作:
An easy way to do so is by using SAS (Shared Access Signature). To do so, please do the following :
- 打开您的门户网站中的存储帐户。
- 转到设置下的"共享访问签名"。
- 点击"生成SAS和连接字符串":
- 生成后,复制SAS令牌,如下所示:
- 在您的POST请求中,URI应该在表单中:
https://<存储帐户名称> .table.core.windows.net / Tables< SAS令牌> - 您需要设置以下标题:
Content-Type:application / json
x-ms-version: 2018-11-09
日期:<当前日期> eg-
Wed,22 May 2019 13:25:00 GMT - 在请求正文中,包括:
{
" TableName" ;:<表名>
}
- open your storage account in the portal.
- Go to "Shared Access Signature" under settings.
- Click on "Generate SAS and connection string" :
- Once generated, copy the SAS token as shown below :
- In your POST request the URI should be in the form :
https://<storage account name>.table.core.windows.net/Tables<SAS token> - You need to set the following headers :
Content-Type : application/json
x-ms-version : 2018-11-09
Date : <current date> eg- Wed, 22 May 2019 13:25:00 GMT - In the body of the request, include :
{
"TableName":<table name>
}
希望这会有所帮助。
这篇关于如何使用Rest API将数据加载到Azure Datalake存储Gen2的表数据存储中的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!