Search code examples
c#azureazure-data-factoryclientcredential

Where can I find "authenticationKey" value in azure application for creating "ClientCredential" object


I would like to transfer data from Azure Blob to Azure SQL Database using Azure Data Factory. I found this link : Copy data from Azure Blob to Azure SQL Database using Azure Data Factory

EDIT : I need to connect to my Azure Subscription to create a Data Factory and a Pipe line.

My problem is to find value for "authenticationKey".

string authenticationKey = "<your authentication key for the application>";

I need to create a "ClientCredential" like below code :

// Authenticate and create a data factory management client
var context = new AuthenticationContext("https://login.windows.net/" + tenantID);
ClientCredential cc = new ClientCredential(applicationId, authenticationKey);
AuthenticationResult result = 
context.AcquireTokenAsync("https://management.azure.com/", cc).Result;
ServiceClientCredentials cred = new TokenCredentials(result.AccessToken);
var client = new DataFactoryManagementClient(cred) { SubscriptionId = subscriptionId };

you can see in below image my application registration in azure.

enter image description here


Solution

  • Basically your authentication key is the secret key of your application registered in Active directory.

    Please find the details here how to retrieve your secret/authentication key here.https://stackoverflow.com/a/57849682/4111181