Detailed log was found at this path :
Keep in mind that your appsettings.json file was not deployed
You need to add SqlConnection string in your app with prefix as explained : Configure Connection Strings
This browser is no longer supported.
Upgrade to Microsoft Edge to take advantage of the latest features, security updates, and technical support.
When I run my simple CRUD app on localhost it works really good.
Hint: It is using SQL server to insert data and server is hosted on my Azure Subscription inside same Resource Group
Deployed app : myAzureWebsitesLink.net
Not working route : School - Region - Countries
On Azure SQL Server - Networking this is my props
appsettings.json
{
"Logging": {
"LogLevel": {
"Default": "Information",
"Microsoft.AspNetCore": "Warning"
}
},
"AllowedHosts": "*",
"ConnectionStrings": {
"AZURE_SQL_CONNECTIONSTRING": "Server=tcp....database.windows.net,1433;Initial Catalog=myDB;Persist Security Info=False;User ID=myUser;Password=myPW;MultipleActiveResultSets=False;Encrypt=True;TrustServerCertificate=False;Connection Timeout=120;"
}
CountriesController.cs
using System;
using System.Collections.Generic;
using System.Linq;
using System.Threading.Tasks;
using Microsoft.AspNetCore.Mvc;
using Microsoft.AspNetCore.Mvc.Rendering;
using Microsoft.EntityFrameworkCore;
using Models;
namespace Controllers
{
public class CountriesController : Controller
{
private readonly ApplicationDbContext _context;
public CountriesController(ApplicationDbContext context)
{
_context = context;
}
// GET: Products
public async Task
Detailed log was found at this path :
Keep in mind that your appsettings.json file was not deployed
You need to add SqlConnection string in your app with prefix as explained : Configure Connection Strings