Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Azure AD Authentication In the ApplicationInsights Sink #541

Open
gverstraete opened this issue Sep 29, 2023 · 2 comments · May be fixed by #548
Open

Azure AD Authentication In the ApplicationInsights Sink #541

gverstraete opened this issue Sep 29, 2023 · 2 comments · May be fixed by #548
Assignees
Labels
application-insights All issues related to Azure Application Insights feature-request All issues related to feature requests by customers
Milestone

Comments

@gverstraete
Copy link
Contributor

Is your feature request related to a problem? Please describe.
Azure provides now a way to authenticate towards AppIns via a service principal. I was always suprised why they didn't provide something like this sooner, but hey :).

Now it is supported I want to leverage from this via Arcus.
When setting up your sink, there should be a way to set this authentication.
More information on the tool itself: https://learn.microsoft.com/en-us/azure/azure-monitor/app/azure-ad-authentication?tabs=net.

Describe the solution you'd like
There are two ways we can handle these things...

We now have in the sink startup WriteTo.AzureApplicationInsightsWithConnectionString, where we could add an overload parameter with tokenCredential (so you can choose managed identity or service principal).

Or we add an extension method on top of WriteTo.AzureApplicationInsightsWithConnectionString, with name similar to 'UsingAuthenication('TokenCredential credential).

Describe alternatives you've considered
There are no real alternatives, I am a bit stuck as I cannot use the Serilog sink as it doesn't do the convertions.

Additional context
/

@fgheysels
Copy link
Member

Additional information:

It seems that you can enable / configure Application Insights to only allow to ingest logs / metrics using Azure AD based authentication.
When this is enabled, you need to configure your Application Insights logger in your application by specifying the connection-string to the App Insights instance you wish to target. Next to that, you also need to specify the managed identity / service principal that you want to use for authenticating.

More info can be found here.

@stijnmoreels stijnmoreels added feature-request All issues related to feature requests by customers application-insights All issues related to Azure Application Insights labels Oct 6, 2023
@stijnmoreels stijnmoreels added this to the v3.0.0 milestone Oct 6, 2023
@stijnmoreels stijnmoreels self-assigned this Oct 27, 2023
@stijnmoreels
Copy link
Member

Prioritize .NET 8 support, so moving this to v3.1.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
application-insights All issues related to Azure Application Insights feature-request All issues related to feature requests by customers
Projects
Status: To do
Development

Successfully merging a pull request may close this issue.

3 participants