use of com.microsoft.azuretools.telemetry.TelemetryInterceptor in project azure-tools-for-java by Microsoft.
the class AzureManagerBase method authApplicationInsights.
protected InsightsManager authApplicationInsights(String subscriptionId, String tenantId) {
final AzureTokenCredentials credentials = getCredentials(tenantId);
final InsightsManager.Configurable configurable = buildAzureManager(InsightsManager.configure()).withInterceptor(new TelemetryInterceptor());
Optional.ofNullable(createProxyFromConfig()).ifPresent(proxy -> {
configurable.withProxy(proxy);
Optional.ofNullable(createProxyAuthenticatorFromConfig()).ifPresent(configurable::withProxyAuthenticator);
});
return configurable.authenticate(credentials, subscriptionId);
}
use of com.microsoft.azuretools.telemetry.TelemetryInterceptor in project azure-tools-for-java by Microsoft.
the class AzureManagerBase method authTenant.
@AzureOperation(name = "account|tenant.auth", params = { "tenantId" }, type = AzureOperation.Type.TASK)
protected Azure.Authenticated authTenant(String tenantId) {
final AzureTokenCredentials credentials = getCredentials(tenantId);
final Azure.Configurable configurable = Azure.configure().withInterceptor(new TelemetryInterceptor()).withUserAgent(CommonSettings.USER_AGENT);
Optional.ofNullable(createProxyFromConfig()).ifPresent(proxy -> {
configurable.withProxy(proxy);
Optional.ofNullable(createProxyAuthenticatorFromConfig()).ifPresent(configurable::withProxyAuthenticator);
});
return configurable.authenticate(credentials);
}
Aggregations