Synapse server credential using key vault

Rock 41 Reputation points
2021-10-07T15:15:00.47+00:00

Hi

I want to create a server-level or database scoped credential with azure Key vault in a Synapse workspace. Below is the example from MS

/* Setup - create server-level or database scoped credential with Azure Cosmos DB account key:
CREATE CREDENTIAL MyCosmosDbAccountCredential
WITH IDENTITY = 'SHARED ACCESS SIGNATURE', SECRET = 's5zarR2pT0JWH9k8roipnWxUYBegOuFGjJpSjGlR36y86cW0GQ6RaaG8kGjsRAQoWMw1QKTkkX8HQtFpJjC8Hg==';
*/

SELECT TOP 10 *
FROM OPENROWSET(
PROVIDER = 'CosmosDB',
CONNECTION = 'Account=synapselink-cosmosdb-sqlsample;Database=covid',
OBJECT = 'Ecdc',
SERVER_CREDENTIAL = 'MyCosmosDbAccountCredential'
) with ( date_rep varchar(20), cases bigint, geo_id varchar(6) ) as rows

Instead of using Cosmos db key can we create a credential by using a key vault?

I tried to use below syntax but getting an error ' Incorrect syntax near 'IDENTITY'.

CREATE CREDENTIAL Azure_DF_Test
WITH IDENTITY = 'ContosoKeyVault',
SECRET = 'EF5C8E094D2A4A769998D93440D8115DSECRET_DBEngine'
FOR CRYPTOGRAPHIC PROVIDER AzureKeyVault_EKM_Prov ;

Thank you

Azure Synapse Analytics
Azure Synapse Analytics
An Azure analytics service that brings together data integration, enterprise data warehousing, and big data analytics. Previously known as Azure SQL Data Warehouse.
4,657 questions
{count} votes

2 answers

Sort by: Most helpful
  1. PRADEEPCHEEKATLA-MSFT 85,026 Reputation points Microsoft Employee
    2021-10-08T06:36:37.547+00:00

    Hello @Rock ,

    Thanks for the question and using MS Q&A platform.

    Azure SQL Database only supports Azure Key Vault and Shared Access Signature identities.

    138781-image.png

    For more details, refer to CREATE CREDENTIAL (Transact-SQL).

    Hope this will help. Please let us know if any further queries.

    ------------------------------

    • Please don't forget to click on 130616-image.png or upvote 130671-image.png button whenever the information provided helps you. Original posters help the community find answers faster by identifying the correct answer. Here is how
    • Want a reminder to come back and check responses? Here is how to subscribe to a notification
    • If you are interested in joining the VM program and help shape the future of Q&A: Here is how you can be part of Q&A Volunteer Moderators

  2. Sahil Bansal 6 Reputation points
    2021-11-09T13:13:45.937+00:00

    CREATE DATABASE SCOPED CREDENTIAL MyCosmosDbAccountCredential
    WITH IDENTITY = 'SHARED ACCESS SIGNATURE',
    SECRET = 's5zarR2pT0JWH9k8roipnWxUYBegOuFGjJpSjGlR36y86cW0GQ6RaaG8kGjsRAQoWMw1QKTkkX8HQtFpJjC8Hg==';

    The above statement is not working in Azure Synapse Studio for Serverless SQL database pool.
    and returning below error:

    Incorrect syntax near 'IDENTITY'.

    Kindly suggest @PRADEEPCHEEKATLA-MSFT

    Thanks