New UI for deploying SQL project to a new Azure server (#18833)

This commit is contained in:
Leila Lali
2022-04-29 15:39:21 -07:00
committed by GitHub
parent 14a63977c8
commit d95aff1d3c
17 changed files with 1453 additions and 367 deletions

View File

@@ -45,6 +45,11 @@ declare module 'vscode-mssql' {
*/
readonly azureAccountService: IAzureAccountService;
/**
* Service for accessing Azure Resources functionality
*/
readonly azureResourceService: IAzureResourceService;
/**
* Prompts the user to select an existing connection or create a new one, and then returns the result
* @param ignoreFocusOut Whether the quickpick prompt ignores focus out (default false)
@@ -399,6 +404,13 @@ declare module 'vscode-mssql' {
isSignedIn?: boolean;
}
export interface IAzureAccountSession {
subscription: azure.subscription.Subscription,
tenantId: string,
account: IAccount,
token: Token
}
export interface TokenKey {
/**
* Account Key - uniquely identifies an account
@@ -437,6 +449,38 @@ declare module 'vscode-mssql' {
* Returns an access token for given user and tenant
*/
getAccountSecurityToken(account: IAccount, tenantId: string | undefined): Promise<Token>;
/**
* Returns Azure subscriptions with tenant and token for each given account
*/
getAccountSessions(account: IAccount): Promise<IAzureAccountSession[]>;
}
export interface IAzureResourceService {
/**
* Returns Azure resource groups for given subscription
* @param session Azure session
* @returns List of resource groups
*/
getResourceGroups(session: IAzureAccountSession): Promise<azure.resources.ResourceGroup[]>;
/**
* Creates or updates a Azure SQL server for given subscription, resource group and location
* @param session Azure session
* @param resourceGroupName resource group name
* @param serverName SQL server name
* @param parameters parameters for the SQL server
* @returns name of the SQL server
*/
createOrUpdateServer(session: IAzureAccountSession, resourceGroupName: string, serverName: string, parameters: azure.sql.Server): Promise<string | undefined>;
/**
* Returns Azure locations for given session
* @param session Azure session
* @returns List of locations
*/
getLocations(session: IAzureAccountSession): Promise<azure.subscription.Location[]>;
}
export const enum TaskExecutionMode {
@@ -725,4 +769,462 @@ declare module 'vscode-mssql' {
options: { [name: string]: any };
}
/**
* Namespace for Azure APIs
*/
export namespace azure {
/**
* Namespace for Azure Subscriptions. Types from @azure/arm-subscriptions module
*/
export namespace subscription {
/** Location information. */
interface Location {
/**
* The fully qualified ID of the location. For example, /subscriptions/00000000-0000-0000-0000-000000000000/locations/westus.
* NOTE: This property will not be serialized. It can only be populated by the server.
*/
readonly id?: string;
/**
* The subscription ID.
* NOTE: This property will not be serialized. It can only be populated by the server.
*/
readonly subscriptionId?: string;
/**
* The location name.
* NOTE: This property will not be serialized. It can only be populated by the server.
*/
readonly name?: string;
/**
* The display name of the location.
* NOTE: This property will not be serialized. It can only be populated by the server.
*/
readonly displayName?: string;
/**
* The latitude of the location.
* NOTE: This property will not be serialized. It can only be populated by the server.
*/
readonly latitude?: string;
/**
* The longitude of the location.
* NOTE: This property will not be serialized. It can only be populated by the server.
*/
readonly longitude?: string;
}
/** Subscription information. */
export interface Subscription {
/**
* The fully qualified ID for the subscription. For example, /subscriptions/00000000-0000-0000-0000-000000000000.
* NOTE: This property will not be serialized. It can only be populated by the server.
*/
readonly id?: string;
/**
* The subscription ID.
* NOTE: This property will not be serialized. It can only be populated by the server.
*/
readonly subscriptionId?: string;
/**
* The subscription display name.
* NOTE: This property will not be serialized. It can only be populated by the server.
*/
readonly displayName?: string;
/**
* The subscription state. Possible values are Enabled, Warned, PastDue, Disabled, and Deleted.
* NOTE: This property will not be serialized. It can only be populated by the server.
*/
readonly state?: SubscriptionState;
/** The subscription policies. */
subscriptionPolicies?: SubscriptionPolicies;
/** The authorization source of the request. Valid values are one or more combinations of Legacy, RoleBased, Bypassed, Direct and Management. For example, 'Legacy, RoleBased'. */
authorizationSource?: string;
}
/** Defines values for SubscriptionState. */
export type SubscriptionState = 'Enabled' | 'Warned' | 'PastDue' | 'Disabled' | 'Deleted';
/** Subscription policies. */
export interface SubscriptionPolicies {
/**
* The subscription location placement ID. The ID indicates which regions are visible for a subscription. For example, a subscription with a location placement Id of Public_2014-09-01 has access to Azure public regions.
* NOTE: This property will not be serialized. It can only be populated by the server.
*/
readonly locationPlacementId?: string;
/**
* The subscription quota ID.
* NOTE: This property will not be serialized. It can only be populated by the server.
*/
readonly quotaId?: string;
/**
* The subscription spending limit.
* NOTE: This property will not be serialized. It can only be populated by the server.
*/
readonly spendingLimit?: SpendingLimit;
}
/** Defines values for SpendingLimit. */
export type SpendingLimit = 'On' | 'Off' | 'CurrentPeriodOff';
}
/**
* Namespace for Azure resources. Types from @azure/arm-resources module
*/
export namespace resources {
export interface ResourceGroup {
/**
* The ID of the resource group.
* NOTE: This property will not be serialized. It can only be populated by the server.
*/
readonly id?: string;
/**
* The name of the resource group.
* NOTE: This property will not be serialized. It can only be populated by the server.
*/
readonly name?: string;
/**
* The type of the resource group.
* NOTE: This property will not be serialized. It can only be populated by the server.
*/
readonly type?: string;
/** The resource group properties. */
properties?: ResourceGroupProperties;
/** The location of the resource group. It cannot be changed after the resource group has been created. It must be one of the supported Azure locations. */
location: string;
/** The ID of the resource that manages this resource group. */
managedBy?: string;
/** The tags attached to the resource group. */
tags?: {
[propertyName: string]: string;
};
}
/** The resource group properties. */
export interface ResourceGroupProperties {
/**
* The provisioning state.
* NOTE: This property will not be serialized. It can only be populated by the server.
*/
readonly provisioningState?: string;
}
export interface ResourceGroup {
/**
* The ID of the resource group.
* NOTE: This property will not be serialized. It can only be populated by the server.
*/
readonly id?: string;
/**
* The name of the resource group.
* NOTE: This property will not be serialized. It can only be populated by the server.
*/
readonly name?: string;
/**
* The type of the resource group.
* NOTE: This property will not be serialized. It can only be populated by the server.
*/
readonly type?: string;
/** The resource group properties. */
properties?: ResourceGroupProperties;
/** The location of the resource group. It cannot be changed after the resource group has been created. It must be one of the supported Azure locations. */
location: string;
/** The ID of the resource that manages this resource group. */
managedBy?: string;
/** The tags attached to the resource group. */
tags?: {
[propertyName: string]: string;
};
}
/** The resource group properties. */
export interface ResourceGroupProperties {
/**
* The provisioning state.
* NOTE: This property will not be serialized. It can only be populated by the server.
*/
readonly provisioningState?: string;
}
}
/**
* Namespace for Azure SQL APIs. Types from @azure/arm-sql module
*/
export namespace sql {
/** ARM resource. */
export interface Resource {
/**
* Resource ID.
* NOTE: This property will not be serialized. It can only be populated by the server.
*/
readonly id?: string;
/**
* Resource name.
* NOTE: This property will not be serialized. It can only be populated by the server.
*/
readonly name?: string;
/**
* Resource type.
* NOTE: This property will not be serialized. It can only be populated by the server.
*/
readonly type?: string;
}
/** Azure Active Directory identity configuration for a resource. */
export interface UserIdentity {
/**
* The Azure Active Directory principal id.
* NOTE: This property will not be serialized. It can only be populated by the server.
*/
readonly principalId?: string;
/**
* The Azure Active Directory client id.
* NOTE: This property will not be serialized. It can only be populated by the server.
*/
readonly clientId?: string;
}
/**
* Defines values for IdentityType. \
* {@link KnownIdentityType} can be used interchangeably with IdentityType,
* this enum contains the known values that the service supports.
* ### Known values supported by the service
* **None** \
* **SystemAssigned** \
* **UserAssigned** \
* **SystemAssigned,UserAssigned**
*/
export type IdentityType = string;
/** Azure Active Directory identity configuration for a resource. */
export interface ResourceIdentity {
/** The resource ids of the user assigned identities to use */
userAssignedIdentities?: {
[propertyName: string]: UserIdentity;
};
/**
* The Azure Active Directory principal id.
* NOTE: This property will not be serialized. It can only be populated by the server.
*/
readonly principalId?: string;
/** The identity type. Set this to 'SystemAssigned' in order to automatically create and assign an Azure Active Directory principal for the resource. */
type?: IdentityType;
/**
* The Azure Active Directory tenant id.
* NOTE: This property will not be serialized. It can only be populated by the server.
*/
readonly tenantId?: string;
}
/** ARM tracked top level resource. */
export type TrackedResource = Resource & {
/** Resource location. */
location: string;
/** Resource tags. */
tags?: {
[propertyName: string]: string;
};
};
/** An Azure SQL Database server. */
export type Server = TrackedResource & {
/** The Azure Active Directory identity of the server. */
identity?: ResourceIdentity;
/**
* Kind of sql server. This is metadata used for the Azure portal experience.
* NOTE: This property will not be serialized. It can only be populated by the server.
*/
readonly kind?: string;
/** Administrator username for the server. Once created it cannot be changed. */
administratorLogin?: string;
/** The administrator login password (required for server creation). */
administratorLoginPassword?: string;
/** The version of the server. */
version?: string;
/**
* The state of the server.
* NOTE: This property will not be serialized. It can only be populated by the server.
*/
readonly state?: string;
/**
* The fully qualified domain name of the server.
* NOTE: This property will not be serialized. It can only be populated by the server.
*/
readonly fullyQualifiedDomainName?: string;
/**
* List of private endpoint connections on a server
* NOTE: This property will not be serialized. It can only be populated by the server.
*/
readonly privateEndpointConnections?: ServerPrivateEndpointConnection[];
/** Minimal TLS version. Allowed values: '1.0', '1.1', '1.2' */
minimalTlsVersion?: string;
/** Whether or not public endpoint access is allowed for this server. Value is optional but if passed in, must be 'Enabled' or 'Disabled' */
publicNetworkAccess?: ServerNetworkAccessFlag;
/**
* Whether or not existing server has a workspace created and if it allows connection from workspace
* NOTE: This property will not be serialized. It can only be populated by the server.
*/
readonly workspaceFeature?: ServerWorkspaceFeature;
/** The resource id of a user assigned identity to be used by default. */
primaryUserAssignedIdentityId?: string;
/** The Client id used for cross tenant CMK scenario */
federatedClientId?: string;
/** A CMK URI of the key to use for encryption. */
keyId?: string;
/** The Azure Active Directory identity of the server. */
administrators?: ServerExternalAdministrator;
/** Whether or not to restrict outbound network access for this server. Value is optional but if passed in, must be 'Enabled' or 'Disabled' */
restrictOutboundNetworkAccess?: ServerNetworkAccessFlag;
};
/** A private endpoint connection under a server */
export interface ServerPrivateEndpointConnection {
/**
* Resource ID.
* NOTE: This property will not be serialized. It can only be populated by the server.
*/
readonly id?: string;
/**
* Private endpoint connection properties
* NOTE: This property will not be serialized. It can only be populated by the server.
*/
readonly properties?: PrivateEndpointConnectionProperties;
}
/**
* Defines values for ServerNetworkAccessFlag. \
* {@link KnownServerNetworkAccessFlag} can be used interchangeably with ServerNetworkAccessFlag,
* this enum contains the known values that the service supports.
* ### Known values supported by the service
* **Enabled** \
* **Disabled**
*/
export type ServerNetworkAccessFlag = string;
/**
* Defines values for ServerWorkspaceFeature. \
* {@link KnownServerWorkspaceFeature} can be used interchangeably with ServerWorkspaceFeature,
* this enum contains the known values that the service supports.
* ### Known values supported by the service
* **Connected** \
* **Disconnected**
*/
export type ServerWorkspaceFeature = string;
/** Properties of a active directory administrator. */
export interface ServerExternalAdministrator {
/** Type of the sever administrator. */
administratorType?: AdministratorType;
/** Principal Type of the sever administrator. */
principalType?: PrincipalType;
/** Login name of the server administrator. */
login?: string;
/** SID (object ID) of the server administrator. */
sid?: string;
/** Tenant ID of the administrator. */
tenantId?: string;
/** Azure Active Directory only Authentication enabled. */
azureADOnlyAuthentication?: boolean;
}
/** Properties of a private endpoint connection. */
export interface PrivateEndpointConnectionProperties {
/** Private endpoint which the connection belongs to. */
privateEndpoint?: PrivateEndpointProperty;
/** Connection state of the private endpoint connection. */
privateLinkServiceConnectionState?: PrivateLinkServiceConnectionStateProperty;
/**
* State of the private endpoint connection.
* NOTE: This property will not be serialized. It can only be populated by the server.
*/
readonly provisioningState?: PrivateEndpointProvisioningState;
}
/**
* Defines values for AdministratorType. \
* {@link KnownAdministratorType} can be used interchangeably with AdministratorType,
* this enum contains the known values that the service supports.
* ### Known values supported by the service
* **ActiveDirectory**
*/
export type AdministratorType = string;
/**
* Defines values for PrincipalType. \
* {@link KnownPrincipalType} can be used interchangeably with PrincipalType,
* this enum contains the known values that the service supports.
* ### Known values supported by the service
* **User** \
* **Group** \
* **Application**
*/
export type PrincipalType = string;
export interface PrivateEndpointProperty {
/** Resource id of the private endpoint. */
id?: string;
}
export interface PrivateLinkServiceConnectionStateProperty {
/** The private link service connection status. */
status: PrivateLinkServiceConnectionStateStatus;
/** The private link service connection description. */
description: string;
/**
* The actions required for private link service connection.
* NOTE: This property will not be serialized. It can only be populated by the server.
*/
readonly actionsRequired?: PrivateLinkServiceConnectionStateActionsRequire;
}
/**
* Defines values for PrivateEndpointProvisioningState. \
* {@link KnownPrivateEndpointProvisioningState} can be used interchangeably with PrivateEndpointProvisioningState,
* this enum contains the known values that the service supports.
* ### Known values supported by the service
* **Approving** \
* **Ready** \
* **Dropping** \
* **Failed** \
* **Rejecting**
*/
export type PrivateEndpointProvisioningState = string;
/**
* Defines values for PrivateLinkServiceConnectionStateStatus. \
* {@link KnownPrivateLinkServiceConnectionStateStatus} can be used interchangeably with PrivateLinkServiceConnectionStateStatus,
* this enum contains the known values that the service supports.
* ### Known values supported by the service
* **Approved** \
* **Pending** \
* **Rejected** \
* **Disconnected**
*/
export type PrivateLinkServiceConnectionStateStatus = string;
/**
* Defines values for PrivateLinkServiceConnectionStateActionsRequire. \
* {@link KnownPrivateLinkServiceConnectionStateActionsRequire} can be used interchangeably with PrivateLinkServiceConnectionStateActionsRequire,
* this enum contains the known values that the service supports.
* ### Known values supported by the service
* **None**
*/
export type PrivateLinkServiceConnectionStateActionsRequire = string;
export interface PrivateLinkServiceConnectionStateProperty {
/** The private link service connection status. */
status: PrivateLinkServiceConnectionStateStatus;
/** The private link service connection description. */
description: string;
/**
* The actions required for private link service connection.
* NOTE: This property will not be serialized. It can only be populated by the server.
*/
readonly actionsRequired?: PrivateLinkServiceConnectionStateActionsRequire;
}
}
}
}