Azure的Web应用程序和.Net核心Web API - 缺失的Web.config

问题描述 投票:0回答:1

从我的理解.NetCore不再使用/需要web.config中 - 而是选择appsettings.json。

我有我想举办在Azure的Web应用程序。净核心Web API。我已经发布了API的Web应用程序,但我不断收到500错误。展望在应用程序日志,我可以看到,错误的是:

IIS was not able to access the web.config file for the web site or application.

我糊涂了。如果.NetCore使用appsettings.json代替web.config文件和Azure的将不是没有web.config中工作,如何一个应该主办Azure中的.NetCore应用程序?

UPDATE

我现在认识到这有没有关系的web.config感谢@乔伊才指着我在正确的方向。

看来,天青不喜欢我尝试使用Azure的Active Directory验证我的连接字符串。我改变了我的连接字符串简单地使用SQL身份验证和一切工作。所以我想我的问题是,我该如何使用AAD验证了我的连接字符串,而不是SQL身份验证。

This SO thread似乎表明我的连接字符串确实已正确设置了AAD认证,但我得到的错误:

Keyword not supported: 'authentication' 

每当我使用的连接字符串,如下所示:

Server=tcp:dbname.database.windows.net,1433;Initial Catalog=dbnamesqldb;Persist Security Info=False;User ID={your_username};Password={your_password};MultipleActiveResultSets=False;Encrypt=True;TrustServerCertificate=False;Authentication="Active Directory Password";

由于这个问题现在已经改变了,I'm going to create a new post with the new question

azure asp.net-core azure-web-sites
1个回答
0
投票

这是否意味着我必须we.config?如果是的话,可以把它只是一个空文件?

当你部署.NET核心项目天青,你可以去https://xxxxx.scm.azurewebsites.net并单击Debug console> CMD > site > wwwroot > web.config.web.config将在那里。

尝试删除该网站在蔚蓝和蔚蓝recreat网站。此外,尝试运行,你是通过运行dotnet MyApp.dll并确保工作部署应用程序。你需要更多的细节,为什么它有一个应用程序的问题。这可能帮助。也可以考虑使用一个自包含的应用程序测试。也可以尝试在蔚蓝的应用服务安装asp.net core extension

有关详细信息,你可以参考Deploy ASP.NET Core apps to Azure App Service

© www.soinside.com 2019 - 2024. All rights reserved.