@Haruka Ichinose, Thank you for posting this question on Microsoft Q&A and welcome.
Please find below the answer your questions:
- Azure Monitor is the umbrella under which multiple solutions are placed. Each of these solutions are applicable to collect/analyze and respond to monitoring data. For more details, see Azure Monitor overview
Application Insights is part of Azure Monitor for Application Performance Management (APM) for live web applications. - For your use case, you need the ApplicationInsights API which you have mentioned in the question. The other API - Azure Monitor Metrics Get is to query the metrics telemetry stored in Azure Monitor. This is the metric that you see when you go to "Metrics" menu for any resource. The data collected by ApplicationInsights is stored as logs in a log Analytics workspace.
- The REST API for Application Insights Query - Get is an option to use query the result back, which is collected by ApplicationInsights.
There is a JavaScript SDK library as well for it as available here - LogsQueryClient class. However, this queries the backend log analytics workspace and not the ApplicationInsights resource itself. Therefore, the table names will be different (even though they contain the same information) - Table schemas
To summarize, when you try to query information from ApplicationInsights, the table name used will be slightly different from when you query the LA workspace. - Regarding API Access, see Log Analytics API authentication. The configure API option is to help quickly explore the API without using Microsoft Entra Authentication (App Registration). If your registered App has the authorization to query ApplicationInsights data. You can add the Monitoring Reader role to the App Service principal and you should be able to use it for query instead of API key.
Hope this helps.
If the answer did not help, please add more context/follow-up question for it. Else, if the answer helped, please click Accept answer so that it can help others in the community looking for help on similar topics.