Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add an error when deploying a containerized function app instead of filtering out containerized function apps #4182

Merged
merged 5 commits into from
Jun 14, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -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"
},
{
Expand Down
2 changes: 1 addition & 1 deletion src/commands/deploy/FunctionAppListStep.ts
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ export class FunctionAppListStep extends AzureWizardPromptStep<IFuncDeployContex
private async getPicks(context: IFuncDeployContext): Promise<IAzureQuickPickItem<Site | undefined>[]> {
const client = await createWebSiteClient([context, createSubscriptionContext(nonNullProp(context, 'subscription'))]);
const sites = (await uiUtils.listAllIterator(client.webApps.list()));
const qp: IAzureQuickPickItem<Site | undefined>[] = sites.filter(s => !s.kind?.includes('container') && !!s.kind?.includes('functionapp')).map(fa => {
const qp: IAzureQuickPickItem<Site | undefined>[] = sites.filter(s => !!s.kind?.includes('functionapp')).map(fa => {
return {
label: nonNullProp(fa, 'name'),
description: parseAzureResourceGroupId(nonNullProp(fa, 'id')).resourceGroup,
Expand Down
9 changes: 9 additions & 0 deletions src/commands/deploy/deploy.ts
Original file line number Diff line number Diff line change
Expand Up @@ -81,6 +81,15 @@ 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 });
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please use the Azure Container Apps extension to deploy your project

We should change this to something like. "Please read here to learn how to deploy your project" or something.

Maybe we should say Deploy is currently not supported as well since we plan to do it eventually.

//suppress display of error message
context.errorHandling.suppressDisplay = true;
context.telemetry.properties.error = 'Deploy not supported for containerized function apps';
throw new Error();
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We may want to make a new error for telemetry purposes. So we can track when the command is being used to deploy to a container app.

}

const { language, languageModel, version } = await verifyInitForVSCode(context, context.effectiveDeployFsPath);

context.telemetry.properties.projectLanguage = language;
Expand Down
Loading