Hi @Siba
Have a look at the Deploy an ASP.NET Core and Azure SQL Database app to Azure App Service - Azure App Service | Microsoft Learn tutorial.
Here are somethings I would do to resolve the issue.
First, remove the VNet integration if you don't intend to use it. Using a sql username/password, connect locally from your machine using SSMS and connecting using the connection string from the resource itself or search for the instance under Azure in the SQL Data Explorer inside Visual Studio; see Connect and query - Azure SQL Database & Azure SQL Managed Instance | Microsoft Learn for more details. Make sure you allow your public IP. Once that's confirmed working, take that same connection string and add it to the application as an app setting. Depending on the runtime, load that app setting as an environment variable in your codebase and configure your SQL connection to use it. Make sure you enable logging to observe any issues. You can also use the app service advanced tools to connect to the kudu environment and use a terminal to ping <server-name>database.windows.net
. If you don't get a response, then check the network connectivity on the managed instance.
If your app doesn't report any issues and you SQL connection object is able to query your database, then enable your application to use a system managed identity and add that identity to your SQL database with db_datareader and db_datawriter DB roles. See Tutorial: Access Azure databases with managed identity - Azure App Service | Microsoft Learn for the step-by-step.
After all that, make sure you go back to your Azure SQL resources firewall settings and remove your public IP entry.