public ApiKeyProvider(IOptions <Settings> options)
        {
            _options = options;
            var credentials = GetServiceClientCredentials(_options.Value);

            _applicationInsightsManagementClient = new ApplicationInsightsManagementClient(credentials)
            {
                SubscriptionId = _options.Value.SubscriptionId
            };
        }
Example #2
0
        internal static List <ApplicationInsightsComponent> GetComponents(IApplicationInsightsManagementClient applicationInsightsClient, string resourceGroupName)
        {
            Func <IPage <ApplicationInsightsComponent> > listAsync =
                () => applicationInsightsClient
                .Components
                .ListByResourceGroupWithHttpMessagesAsync(resourceGroupName)
                .GetAwaiter()
                .GetResult()
                .Body;

            Func <string, IPage <ApplicationInsightsComponent> > listNextAsync =
                nextLink => applicationInsightsClient
                .Components
                .ListByResourceGroupNextWithHttpMessagesAsync(
                    nextLink)
                .GetAwaiter()
                .GetResult()
                .Body;

            return(Utilities.GetPagedList(listAsync, listNextAsync));
        }
Example #3
0
 public ApplicationInsightsManagementClientWrapper(IApplicationInsightsManagementClient resourceManagementClient)
 {
     appInsightsManagementClient = resourceManagementClient;
 }