问题描述
我们已将Web应用程序部署在Azure App Service上.我们的数据库也位于配置为使用AAD身份验证的Azure上(我们已分配AAD管理员).
We have web application deploy on Azure App Service. Our database is also on Azure which is configured to use AAD authentication (We have assigned AAD Admin).
我们正在使用Web应用程序中的以下连接字符串通过以下连接字符串连接到该服务器和数据库.
We are using below connection string in web app to connect to this server and database using below connections string.
请注意:使用本地系统时,此连接字符串可以正常工作.但是,当我们在Azure App Service中使用此conn字符串时,出现以下错误:
Please note: This connection string is working fine when using thru local system. But getting below error when we use this conn string in Azure App Service:
推荐答案
根据您的描述,我发现您使用了 Active Directory集成身份验证.
According to your description, I found you used the Active Directory integrated authentication.
如果您将Web应用发布到Azure,则Azure的Web应用服务器将不在您域的Active Directory中.因此,SQL Server将不会通过身份验证.
If you published the web app to Azure, Azure's web app server will not be in your domain’s Active Directory. So the SQL server will not pass the auth.
我建议您尝试使用 Active Directory密码身份验证,而不是使用Active Directory集成身份验证.
I suggest you could try to use Active Directory password authentication instead of the Active Directory integrated authentication.
使用天蓝色的AD用户名和密码,如下所示替换连接字符串.会很好用的.
Replace the connection string as below use azure AD user name and password. It will work well.
Server=tcp:brandotest.database.windows.net,1433;Initial Catalog=bradnotestsql;Persist Security Info=False;User ID={your_username};Password={your_password};MultipleActiveResultSets=False;Encrypt=True;TrustServerCertificate=False;Authentication="Active Directory Password";
这篇关于无法使用AppService中的Active Directory集成身份验证连接到Azure SQL Server的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!