Hi Vijay Pratap Singh,
Welcome to the Microsoft Q&A Platform! Thank you for reaching out regarding your query on ingesting new relic APM service in azure function in process model.
To ingest New Relic APM service in an Azure Function in process model, you can follow these steps:
- First, you need to create a New Relic account and obtain an API key.
- Next, you need to install the New Relic .NET agent in your Azure Function. You can do this by adding the following NuGet package to your project: NewRelic.Agent.Api.
- Once you have installed the New Relic .NET agent, you need to configure it to work with your Azure Function. You can do this by adding the following code to your Startup.cs file:
public class Startup : FunctionsStartup
{
public override void Configure(IFunctionsHostBuilder builder)
{
NewRelic.Api.Agent.NewRelic.SetApplicationName("Your Application Name");
NewRelic.Api.Agent.NewRelic.SetLicenseKey("Your License Key");
}
}
Replace "Your Application Name" and "Your License Key" with the appropriate values for your New Relic account.
- Finally, you need to instrument your Azure Function code to capture data for New Relic. You can do this by adding the following code to your function:
using NewRelic.Agent.Api;
public static async Task<IActionResult> Run(HttpRequest req, ILogger log)
{
using (NewRelic.Api.Agent.NewRelic.StartTransaction("Transaction Name"))
{
// Your function code here
}
}
Replace "Transaction Name" with a descriptive name for your transaction.
With these steps, you should be able to ingest New Relic APM service in your Azure Function in process model.
If this answers your query, do click Accept Answer
and Yes
for was this answer helpful. And, if you have any further query do let us know.