Search in sources :

Example 1 with ApplicationInsightsManagementClient

use of com.microsoft.applicationinsights.management.rest.ApplicationInsightsManagementClient in project azure-tools-for-java by Microsoft.

the class AzureSDKManager method createApplicationInsightsResource.

public static Resource createApplicationInsightsResource(@NotNull SubscriptionDetail subscription, @NotNull String resourceGroupName, boolean isNewGroup, @NotNull String resourceName, @NotNull String location) throws Exception {
    AzureManager azureManager = AuthMethodManager.getInstance().getAzureManager();
    if (azureManager == null) {
        // not signed in
        return null;
    }
    String tenantId = subscription.getTenantId();
    ApplicationInsightsManagementClient client = getApplicationManagementClient(tenantId, azureManager.getAccessToken(tenantId));
    if (isNewGroup) {
        client.createResourceGroup(subscription.getSubscriptionId(), resourceGroupName, location);
    }
    return client.createResource(subscription.getSubscriptionId(), resourceGroupName, resourceName, location);
}
Also used : AzureManager(com.microsoft.azuretools.sdkmanage.AzureManager) ApplicationInsightsManagementClient(com.microsoft.applicationinsights.management.rest.ApplicationInsightsManagementClient)

Aggregations

ApplicationInsightsManagementClient (com.microsoft.applicationinsights.management.rest.ApplicationInsightsManagementClient)1 AzureManager (com.microsoft.azuretools.sdkmanage.AzureManager)1