Azure Application Insights in API Management - Does it logs Information logged in backend api - ibm-api-management

I have an existing api developed in asp.net core. It has loggings implemented in it and logging the information in application insights. I have to deploy the api un api management. I have done that successfully and i have configured my application insights logging in api management.
Should my backend api logs be logged in api management application insights. Should i remove the instrumentation key from app settings of .net core application.
Is there any way to get the backend api logs traced in api management application insights. Do i need to mention the instrumentation key of api management application insights in my .net core api, If yes then what is the point of having api management configured with app insights

Related

Trigger Azure AD Protected API hosted in Azure Web Apps from Power Automate

We have a Web API hosted in Azure as an Azure Web App. This API requires an access token from our Azure AD to authenticate. This API works when triggered via http from a client application. However, we need to trigger this API to run on a schedule as well and thought Power Automate would be a useful tool here as we can schedule an authenticated http request (but are open to alternative solutions).
This is the basic flow we were considering:
We have registered the Power Automate flow as an App Registration in our Azure AD, we get a valid access token, however, when we call the API I can see from Application Insights that we are getting an Unauthorized Error because neither scope nor roles are specified in the token claims. How can we call this Azure AD Protected API from Power Automate?
Note:
We are not using azure functions to schedule this job because we
require a predictable IP and we already have a Azure App Service
Plan to host this API.
We need this API to run on a schedule, but also be triggerable via
http
We have tested this in our local environment, it is working fine. The below statements are based on our analysis.
We have created a Web app (running with .NET 6 as run-time stack & windows OS), enabled Application insights & published a sample web application which has 2 pages(home, privacy) from our local Visual Studio code 2022.
In order to call one of the web app pages (privacy) from the Power-automate HTTP trigger, we have enabled Authentication to the web app which has created app registration in the Azure AD with User.Read as Delegated Permission.
Post enabling the Authentication, we are able to call the web app privacy page from power-automate without any issue. All the requests that were triggered from power automate are showing success in the application insights as well.
Here is the sample output for reference:
In the below screenshot, using HTTP trigger we have called the webapp & requested got success even in application insights as well.
Note:
We would suggest you to check whether you have given the correct client id , secret values & app registration permissions (User.Read) in HTTP trigger of power-automate.

Develop and deploy App service of type API app in Azure using .net core web application project

Requirement : Create a API app in Azure with OAuth2.0 authorization, which will communicate with Azure Service Bus to push message into Service bus queue based on incoming calls.
Problem: I have developed a Azure API app in VSTS and deployed in Azure, configured it using Azure Active Directory to do App registration and used API Management Service to implement OAuth2.0 on my API. When I am trying to communicate my Azure Service Bus to push message using queueclient.SendAsync(message), my message is getting into Service Bus but the SendAsync method does not returns and my code hangs on that line.
Then I searched some posts in google and I found that it is some kind of issue and I need to use .net core type project to overcome the sendasync thread problem. So I developed a .net core web application( template API) and deployed it to Azure and it is communicating with the bus properly. But the app service deployed in Azure is of type Web app but not API app. So now I cannot use this Web app to be configure under API Management Service for OAuth2.0 as it supports only API app type.
Query : 1. Can I use .net core web application to develop my API's and deploy in Azure as API app type.
or
2. How to use .NET Framework web application to develop my API which can communicate with Service bus properly without hanging in SendAsync method.
There is no noticeable difference between a Web APP and an API App so the answer is yes, you can use .net core web application to develop your API and deploy it as an API App.
I can't answer your Question 2 without seeing your code, maybe you missed an await?

Azure Function Authenticating ASP.Net Core Web Api using Microsoft Account

I have an ASP.Net Core 2.0 Web App running in an App Service in Azure that has social login configured (Google & Microsoft) according to the following docs:
https://learn.microsoft.com/en-us/aspnet/core/security/authentication/social/microsoft-logins?tabs=aspnetcore2x
https://learn.microsoft.com/en-us/aspnet/core/security/authentication/social/google-logins?tabs=aspnetcore2x
I also have an Azure Function app that gets triggered when a message is written to an Azure Queue. I would like this function app to post the message to a Web API (Controller Action) that is running on the web app above.
How would I go about authenticating from the function app to the web API method? Would I need to somehow call the Azure AD endpoint to get a token for a given username/password?
Ideally, I would want to limit who can call this API method to just a single user account that the function app would use. Alternatively, can I somehow use the new Managed Service Identity feature to authenticate the function app against my web API method in my web app above?
Sorry, am new to API authentication, so just trying to figure out the simplest approach.

How to build a Rest API on Azure for a Documentdb database with Node.js

I have already created a Documentdb database and now i should build a REST API on Azure with Node.js. I have read the documentation, but i did't understand it good enough.
Cloud services could be a good solution, but if i didn't misunderstand, it is Python and .NET based.
If i want to build a REST API and an user interface voor the REST API, which services should i better use? Web apps? API apps? Or any another product?
https://learn.microsoft.com/en-us/azure/app-service-api/app-service-api-nodejs-api-app
Per Azure's documentation,
An API app can take advantage of features offered by Web Apps and Mobile Apps. The reverse is also true: if you use a web app or mobile app to host an API, it can take advantage of API Apps features such as Swagger metadata for client code generation and CORS for cross-domain browser access. The only difference between the three app types (API, web, mobile) is the name and icon used for them in the Azure portal.
An API app and a Web app will equally work for you. Currently, all of Web, Mobile and API Apps are collectively called App Services. For most scenarios, Web Apps is the best choice.
More on this:
Azure Web API vs Web App
Differences between Azure App Services and Cloud Services

Access azure website usage data inside of the ASP.NET app

We have a need to monitor the azure Web App's resource usage in relation to the number of users logged into the application.
What is the best way to get information about the running azure environment (processor and memory) usage of the Azure WebApp for an ASP.NET application.
You can try to setup Application Insights in your application. Once done you should be able to get telemetry data with their API
(https://msdn.microsoft.com/en-us/library/azure/dn931943.aspx?f=255&MSPPError=-2147217396)

Resources