mirror of
https://github.com/ckaczor/azuredatastudio.git
synced 2026-03-23 21:30:29 -04:00
* initial commit, add support for custom endpoints * add template file with public azure endpoints * add throw error, fix compile * update description * move custom provider to settings.json * cleanup * test * wip * try fix build error * wip fix build issue * add typings for package.json * test remove default * fix typings * fix typing * add object definitions * add additional checks * test define object * add default * remove default and extra checks * Organize code well to fix integration tests (#23697) * pr review updates * fix custom setting checker * fix default behavior * add more required, change name for default cloud * add one more required * modify required properties to match with api * Update extensions/azurecore/package.json Co-authored-by: Cheena Malhotra <13396919+cheenamalhotra@users.noreply.github.com> * Update extensions/azurecore/package.json Co-authored-by: Cheena Malhotra <13396919+cheenamalhotra@users.noreply.github.com> * pr review changes * remove default value from display name * make akv optional * remove default name * remove default * update descriptions, function names * add client ID * small fix * Update extensions/azurecore/package.nls.json Co-authored-by: Charles Gagnon <chgagnon@microsoft.com> * Update extensions/azurecore/package.json Co-authored-by: Charles Gagnon <chgagnon@microsoft.com> * updated names * add custom for configkey * providerSettingsJson -> customProviderSettings --------- Co-authored-by: Cheena Malhotra <13396919+cheenamalhotra@users.noreply.github.com> Co-authored-by: Charles Gagnon <chgagnon@microsoft.com>
239 lines
7.3 KiB
TypeScript
239 lines
7.3 KiB
TypeScript
/*---------------------------------------------------------------------------------------------
|
|
* Copyright (c) Microsoft Corporation. All rights reserved.
|
|
* Licensed under the Source EULA. See License.txt in the project root for license information.
|
|
*--------------------------------------------------------------------------------------------*/
|
|
|
|
import * as nls from 'vscode-nls';
|
|
import { ProviderSettings, SettingIds } from './interfaces';
|
|
import { AzureResource } from 'azdata';
|
|
import { updateCustomCloudProviderSettings } from '../utils';
|
|
|
|
const localize = nls.loadMessageBundle();
|
|
|
|
const publicAzureSettings: ProviderSettings = {
|
|
configKey: 'enablePublicCloud',
|
|
metadata: {
|
|
displayName: localize('publicCloudDisplayName', "Azure"),
|
|
id: 'azure_publicCloud',
|
|
settings: {
|
|
host: 'https://login.microsoftonline.com/',
|
|
clientId: 'a69788c6-1d43-44ed-9ca3-b83e194da255',
|
|
microsoftResource: {
|
|
id: SettingIds.marm,
|
|
endpoint: 'https://management.core.windows.net/',
|
|
azureResourceId: AzureResource.MicrosoftResourceManagement
|
|
},
|
|
graphResource: {
|
|
id: SettingIds.graph,
|
|
endpoint: 'https://graph.windows.net/',
|
|
azureResourceId: AzureResource.Graph
|
|
},
|
|
msGraphResource: {
|
|
id: SettingIds.msgraph,
|
|
endpoint: 'https://graph.microsoft.com/',
|
|
azureResourceId: AzureResource.MsGraph
|
|
},
|
|
armResource: {
|
|
id: SettingIds.arm,
|
|
endpoint: 'https://management.azure.com/',
|
|
azureResourceId: AzureResource.ResourceManagement
|
|
},
|
|
sqlResource: {
|
|
id: SettingIds.sql,
|
|
endpoint: 'https://database.windows.net/',
|
|
azureResourceId: AzureResource.Sql
|
|
},
|
|
ossRdbmsResource: {
|
|
id: SettingIds.ossrdbms,
|
|
endpoint: 'https://ossrdbms-aad.database.windows.net/',
|
|
azureResourceId: AzureResource.OssRdbms
|
|
},
|
|
azureKeyVaultResource: {
|
|
id: SettingIds.vault,
|
|
endpoint: 'https://vault.azure.net/',
|
|
azureResourceId: AzureResource.AzureKeyVault
|
|
},
|
|
azureDevOpsResource: {
|
|
id: SettingIds.ado,
|
|
endpoint: '499b84ac-1321-427f-aa17-267ca6975798/',
|
|
azureResourceId: AzureResource.AzureDevOps,
|
|
},
|
|
azureLogAnalyticsResource: {
|
|
id: SettingIds.ala,
|
|
endpoint: 'https://api.loganalytics.io/',
|
|
azureResourceId: AzureResource.AzureLogAnalytics,
|
|
},
|
|
azureStorageResource: {
|
|
id: SettingIds.storage,
|
|
endpoint: '',
|
|
endpointSuffix: '.core.windows.net/',
|
|
azureResourceId: AzureResource.AzureStorage
|
|
},
|
|
azureKustoResource: {
|
|
id: SettingIds.kusto,
|
|
endpoint: 'https://kusto.kusto.windows.net/',
|
|
azureResourceId: AzureResource.AzureKusto,
|
|
},
|
|
powerBiResource: {
|
|
id: SettingIds.powerbi,
|
|
endpoint: 'https://analysis.windows.net/powerbi/api/',
|
|
azureResourceId: AzureResource.PowerBi
|
|
},
|
|
redirectUri: 'http://localhost',
|
|
scopes: [
|
|
'openid', 'email', 'profile', 'offline_access',
|
|
'https://management.azure.com/user_impersonation',
|
|
],
|
|
portalEndpoint: 'https://portal.azure.com'
|
|
}
|
|
}
|
|
};
|
|
|
|
|
|
const usGovAzureSettings: ProviderSettings = {
|
|
configKey: 'enableUsGovCloud',
|
|
metadata: {
|
|
displayName: localize('usGovCloudDisplayName', "Azure (US Government)"),
|
|
id: 'azure_usGovtCloud',
|
|
settings: {
|
|
host: 'https://login.microsoftonline.us/',
|
|
clientId: 'a69788c6-1d43-44ed-9ca3-b83e194da255',
|
|
microsoftResource: {
|
|
id: SettingIds.marm,
|
|
endpoint: 'https://management.core.usgovcloudapi.net/',
|
|
azureResourceId: AzureResource.MicrosoftResourceManagement
|
|
},
|
|
graphResource: {
|
|
id: SettingIds.graph,
|
|
endpoint: 'https://graph.windows.net/',
|
|
azureResourceId: AzureResource.Graph
|
|
},
|
|
msGraphResource: {
|
|
id: SettingIds.msgraph,
|
|
endpoint: 'https://graph.microsoft.us/',
|
|
azureResourceId: AzureResource.MsGraph
|
|
},
|
|
armResource: {
|
|
id: SettingIds.arm,
|
|
endpoint: 'https://management.usgovcloudapi.net/',
|
|
azureResourceId: AzureResource.ResourceManagement
|
|
},
|
|
sqlResource: {
|
|
id: SettingIds.sql,
|
|
endpoint: 'https://database.usgovcloudapi.net/',
|
|
azureResourceId: AzureResource.Sql
|
|
},
|
|
ossRdbmsResource: {
|
|
id: SettingIds.ossrdbms,
|
|
endpoint: 'https://ossrdbms-aad.database.usgovcloudapi.net/',
|
|
azureResourceId: AzureResource.OssRdbms
|
|
},
|
|
azureKeyVaultResource: {
|
|
id: SettingIds.vault,
|
|
endpoint: 'https://vault.usgovcloudapi.net/',
|
|
azureResourceId: AzureResource.AzureKeyVault
|
|
},
|
|
azureLogAnalyticsResource: {
|
|
id: SettingIds.ala,
|
|
endpoint: 'https://api.loganalytics.us/',
|
|
azureResourceId: AzureResource.AzureLogAnalytics,
|
|
},
|
|
azureStorageResource: {
|
|
id: SettingIds.storage,
|
|
endpoint: '',
|
|
endpointSuffix: '.core.usgovcloudapi.net/',
|
|
azureResourceId: AzureResource.AzureStorage
|
|
},
|
|
azureKustoResource: {
|
|
id: SettingIds.kusto,
|
|
endpoint: 'https://kusto.kusto.usgovcloudapi.net',
|
|
azureResourceId: AzureResource.AzureKusto,
|
|
},
|
|
powerBiResource: {
|
|
id: SettingIds.powerbi,
|
|
endpoint: 'https://analysis.windows.net/powerbi/api/',
|
|
azureResourceId: AzureResource.PowerBi
|
|
},
|
|
redirectUri: 'http://localhost',
|
|
scopes: [
|
|
'openid', 'email', 'profile', 'offline_access',
|
|
'https://management.usgovcloudapi.net/user_impersonation'
|
|
],
|
|
portalEndpoint: 'https://portal.azure.us'
|
|
}
|
|
}
|
|
};
|
|
|
|
const chinaAzureSettings: ProviderSettings = {
|
|
configKey: 'enableChinaCloud',
|
|
metadata: {
|
|
displayName: localize('chinaCloudDisplayName', "Azure (China)"),
|
|
id: 'azure_chinaCloud',
|
|
settings: {
|
|
host: 'https://login.partner.microsoftonline.cn/',
|
|
clientId: 'a69788c6-1d43-44ed-9ca3-b83e194da255',
|
|
microsoftResource: {
|
|
id: SettingIds.marm,
|
|
endpoint: 'https://management.core.chinacloudapi.cn/',
|
|
azureResourceId: AzureResource.MicrosoftResourceManagement
|
|
},
|
|
graphResource: {
|
|
id: SettingIds.graph,
|
|
endpoint: 'https://graph.chinacloudapi.cn',
|
|
azureResourceId: AzureResource.Graph
|
|
},
|
|
msGraphResource: {
|
|
id: SettingIds.msgraph,
|
|
endpoint: 'https://microsoftgraph.chinacloudapi.cn',
|
|
azureResourceId: AzureResource.MsGraph
|
|
},
|
|
armResource: {
|
|
id: SettingIds.arm,
|
|
endpoint: 'https://management.chinacloudapi.cn',
|
|
azureResourceId: AzureResource.ResourceManagement
|
|
},
|
|
sqlResource: {
|
|
id: SettingIds.sql,
|
|
endpoint: 'https://database.chinacloudapi.cn/',
|
|
azureResourceId: AzureResource.Sql
|
|
},
|
|
azureKeyVaultResource: {
|
|
id: SettingIds.vault,
|
|
endpoint: 'https://vault.azure.cn',
|
|
azureResourceId: AzureResource.AzureKeyVault
|
|
},
|
|
azureLogAnalyticsResource: {
|
|
id: SettingIds.ala,
|
|
endpoint: 'https://api.loganalytics.azure.cn',
|
|
azureResourceId: AzureResource.AzureLogAnalytics,
|
|
},
|
|
azureStorageResource: {
|
|
id: SettingIds.storage,
|
|
endpoint: '',
|
|
endpointSuffix: '.core.chinacloudapi.cn',
|
|
azureResourceId: AzureResource.AzureStorage
|
|
},
|
|
azureKustoResource: {
|
|
id: SettingIds.kusto,
|
|
endpoint: 'https://kusto.kusto.chinacloudapi.cn',
|
|
azureResourceId: AzureResource.AzureKusto,
|
|
},
|
|
powerBiResource: {
|
|
id: SettingIds.powerbi,
|
|
endpoint: 'https://analysis.windows.net/powerbi/api',
|
|
azureResourceId: AzureResource.PowerBi
|
|
},
|
|
redirectUri: 'http://localhost',
|
|
scopes: [
|
|
'openid', 'email', 'profile', 'offline_access',
|
|
'https://management.chinacloudapi.cn/user_impersonation'
|
|
],
|
|
portalEndpoint: 'https://portal.azure.cn/'
|
|
}
|
|
}
|
|
};
|
|
|
|
let allSettings = [publicAzureSettings, usGovAzureSettings, chinaAzureSettings];
|
|
allSettings = updateCustomCloudProviderSettings(allSettings);
|
|
export default allSettings;
|