public async Task <string> CreateApplicationInsightsApiKey( Guid subscriptionId, ApplicationInsightsAccount appInsights, string apiKeyName) { var accessToken = await GetAccessToken(); var token = new TokenCredentials(accessToken); var appInsightsClient = new ApplicationInsightsManagementClient(token) { SubscriptionId = subscriptionId.ToString() }; var scope = $"/subscriptions/{subscriptionId}/resourcegroups/{appInsights.ResourceGroupName}/providers/Microsoft.insights/components/{appInsights.Name}/api"; var apiKeyRequestProps = new APIKeyRequest($"RenderMgr-{apiKeyName}", new List <string>(new[] { scope })); var key = await appInsightsClient.APIKeys.CreateAsync( appInsights.ResourceGroupName, appInsights.Name, apiKeyRequestProps); return(key.ApiKey); }
public Task <string> CreateApplicationInsightsApiKey(Guid subscriptionId, ApplicationInsightsAccount appInsights, string apiKeyName) { throw new NotImplementedException(); }