mirror of
https://github.com/ckaczor/azuredatastudio.git
synced 2026-02-11 02:32:35 -05:00
Arc bug fix: ADS Create DC wizard should prompt for Log Analytics workspace ID and access token similar to portal (#18742)
* Added monitor log-analytics workspace list to az api * Made resource group and subscription optional for logs analytics workspace list * Added dynamic fields for workspace names, id, primary key, based on value of auto-logs checkbox * Hooked up the newly created source provider for log analytics workspaces. Dropdown now populates all workspace names. * Added workspaceUtils.ts for a valueprovider. Now workspace name maps to id automatically. * Replaced promise.all with promise.resolve * Added workspace id and primary key as env variables in the notebook * Removed extra space in package.json * Made getOptions more concise and put azApi definition in function. * Changed notebook to handle new Azure CLI command with param --clustername
This commit is contained in:
@@ -154,6 +154,17 @@ export function getAzApi(localAzDiscovered: Promise<IAzTool | undefined>, azTool
|
||||
}
|
||||
}
|
||||
},
|
||||
monitor: {
|
||||
logAnalytics: {
|
||||
workspace: {
|
||||
list: async (resourceGroup?: string, subscription?: string, additionalEnvVars?: azExt.AdditionalEnvVars) => {
|
||||
await localAzDiscovered;
|
||||
validateAz(azToolService.localAz);
|
||||
return azToolService.localAz!.monitor.logAnalytics.workspace.list(resourceGroup, subscription, additionalEnvVars);
|
||||
}
|
||||
}
|
||||
}
|
||||
},
|
||||
getPath: async () => {
|
||||
await localAzDiscovered;
|
||||
throwIfNoAz(azToolService.localAz);
|
||||
|
||||
@@ -209,6 +209,19 @@ export class AzTool implements azExt.IAzApi {
|
||||
}
|
||||
};
|
||||
|
||||
public monitor = {
|
||||
logAnalytics: {
|
||||
workspace: {
|
||||
list: (resourceGroup?: string, subscription?: string, additionalEnvVars?: azExt.AdditionalEnvVars): Promise<azExt.AzOutput<azExt.LogAnalyticsWorkspaceListResult[]>> => {
|
||||
const argsArray = ['monitor', 'log-analytics', 'workspace', 'list'];
|
||||
if (resourceGroup) { argsArray.push('--resource-group', resourceGroup); }
|
||||
if (subscription) { argsArray.push('--subscription', subscription); }
|
||||
return this.executeCommand<azExt.LogAnalyticsWorkspaceListResult[]>(argsArray, additionalEnvVars);
|
||||
}
|
||||
}
|
||||
}
|
||||
};
|
||||
|
||||
|
||||
/**
|
||||
* Gets the output of running '--version' command on the az tool.
|
||||
|
||||
50
extensions/azcli/src/typings/az-ext.d.ts
vendored
50
extensions/azcli/src/typings/az-ext.d.ts
vendored
@@ -187,6 +187,45 @@ declare module 'az-ext' {
|
||||
state: string //Completed
|
||||
}
|
||||
|
||||
export interface LogAnalyticsWorkspaceListResult {
|
||||
createdDate: string, // "2020-02-25T16:59:38Z"
|
||||
customerId: string, // "7e136a79-c0b6-4878-86bf-7bf7a6a7e6f6",
|
||||
eTag: string, // null,
|
||||
etag: string, // "\"00006df1-0000-0700-0000-61ee552f0000\"",
|
||||
features: {
|
||||
clusterResourceId: string, // null,
|
||||
disableLocalAuth: boolean, // null,
|
||||
enableDataExport: boolean, // null,
|
||||
enableLogAccessUsingOnlyResourcePermissions: boolean, //true,
|
||||
immediatePurgeDataOn30Days: boolean, // null,
|
||||
legacy: number, // 0,
|
||||
searchVersion: number // 1
|
||||
},
|
||||
forceCmkForQuery: boolean, // null,
|
||||
id: string, // "/subscriptions/a5082b19-8a6e-4bc5-8fdd-8ef39dfebc39/resourcegroups/bugbash/providers/microsoft.operationalinsights/workspaces/bugbash-logs",
|
||||
location: string, // "westus",
|
||||
modifiedDate: string, // "2022-02-21T09:18:22.3906451Z",
|
||||
name: string, // "bugbash-logs",
|
||||
privateLinkScopedResources: string, // null,
|
||||
provisioningState: string, // "Succeeded",
|
||||
publicNetworkAccessForIngestion: string, // "Enabled",
|
||||
publicNetworkAccessForQuery: string, // "Enabled",
|
||||
resourceGroup: string, // "bugbash",
|
||||
retentionInDays: number, // 30,
|
||||
sku: {
|
||||
capacityReservationLevel: number, // null,
|
||||
lastSkuUpdate: string, // "2020-02-25T16:59:38Z",
|
||||
name: string, // "pergb2018"
|
||||
},
|
||||
tags: string[], //null,
|
||||
type: string, //"Microsoft.OperationalInsights/workspaces",
|
||||
workspaceCapping: {
|
||||
dailyQuotaGb: number, //-1.0,
|
||||
dataIngestionStatus: string, // "RespectQuota",
|
||||
quotaNextResetTime: string, // "2022-02-21T19:00:00Z"
|
||||
}
|
||||
}
|
||||
|
||||
export interface PostgresServerShowResult {
|
||||
apiVersion: string, // "arcdata.microsoft.com/v1alpha1"
|
||||
kind: string, // "postgresql"
|
||||
@@ -362,6 +401,17 @@ declare module 'az-ext' {
|
||||
): Promise<AzOutput<SqlMiDbRestoreResult>>
|
||||
}
|
||||
},
|
||||
monitor: {
|
||||
logAnalytics: {
|
||||
workspace: {
|
||||
list(
|
||||
resourceGroup?: string, // test-rg
|
||||
subscription?: string, // 122c121a-095a-4f5d-22e4-cc6b238490a3
|
||||
additionalEnvVars?: AdditionalEnvVars
|
||||
): Promise<AzOutput<LogAnalyticsWorkspaceListResult[]>>
|
||||
}
|
||||
}
|
||||
},
|
||||
getPath(): Promise<string>,
|
||||
/**
|
||||
* The semVersion corresponding to this installation of the Azure CLI. version() method should have been run
|
||||
|
||||
Reference in New Issue
Block a user