From 64c764f2612686bad6d8d2574b657b5d26cc2224 Mon Sep 17 00:00:00 2001 From: Megan Mott Date: Thu, 13 Jun 2024 14:36:05 -0700 Subject: [PATCH 1/5] add error instead of filtering out --- src/commands/deploy/FunctionAppListStep.ts | 2 +- src/commands/deploy/deploy.ts | 7 +++++++ 2 files changed, 8 insertions(+), 1 deletion(-) diff --git a/src/commands/deploy/FunctionAppListStep.ts b/src/commands/deploy/FunctionAppListStep.ts index 880687bf5..9c7de33c0 100644 --- a/src/commands/deploy/FunctionAppListStep.ts +++ b/src/commands/deploy/FunctionAppListStep.ts @@ -26,7 +26,7 @@ export class FunctionAppListStep extends AzureWizardPromptStep[]> { const client = await createWebSiteClient([context, createSubscriptionContext(nonNullProp(context, 'subscription'))]); const sites = (await uiUtils.listAllIterator(client.webApps.list())); - const qp: IAzureQuickPickItem[] = sites.filter(s => !s.kind?.includes('container') && !!s.kind?.includes('functionapp')).map(fa => { + const qp: IAzureQuickPickItem[] = sites.filter(s => !!s.kind?.includes('functionapp')).map(fa => { return { label: nonNullProp(fa, 'name'), description: parseAzureResourceGroupId(nonNullProp(fa, 'id')).resourceGroup, diff --git a/src/commands/deploy/deploy.ts b/src/commands/deploy/deploy.ts index 3d271e470..2e1da01b3 100644 --- a/src/commands/deploy/deploy.ts +++ b/src/commands/deploy/deploy.ts @@ -81,6 +81,13 @@ async function deploy(actionContext: IActionContext, arg1: vscode.Uri | string | return await getOrCreateFunctionApp(context) }); + if (node.contextValue.includes('container')) { + const learnMoreLink: string = 'https://aka.ms/deployContainerApps' + await context.ui.showWarningMessage(localize('containerFunctionAppError', 'Deploy is not supported for containerized function apps within the Azure Functions extension. Please use the Azure Container Apps extension to deploy your project.'), { learnMoreLink }); + context.errorHandling.suppressDisplay = true; + throw new Error(localize('containerFunctionAppError', 'Deploy is not supported for containerized function apps within the Azure functions extension. Please use the Azure Container Apps extension to deploy your project. For more information go to aka.ms/deployContainerApps.')); + } + const { language, languageModel, version } = await verifyInitForVSCode(context, context.effectiveDeployFsPath); context.telemetry.properties.projectLanguage = language; From add177f5125043faa1ee26da647f06b1035e8114 Mon Sep 17 00:00:00 2001 From: Megan Mott Date: Thu, 13 Jun 2024 14:41:13 -0700 Subject: [PATCH 2/5] Add back into context menu --- package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/package.json b/package.json index 83dedb52f..30bc07f8b 100644 --- a/package.json +++ b/package.json @@ -445,7 +445,7 @@ }, { "command": "azureFunctions.deploy", - "when": "view =~ /(azureResourceGroups|azureFocusView)/ && viewItem =~ /azFunc(ProductionSlot|Flex)(?!.*container)/", + "when": "view =~ /(azureResourceGroups|azureFocusView)/ && viewItem =~ /azFunc(ProductionSlot|Flex)/", "group": "2@1" }, { From a21c25790244f04fb26eb9fc8d4b41b3040fc4d4 Mon Sep 17 00:00:00 2001 From: Megan Mott Date: Thu, 13 Jun 2024 14:42:56 -0700 Subject: [PATCH 3/5] add comment --- src/commands/deploy/deploy.ts | 1 + 1 file changed, 1 insertion(+) diff --git a/src/commands/deploy/deploy.ts b/src/commands/deploy/deploy.ts index 2e1da01b3..121f47bb1 100644 --- a/src/commands/deploy/deploy.ts +++ b/src/commands/deploy/deploy.ts @@ -84,6 +84,7 @@ async function deploy(actionContext: IActionContext, arg1: vscode.Uri | string | if (node.contextValue.includes('container')) { const learnMoreLink: string = 'https://aka.ms/deployContainerApps' await context.ui.showWarningMessage(localize('containerFunctionAppError', 'Deploy is not supported for containerized function apps within the Azure Functions extension. Please use the Azure Container Apps extension to deploy your project.'), { learnMoreLink }); + //suppress display of error message context.errorHandling.suppressDisplay = true; throw new Error(localize('containerFunctionAppError', 'Deploy is not supported for containerized function apps within the Azure functions extension. Please use the Azure Container Apps extension to deploy your project. For more information go to aka.ms/deployContainerApps.')); } From 7f0fa8424b49c5c1c353b38da1b351682cc57b16 Mon Sep 17 00:00:00 2001 From: Megan Mott Date: Thu, 13 Jun 2024 14:44:03 -0700 Subject: [PATCH 4/5] remove message --- src/commands/deploy/deploy.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/commands/deploy/deploy.ts b/src/commands/deploy/deploy.ts index 121f47bb1..62b98d4e1 100644 --- a/src/commands/deploy/deploy.ts +++ b/src/commands/deploy/deploy.ts @@ -86,7 +86,7 @@ async function deploy(actionContext: IActionContext, arg1: vscode.Uri | string | await context.ui.showWarningMessage(localize('containerFunctionAppError', 'Deploy is not supported for containerized function apps within the Azure Functions extension. Please use the Azure Container Apps extension to deploy your project.'), { learnMoreLink }); //suppress display of error message context.errorHandling.suppressDisplay = true; - throw new Error(localize('containerFunctionAppError', 'Deploy is not supported for containerized function apps within the Azure functions extension. Please use the Azure Container Apps extension to deploy your project. For more information go to aka.ms/deployContainerApps.')); + throw new Error(); } const { language, languageModel, version } = await verifyInitForVSCode(context, context.effectiveDeployFsPath); From 64766c9b29e6ff955b0d9c31e9fcae262112b3ea Mon Sep 17 00:00:00 2001 From: Megan Mott Date: Fri, 14 Jun 2024 14:07:34 -0700 Subject: [PATCH 5/5] Add telemetry --- src/commands/deploy/deploy.ts | 1 + 1 file changed, 1 insertion(+) diff --git a/src/commands/deploy/deploy.ts b/src/commands/deploy/deploy.ts index 62b98d4e1..3bdd29949 100644 --- a/src/commands/deploy/deploy.ts +++ b/src/commands/deploy/deploy.ts @@ -86,6 +86,7 @@ async function deploy(actionContext: IActionContext, arg1: vscode.Uri | string | await context.ui.showWarningMessage(localize('containerFunctionAppError', 'Deploy is not supported for containerized function apps within the Azure Functions extension. Please use the Azure Container Apps extension to deploy your project.'), { learnMoreLink }); //suppress display of error message context.errorHandling.suppressDisplay = true; + context.telemetry.properties.error = 'Deploy not supported for containerized function apps'; throw new Error(); }