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);
}
Aggregations