Fix connection issue with wrong resource endpoint (#19387)

* Fix connection bug accessing PBI resource

* Address CR feedback

* Fix null check
This commit is contained in:
Karl Burtram
2022-05-16 15:23:23 -07:00
committed by GitHub
parent d7ecdd89b1
commit 701f656c55
6 changed files with 69 additions and 4 deletions

View File

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

View File

@@ -20,7 +20,8 @@ const enum SettingIds {
ado = 'ado',
ala = 'ala',
storage = 'storage',
kusto = 'kusto'
kusto = 'kusto',
powerbi = 'powerbi'
}
const publicAzureSettings: ProviderSettings = {
@@ -87,6 +88,11 @@ const publicAzureSettings: ProviderSettings = {
endpoint: 'https://kusto.kusto.windows.net',
azureResourceId: AzureResource.AzureKusto,
},
powerBiResource: {
id: SettingIds.powerbi,
endpoint: 'https://analysis.windows.net/powerbi/api',
azureResourceId: AzureResource.PowerBi
},
redirectUri: 'https://vscode-redirect.azurewebsites.net/',
scopes: [
'openid', 'email', 'profile', 'offline_access',
@@ -147,6 +153,11 @@ const usGovAzureSettings: ProviderSettings = {
endpointSuffix: '.core.usgovcloudapi.net',
azureResourceId: AzureResource.AzureStorage
},
powerBiResource: {
id: SettingIds.powerbi,
endpoint: 'https://analysis.windows.net/powerbi/api',
azureResourceId: AzureResource.PowerBi
},
redirectUri: 'https://vscode-redirect.azurewebsites.net/',
scopes: [
'openid', 'email', 'profile', 'offline_access',
@@ -251,6 +262,11 @@ const germanyAzureSettings: ProviderSettings = {
endpointSuffix: '.core.cloudapi.de',
azureResourceId: AzureResource.AzureStorage
},
powerBiResource: {
id: SettingIds.powerbi,
endpoint: 'https://analysis.windows.net/powerbi/api',
azureResourceId: AzureResource.PowerBi
},
redirectUri: 'https://vscode-redirect.azurewebsites.net/',
scopes: [
'openid', 'email', 'profile', 'offline_access',
@@ -310,6 +326,11 @@ const chinaAzureSettings: ProviderSettings = {
endpointSuffix: '.core.chinacloudapi.cn',
azureResourceId: AzureResource.AzureStorage
},
powerBiResource: {
id: SettingIds.powerbi,
endpoint: 'https://analysis.windows.net/powerbi/api',
azureResourceId: AzureResource.PowerBi
},
redirectUri: 'https://vscode-redirect.azurewebsites.net/',
scopes: [
'openid', 'email', 'profile', 'offline_access',

View File

@@ -130,10 +130,15 @@ declare module 'azurecore' {
azureLogAnalyticsResource?: Resource;
/**
* Information that describes the Azure Storage resourceI
* Information that describes the Azure Storage resource
*/
azureStorageResource?: Resource;
/**
* Information that describes the Power BI resource
*/
powerBiResource?: Resource;
/**
* A list of tenant IDs to authenticate against. If defined, then these IDs will be used
* instead of querying the tenants endpoint of the armResource