Fix for getting auth token for Kusto resource (#16773)

* Fix for getting auth token for Kusto resource

* Addressed comment

Co-authored-by: hhh <gfhg>
This commit is contained in:
Monica Gupta
2021-08-13 14:50:42 -07:00
committed by GitHub
parent 21a1db1045
commit 5049bf0c7f
8 changed files with 28 additions and 5 deletions

View File

@@ -77,6 +77,10 @@ export abstract class AzureAuth implements vscode.Disposable {
this.resources = this.resources.concat(this.metadata.settings.azureLogAnalyticsResource); this.resources = this.resources.concat(this.metadata.settings.azureLogAnalyticsResource);
} }
if (this.metadata.settings.azureKustoResource) {
this.resources = this.resources.concat(this.metadata.settings.azureKustoResource);
}
this.scopes = [...this.metadata.settings.scopes]; this.scopes = [...this.metadata.settings.scopes];
this.scopesString = this.scopes.join(' '); this.scopesString = this.scopes.join(' ');
} }

View File

@@ -19,7 +19,8 @@ const enum SettingIds {
vault = 'vault', vault = 'vault',
ado = 'ado', ado = 'ado',
ala = 'ala', ala = 'ala',
storage = 'storage' storage = 'storage',
kusto = 'kusto'
} }
const publicAzureSettings: ProviderSettings = { const publicAzureSettings: ProviderSettings = {
@@ -81,6 +82,11 @@ const publicAzureSettings: ProviderSettings = {
endpointSuffix: '.core.windows.net', endpointSuffix: '.core.windows.net',
azureResourceId: AzureResource.AzureStorage azureResourceId: AzureResource.AzureStorage
}, },
azureKustoResource: {
id: SettingIds.kusto,
endpoint: 'https://api.kusto.io',
azureResourceId: AzureResource.AzureKusto,
},
redirectUri: 'https://vscode-redirect.azurewebsites.net/', redirectUri: 'https://vscode-redirect.azurewebsites.net/',
scopes: [ scopes: [
'openid', 'email', 'profile', 'offline_access', 'openid', 'email', 'profile', 'offline_access',

View File

@@ -118,6 +118,11 @@ declare module 'azurecore' {
*/ */
azureDevOpsResource?: Resource; azureDevOpsResource?: Resource;
/**
* Information that describes the Azure Kusto resource
*/
azureKustoResource?: Resource;
/** /**
* Information that describes the Azure Log Analytics resource * Information that describes the Azure Log Analytics resource
*/ */

View File

@@ -217,6 +217,7 @@
"languageMode": "kusto", "languageMode": "kusto",
"notebookKernelAlias": "Kusto", "notebookKernelAlias": "Kusto",
"displayName": "%kusto.provider.displayName%", "displayName": "%kusto.provider.displayName%",
"azureResource": "AzureKusto",
"iconPath": [ "iconPath": [
{ {
"id": "kusto:cloud", "id": "kusto:cloud",

View File

@@ -861,7 +861,11 @@ declare module 'azdata' {
/** /**
* Azure Storage * Azure Storage
*/ */
AzureStorage = 9 AzureStorage = 9,
/**
* Kusto
*/
AzureKusto = 10
} }
export interface ButtonProperties { export interface ButtonProperties {

View File

@@ -58,7 +58,9 @@ export enum AzureResource {
MicrosoftResourceManagement = 5, MicrosoftResourceManagement = 5,
AzureDevOps = 6, AzureDevOps = 6,
MsGraph = 7, MsGraph = 7,
AzureLogAnalytics = 8 AzureLogAnalytics = 8,
AzureStorage = 9,
AzureKusto = 10
} }
export interface IAccountStore { export interface IAccountStore {

View File

@@ -438,7 +438,8 @@ export enum AzureResource {
AzureDevOps = 6, AzureDevOps = 6,
MsGraph = 7, MsGraph = 7,
AzureLogAnalytics = 8, AzureLogAnalytics = 8,
AzureStorage = 9 AzureStorage = 9,
AzureKusto = 10
} }
export class TreeItem extends vsExtTypes.TreeItem { export class TreeItem extends vsExtTypes.TreeItem {

View File

@@ -75,7 +75,7 @@ export class ConnectionManagementService extends Disposable implements IConnecti
private static readonly CONNECTION_MEMENTO = 'ConnectionManagement'; private static readonly CONNECTION_MEMENTO = 'ConnectionManagement';
private static readonly _azureResources: AzureResource[] = private static readonly _azureResources: AzureResource[] =
[AzureResource.ResourceManagement, AzureResource.Sql, AzureResource.OssRdbms, AzureResource.AzureLogAnalytics]; [AzureResource.ResourceManagement, AzureResource.Sql, AzureResource.OssRdbms, AzureResource.AzureLogAnalytics, AzureResource.AzureKusto];
constructor( constructor(
@IConnectionDialogService private _connectionDialogService: IConnectionDialogService, @IConnectionDialogService private _connectionDialogService: IConnectionDialogService,