Quantcast
Channel: Azure Active Directory forum
Viewing all articles
Browse latest Browse all 16000

Setup Azure AAD Integrated Authentication for Azure SQL DB accessed through Entity Framework DB First Approach

$
0
0

Hello,

We are facing an issue implementing the Azure Integrated Authentication for our application.

Approach1

We tried fetching the Access Token via the Service Principle but we are not able to use the SQLConnection class to pass it to our DBContext’s constructor since we use the DBFirst approach. We need to pass the EntityConnection instead. But EntityConnection does not have a property Access Token. ref (http://colinsalmcorner.com/post/configuring-aad-authentication-to-azure-sql-databases)

So we could not go forward with that approach.

Approach 2

Currently we are trying to go through this link here. (ref: https://docs.microsoft.com/en-us/azure/sql-database/sql-database-aad-authentication-configure)

When we try publishing the APP and hit it we get following errors:

  • "Keyword not supported: 'metadata'."
  • Unable to cast object of type 'System.Data.SqlClient.SqlConnection' to type 'System.Data.Entity.Core.EntityClient.EntityConnection and Keyword not supported: 'metadata'.

And when we try running it on local, we do not get the above errors. But since it runs anonymously from the browser, we get the error -"Authorization has been denied for this request." Which is obvious.

Looking out a way how we could test approach#2. To find out whether it even works or not. Or any other approach to get Azure Active Directory Integrated authentication with SQL Database.


Viewing all articles
Browse latest Browse all 16000

Trending Articles