具有函数应用程序和 sql 数据库的托管服务标识

Managed service identity with function app and sql database

我们已经将托管服务标识与 azure 函数和 sql 数据库集成在一起,它在 azure 环境中工作正常,但当我们从本地环境连接时出现问题,函数应用程序无法连接到数据库,我们已遵循以下文档 https://docs.microsoft.com/en-us/azure/app-service/app-service-web-tutorial-connect-msi.

中给出的步骤

通过 msi 集成从 Visual studio 连接到 sql 数据库是否存在任何已知问题?

您的本地用户在 SQL 数据库中没有访问权限的可能原因有几个。

请参考博文postManaged Identity - Part III。其中,它包含以下信息:

Apparently, when using a Microsoft account (mine’s an Outlook.com one, migrated over from the good old Hotmail days) you need to explicitly specify the tenant id you want to use. This can either be the Directory ID of your Azure Active Directory that you can find on the Azure Active Directory properties blade, or the xxx.onmicrosoft.com name associated with it.