Hi,
I hope it's the correct forum.
I have a special question regarding sql server 2016 and access flat files via azure blob storage with polybase.
If I want to create an external data source or select from existing external tables with sql authentication, it doesn't work. I get the following error:
Msg 7416, Level 16, State 2, Line 21
Access to the remote server is denied because no login-mapping exists.
With windows authentication it works (logged in local admin account on the virtual machine I connect to the sql server instance via SSMS). I can select from the external tables and create external datasources.
It's a virtual machine with sql server 2016 installed in azure. I just created a sql user login for jobs or other processes. The sql user should also be able to create external data sources / select from external tables.
I don't know what to do here. I don't find anything regarding polybase with sql authentication on google and I only find solutions regarding linked server. But I don't have a linked server. I only want to select from azure blob storage via SQL.
I found everything on https://msdn.microsoft.com/en-us/library/dn935022.aspx. But it only works with windows login directly on the server. Here is the code:
CREATE MASTER KEY ENCRYPTION BY PASSWORD = <password>;
CREATE DATABASE SCOPED CREDENTIAL BlobCredential
WITH
IDENTITY = <identity>,
SECRET = <secret key to access blob>
;
CREATE EXTERNAL DATA SOURCE BlobContainer
WITH
(
TYPE = HADOOP,
LOCATION = 'wasbs://<container>@<storageacc>.blob.core.windows.net',
CREDENTIAL = BlobCredential
);
CREATE EXTERNAL FILE FORMAT FlatFile WITH
(
FORMAT_TYPE = DELIMITEDTEXT,
FORMAT_OPTIONS
(
FIELD_TERMINATOR = '|', -- column delimiter
USE_TYPE_DEFAULT = TRUE
)
);
CREATE EXTERNAL TABLE [stg].[TestTable]
(
[...]
)
WITH
(
LOCATION='/Flat/',
DATA_SOURCE = BlobContainer,
FILE_FORMAT = FlatFile,
REJECT_TYPE = VALUE,
REJECT_VALUE = 1
);
Maybe someone has any idea where I can set the login-mapping or something else, so that I can also access external tables with the sql login ?
Thanks in advance !