我在尝试从Azure Sql数据库访问Azure Blob存储并上传单个Blob /图像时遇到以下问题。得到以上。我已经配置了SAS。这是我的发现:
“执行查询失败。错误:由于无法打开文件” POC.png“,无法批量加载。操作系统错误代码5(访问被拒绝。)”
CREATE DATABASE SCOPED CREDENTIAL MyAzureBlobStorageCredential
WITH IDENTITY = 'SHARED ACCESS SIGNATURE',
SECRET = 'sv=2018-03-28....'
go
CREATE EXTERNAL DATA SOURCE MyAzureBlobStorage
WITH ( TYPE = BLOB_STORAGE,
LOCATION = 'https://poc.blob.core.windows.net/poc-container',
CREDENTIAL = MyAzureBlobStorageCredential);
go
INSERT INTO file111 (col2)
SELECT BulkColumn FROM OPENROWSET(
BULK 'POC.png',
DATA_SOURCE = 'MyAzureBlobStorage',
SINGLE_BLOB
) AS DataFile;
我所做的是:
并且有效。任何可能导致上述错误信息的项目符号。