我将我的 .net core web api 部署到 azure,现在每当我向它发出请求时它都会响应 500。它使用实体框架,数据库也部署在 azure 上。它在 localhost iis express 上运行良好。这是我的 appsettings.json。出于安全原因,我更改了连接字符串,它实际上具有实际值。我如何获得有关此错误的更多信息或如何解决它?
"Logging": {
"LogLevel": {
"Default": "Information",
"Microsoft": "Warning",
"Microsoft.Hosting.Lifetime": "Information"
}
},
"ConnectionString": {
"prodSchoolProjectDB": "Server={serverName},1433;Initial Catalog=SchoolProjectDB;Persist Security Info=False;User ID={databaseId};Password={databasePassword};MultipleActiveResultSets=True;Encrypt=True;TrustServerCertificate=False;Connection Timeout=30;"
},
"AllowedHosts": "*"
} ```
我通过进入部署在 azure 上的数据库的防火墙设置解决了这个问题,并激活了 azure 服务的权限。
本文收集自互联网,转载请注明来源。
如有侵权,请联系 [email protected] 删除。
我来说两句