diff --git a/appservice/package-lock.json b/appservice/package-lock.json index 25303aae7c..6c3afcea25 100644 --- a/appservice/package-lock.json +++ b/appservice/package-lock.json @@ -1,12 +1,12 @@ { "name": "@microsoft/vscode-azext-azureappservice", - "version": "3.0.1", + "version": "3.1.0", "lockfileVersion": 2, "requires": true, "packages": { "": { "name": "@microsoft/vscode-azext-azureappservice", - "version": "3.0.1", + "version": "3.1.0", "license": "MIT", "dependencies": { "@azure/abort-controller": "^1.0.4", diff --git a/appservice/package.json b/appservice/package.json index 334edfad17..414651f583 100644 --- a/appservice/package.json +++ b/appservice/package.json @@ -1,7 +1,7 @@ { "name": "@microsoft/vscode-azext-azureappservice", "author": "Microsoft Corporation", - "version": "3.0.1", + "version": "3.1.0", "description": "Common tools for developing Azure App Service extensions for VS Code", "tags": [ "azure", diff --git a/appservice/src/createAppService/SiteNameStep.ts b/appservice/src/createAppService/SiteNameStep.ts index fad4018fb3..d69db83ce1 100644 --- a/appservice/src/createAppService/SiteNameStep.ts +++ b/appservice/src/createAppService/SiteNameStep.ts @@ -5,7 +5,7 @@ import type { ResourceNameAvailability, WebSiteManagementClient } from '@azure/arm-appservice'; import { ResourceGroupListStep, StorageAccountListStep, resourceGroupNamingRules, storageAccountNamingRules } from '@microsoft/vscode-azext-azureutils'; -import { AgentInputBoxOptions, AzureNameStep, IAzureAgentInput, IAzureNamingRules, ParameterAgentMetadata } from '@microsoft/vscode-azext-utils'; +import { AgentInputBoxOptions, AzureNameStep, IAzureAgentInput, IAzureNamingRules } from '@microsoft/vscode-azext-utils'; import * as vscode from 'vscode'; import { createWebSiteClient } from '../utils/azureClients'; import { appInsightsNamingRules } from './AppInsightsListStep'; @@ -25,11 +25,11 @@ const siteNamingRules: IAzureNamingRules = { }; export class SiteNameStep extends AzureNameStep { - private _inputBoxOptionsAgentMetadata: ParameterAgentMetadata | undefined; + private _siteFor: "functionApp" | undefined; - constructor(inputBoxOptionsAgentMetadata?: ParameterAgentMetadata) { + constructor(siteFor?: "functionApp" | undefined) { super(); - this._inputBoxOptionsAgentMetadata = inputBoxOptionsAgentMetadata; + this._siteFor = siteFor; } public async prompt(context: SiteNameStepWizardContext): Promise { @@ -59,15 +59,16 @@ export class SiteNameStep extends AzureNameStep { prompt = vscode.l10n.t('Enter a globally unique name for the new web app.'); } + const agentMetadata = this._siteFor === "functionApp" ? + { parameterDisplayTitle: vscode.l10n.t('Function App Name'), parameterDisplayDescription: vscode.l10n.t('The name of the new function app.') } : + { parameterDisplayTitle: vscode.l10n.t('Site Name'), parameterDisplayDescription: vscode.l10n.t('The name of the app service site.'), }; + const options: AgentInputBoxOptions = { prompt, placeHolder, validateInput: (name: string): string | undefined => this.validateSiteName(name), asyncValidationTask: async (name: string): Promise => await this.asyncValidateSiteName(client, name), - agentMetadata: this._inputBoxOptionsAgentMetadata ?? { - parameterDisplayTitle: "Site Name", - parameterDisplayDescription: "The name of the app service site.", - } + agentMetadata: agentMetadata }; context.newSiteName = (await context.ui.showInputBox(options)).trim();