mirror of
https://github.com/ckaczor/azuredatastudio.git
synced 2026-02-17 02:51:36 -05:00
Add Azure Resource 'Sql' to MSSQL extension. (#21600)
This commit is contained in:
@@ -589,6 +589,7 @@
|
|||||||
"providerId": "MSSQL",
|
"providerId": "MSSQL",
|
||||||
"displayName": "%mssql.provider.displayName%",
|
"displayName": "%mssql.provider.displayName%",
|
||||||
"isExecutionPlanProvider": true,
|
"isExecutionPlanProvider": true,
|
||||||
|
"azureResource": "Sql",
|
||||||
"supportedExecutionPlanFileExtensions": [
|
"supportedExecutionPlanFileExtensions": [
|
||||||
"sqlplan"
|
"sqlplan"
|
||||||
],
|
],
|
||||||
|
|||||||
@@ -48,16 +48,65 @@ export interface ConnectionStringOptions {
|
|||||||
isDefault?: boolean;
|
isDefault?: boolean;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* The connection provider properties.
|
||||||
|
*/
|
||||||
export interface ConnectionProviderProperties {
|
export interface ConnectionProviderProperties {
|
||||||
|
/**
|
||||||
|
* The connection provider id, e.g. MSSQL, LOGANALYTICS
|
||||||
|
*/
|
||||||
providerId: string;
|
providerId: string;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Path to the connection provider's icon
|
||||||
|
*/
|
||||||
iconPath?: URI | IconPath | { id: string, path: IconPath, default?: boolean }[]
|
iconPath?: URI | IconPath | { id: string, path: IconPath, default?: boolean }[]
|
||||||
|
|
||||||
|
/**
|
||||||
|
* The display name of the connection provider, e.g. Microsoft SQL Server, Azure Monitor Logs
|
||||||
|
*/
|
||||||
displayName: string;
|
displayName: string;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Alias to be used for the kernel in notebooks
|
||||||
|
*/
|
||||||
notebookKernelAlias?: string;
|
notebookKernelAlias?: string;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Azure resource endpoint to be used by the connection provider.
|
||||||
|
*
|
||||||
|
* Accepted values are determined from azdata.AzureResource enum:
|
||||||
|
* ResourceManagement, Sql, OssRdbms, AzureKeyVault, Graph, MicrosoftResourceManagement,
|
||||||
|
* AzureDevOps, MsGraph, AzureLogAnalytics, AzureStorage, AzureKusto, PowerBi
|
||||||
|
*
|
||||||
|
* Defaults to 'Sql' if not specified.
|
||||||
|
*/
|
||||||
azureResource?: string;
|
azureResource?: string;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* List of all connection properties for the connection provider.
|
||||||
|
*/
|
||||||
connectionOptions: azdata.ConnectionOption[];
|
connectionOptions: azdata.ConnectionOption[];
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Boolean indicating whether the connection provider supports queries.
|
||||||
|
* The default value is true.
|
||||||
|
*/
|
||||||
isQueryProvider?: boolean;
|
isQueryProvider?: boolean;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Boolean indicating whether the connection provider supports execution plan.
|
||||||
|
*/
|
||||||
isExecutionPlanProvider?: boolean;
|
isExecutionPlanProvider?: boolean;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* List of file extensions supported by the execution plan provider, if execution plan is supported.
|
||||||
|
*/
|
||||||
supportedExecutionPlanFileExtensions?: string[];
|
supportedExecutionPlanFileExtensions?: string[];
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Connection string options for the connection provider
|
||||||
|
*/
|
||||||
connectionStringOptions?: ConnectionStringOptions;
|
connectionStringOptions?: ConnectionStringOptions;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -26,6 +26,10 @@ const ConnectionProviderContrib: IJSONSchema = {
|
|||||||
type: 'string',
|
type: 'string',
|
||||||
description: localize('schema.displayName', "Display Name for the provider")
|
description: localize('schema.displayName', "Display Name for the provider")
|
||||||
},
|
},
|
||||||
|
azureResource: {
|
||||||
|
type: 'string',
|
||||||
|
description: localize('schema.azureResource', "Azure resource endpoint for the provider.")
|
||||||
|
},
|
||||||
notebookKernelAlias: {
|
notebookKernelAlias: {
|
||||||
type: 'string',
|
type: 'string',
|
||||||
description: localize('schema.notebookKernelAlias', "Notebook Kernel Alias for the provider")
|
description: localize('schema.notebookKernelAlias', "Notebook Kernel Alias for the provider")
|
||||||
|
|||||||
@@ -833,7 +833,7 @@ export class ConnectionManagementService extends Disposable implements IConnecti
|
|||||||
// default to SQL if there are no provides or registered resources
|
// default to SQL if there are no provides or registered resources
|
||||||
let provider = this._providers.get(connection.providerName);
|
let provider = this._providers.get(connection.providerName);
|
||||||
if (!provider || !provider.properties || !provider.properties.azureResource) {
|
if (!provider || !provider.properties || !provider.properties.azureResource) {
|
||||||
this._logService.warn('Connection providers incorrectly registered. Defaulting to SQL Azure resource,');
|
this._logService.warn(`Connection provider '${connection.providerName}' is incorrectly registered, defaulting to 'SQL' Azure resource. Provider must specify applicable 'azureResource' in 'connectionProvider' configuration.`);
|
||||||
return AzureResource.Sql;
|
return AzureResource.Sql;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user