We are developing an Azure SQL Database with an associated REST API. The API is implemented with an Azure App Service using .NET Core. I would like to get a log or output in some form of every call into the API for some time period, including the following items for each call:
- entire URL and parameters
- response time
I would think this information is available somewhere. I have read and watched a considerable volume of tutorial material about Azure and App Insights without finding it, as well as explored the Dashboard and App Insights in our Azure portal. How can I get this information?
Here is how you can add the application insight and get the benefit out of it.This procedure configures your ASP.NET web app to send telemetry to the Azure Application Insights service. It works for ASP.NET apps that are hosted either in your own IIS server on-premises or in the Cloud. You get charts and a powerful query language that help you understand the performance of your app and how people are using it, plus automatic alerts on failures or performance issues.
Prerequisites
To add Application Insights to your ASP.NET website, you need to:
Install Visual Studio 2017 for Windows with the following workloads:
ASP.NET and web development
Azure development
1) Add the application insights sdk
Right-click your web app name in the Solution Explorer, and choose Configure Application Insights
Application Insights Configuration screen:
Select Start Free.
If you want to set the resource group or the location where your data is stored, click Configure settings. Resource groups are used to control access to data. For example, if you have several apps that form part of the same system, you might put their Application Insights data in the same resource group.
Select register
Telemetry will be sent to the Azure portal, both during debugging and after you have published your app.
2) Run your app
Run your app with F5. Open different pages to generate some telemetry.
In Visual Studio, you will see a count of the events that have been logged.
3) See your telemetry
You can see your telemetry either in Visual Studio or in the Application Insights web portal. Search telemetry in Visual Studio to help you debug your app. Monitor performance and usage in the web portal when your system is live.
Telemetry in visual studio
Telemetry in Azure portal
You can also see telemetry in the Application Insights web portal (unless you chose to install only the SDK). The portal has more charts, analytic tools, and cross-component views than Visual Studio. The portal also provides alerts.
Open your Application Insights resource. Either sign into the Azure portal and find it there, or select Solution Explorer > Connected Services > right-click Application Insights > Open Application Insights Portal and let it take you there.
The portal opens on a view of the telemetry from your app.
4) You can finally publish your app and your are good to proceed.
for further information please refer
https://docs.microsoft.com/en-us/azure/azure-monitor/app/app-insights-dashboards