kerems
kerems

Reputation: 11

.net core web api responding with 500 when published to azure

I deployed my .net core web api to azure and now it responds with 500 whenever i make a request to it. It uses entity framework with the database also deployed on azure. It works perfectly fine on localhost iis express. Here is my appsetings.json. I have changed the connection string for security reasons, it actually has real values in it. How can i get more information about this error or how can i solve it?

  "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": "*"
} ```

Upvotes: 1

Views: 115

Answers (2)

kerems
kerems

Reputation: 11

I solved the problem by going into firewall settings of my database which is deployed on azure and activated the permission of azure services.

Upvotes: 0

Kamran
Kamran

Reputation: 1380

For start, you can go enable "App Service logs" blade under Monitoring section and enable "Application Logging (Filesystem)", then go to "Log stream". While you have the logs, send another request or just restart your app. You should be able to see more details.

Upvotes: 1

Related Questions