Azure AD Service Principal authentication to SQL DB Using Entity frame work code first approach - entity-framework

we have existing Web API application with EF-code first approach and completed the code using linq queries and its working fine.
Now we got new requirement we have to use Azure AD service principal authentication to SQL DB and received below setting from client.
with reference of below article am successfully establish the connection but am not getting any articles for how can we use dbcontext class for authentication and connection to DB.
Azure AD Service Principal authentication to SQL DB Using Entity frame work code first approach

Related

Using Managed Identity on Azure SQL Managed Instance for Dacpac deployment in AzureDevOps

I am trying to configure Azure Key Vault and setup Managed Identities for use in CI/CD pipeline for Azure Dev Ops.
I have looked around in MSDN documentation but I only specific links for use with Azure SQL and we are using Azure SQL Managed Instances.
If I did not make any misunderstand, in fact, you want to use Managed Identity work with Azure SQL Managed Instance? If this, unfortunately to say, the Managed Identity could not work with Azure SQL Managed Instance. Please see this doc: Services that support managed identities for Azure resources. It list all of the Azure services name which support work with the Managed identities in great detail.
You can see for SQL database, it only support the integration with Azure SQL instead of Azure SQL Managed Instance. That's why you only see the doc link for the usage with Azure SQL.
Until now, the Azure SQL managed instance only support two authentication method:
SQL Authentication:
This authentication method uses a username and password.
Azure Active Directory Authentication:
This authentication method uses identities managed by Azure Active
Directory and is supported for managed and integrated domains. Use
Active Directory authentication (integrated security) whenever
possible.
You can refer to this thread: Managed Identity with Azure SQL Managed Instance?. In this thread, out engineer provided some work around if you trying to configure the app with Managed Identity.

Spring data mongo Multi tenant support

I have a requirement to enable multi tenant support for a spring boot application, it uses mongodb ,requirement is to use separate database based on tenant login.
Each request of REST service call will have the tenant information in header.Based on the tenant retrieved from service request, application should connect to corresponding database.

EF Code First Migration, performance issues when not using admin account in SQL Azure

We've built a web tool (C# WebAPI) to administrate migration of SQL Azure databases with Entity Framework Code First Migrations.
By default, when we create databases we also create logins and user accounts per database.
These accounts get db_datareader and db_datawriter permissions.
We use these accounts from the web app to connect to the database to get current migrations and if there are any pending migrations, apply them.
For some reason, this operation takes about 10 seconds every time (without applying any updates).
If we use the admin account (associated when setting up the sql server in Azure) instead the time drops to less than a second.
I've come to the conclusion that there must be some kind of permission thing that gives us the decrease of performance.
I've added db_ddladmin role explained here without any success.
We use the DbMigrator class in Entity Framework Migrations to get pending migrations.
After some more investigation I found out that the solution to the problem is to create sql users in the master database also.
Before we only created logins and a corresponding user in the database.
According to this post SQL Azure doesn't support default database and therefore it defaults to the master database were I didn't have any rights.
Adding user to the master database solved the "performance" issue.

Connect to backend of VSO

Is there a way to get the server info of my VSO account and access using SQL Server?
I've tried logging in using the URL
{account}.visualstudio.com
But I got a sever not found error
No, the back-end databases are SQL Azure instances, different from the TFS on-premise databases. I cannot see MS ever giving you access to the database - maybe the data, but not the database.
You can only use the API (old and new REST) and Power BI tools to perform queries.
If you have a specific problem you are trying to solve, post it as a new question because it may be possible without database access.

SharePoint Online in Office 365 with SQL Azure and Entity Framework

I am trying to build a web part to be hosted on SharePoint online (part of Office 365). I want to use Entity Framework to connect to a DB in SQL Azure. Is this even possible? I tried deploying one solution, but I get very unhelpful error saying "Web Part Error: Sandboxed code execution request failed.".
Anyone get this combination working?
I found out that this is not possible. The reason is due to the restricted permissions in the Sandbox and cannot use a proxy to bypass that. The only way to access SQL Azure from within SharePoint online in Office 365 is via a web service exposing operations on the entities residing in SQL Azure. I am currently investigating that approach and once I have more info, I can update this answer.
Update 7/27: Using a web service serving SQL Azure data, we can integrate SQL Azure with SharePoint. The component in SharePoint that enables this integration is called 'Business Connectivity Services'.
More can be found here: http://blogs.msdn.com/b/donovanf/archive/2012/06/25/office-365-o365-business-connectivity-services-bcs-hands-on-lab-wiring-up-o365-bcs-to-a-windows-azure-service-for-office-2010-and-sharepoint-online-solutions.aspx