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:
Candice Ye
2022-03-17 20:57:16 -07:00
committed by GitHub
parent d6abcb892d
commit a786e63445
10 changed files with 200 additions and 3 deletions

View File

@@ -15,6 +15,8 @@ import { AzureArcTreeDataProvider } from './ui/tree/azureArcTreeDataProvider';
import { ControllerTreeNode } from './ui/tree/controllerTreeNode';
import { TreeNode } from './ui/tree/treeNode';
import * as pricing from './common/pricingUtils';
import * as workspace from './common/workspaceUtils';
import { LogAnalyticsWorkspaceOptionsSourceProvider } from './providers/logAnalyticsWorkspaceOptionsSourceProvider';
export async function activate(context: vscode.ExtensionContext): Promise<arc.IExtension> {
IconPathHelper.setExtensionContext(context);
@@ -61,6 +63,15 @@ export async function activate(context: vscode.ExtensionContext): Promise<arc.IE
// register option sources
const rdApi = <rd.IExtension>vscode.extensions.getExtension(rd.extension.name)?.exports;
context.subscriptions.push(rdApi.registerOptionsSourceProvider(new ArcControllersOptionsSourceProvider(treeDataProvider)));
context.subscriptions.push(rdApi.registerOptionsSourceProvider(new LogAnalyticsWorkspaceOptionsSourceProvider()));
// Register valueprovider for getting the Log Analytics workspace id from the workspace name.
context.subscriptions.push(rdApi.registerValueProvider({
id: 'workspace-name-to-id',
getValue: async (triggerFields: { [key: string]: rd.InputValueType }) => {
return workspace.getWorkspaceIdFromName(triggerFields);
}
}));
// Register valueprovider for getting the calculated cost per VCore.
context.subscriptions.push(rdApi.registerValueProvider({