Loading file from Azure Blob Storage into Azure SQL Database using BULK INSERT

橙三吉。 提交于 2019-12-08 20:42:48

I have tried the t-sql from the github sample that you provide. It works fine. From my test, there are two possibilities that will cause this error:

1) The container name is incorrect

2) the SAS SECRET is incorrect

Based on your description, I think your SAS secret is incorrect. Here is the secret that you used:

SECRET = '?sv=2015-12-11&ss=bfqt&srt=sco&sp=rwdl&st=2017-03-14T17%3A52%3A00Z&se=2017-05-31T16%3A52%3A00Z&sig=f45435435TzrsdsdsdC8wonjDMBG0T0GJj717XetLEWReZ64eOrQE%3D';

As my test, we need to remove '?'. Please try below secret:

SECRET = 'sv=2015-12-11&ss=bfqt&srt=sco&sp=rwdl&st=2017-03-14T17%3A52%3A00Z&se=2017-05-31T16%3A52%3A00Z&sig=f45435435TzrsdsdsdC8wonjDMBG0T0GJj717XetLEWReZ64eOrQE%3D';

For how to generate SAS, please refer to this article.

In my case it was a different problem with SAS Token: it was not valid yet.

I created a token with a default start date (which is the current time in my current time zone). But then it is being evaluated against GMT, which is behind my time.

You can easily test SAS token in Microsoft Azure Storege Explorer. In such case it will show a message like this:

The solution is to modify the start time e.g. to 00:00:00.

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!