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

Connection strings support #50

Open
kpvenugo opened this issue Oct 6, 2020 · 1 comment
Open

Connection strings support #50

kpvenugo opened this issue Oct 6, 2020 · 1 comment

Comments

@kpvenugo
Copy link

kpvenugo commented Oct 6, 2020

https://docs.microsoft.com/en-us/azure/azure-monitor/app/sdk-connection-string?tabs=net#overview
https://docs.microsoft.com/en-us/azure/azure-monitor/app/custom-endpoints?tabs=net#regions-that-require-endpoint-modification

Connection strings are the new preferred method of setting custom endpoints within Application Insights.
Request to share info on if this is supported already. If not could we raise a request for the same?

@jjjordanmsft
Copy link
Contributor

It might be possible to accept either an Ikey or a connection string in both NewTelemetryClient and NewTelemetryConfiguration. If you need to use a custom endpoint, then do this as a workaround:

cfg := appinsights.NewTelemetryConfiguration(ikey)
cfg.EndpointUrl = "https://dc.applicationinsights.azure.cn/v2/track" // Data collector endpoint URL
client := appinsights.NewTelemetryClientFromConfig(cfg)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants