From 16151a0262f296ed33d69d01b27e3b75368711ac Mon Sep 17 00:00:00 2001 From: Chandni Patel Date: Tue, 21 May 2024 13:30:32 -0500 Subject: [PATCH] adding support for flex consumption plan --- src/handlers/contentPreparer.ts | 2 +- tests/handlers/contentPreparer.spec.ts | 3 ++- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/src/handlers/contentPreparer.ts b/src/handlers/contentPreparer.ts index 3e494dfee..6b2197211 100644 --- a/src/handlers/contentPreparer.ts +++ b/src/handlers/contentPreparer.ts @@ -187,7 +187,7 @@ export class ContentPreparer implements IOrchestratable { if (authenticationType == AuthenticationType.Scm) { // Flex Consumption plan uses api/publish endpoint - if (FunctionSkuUtil.FromString(params.sku) === FunctionSkuConstant.FlexConsumption) { + if (!!params.sku && FunctionSkuUtil.FromString(params.sku) === FunctionSkuConstant.FlexConsumption) { Logger.Info('Will use Kudu https:///api/publish to deploy since Flex consumption plan is detected.'); return PublishMethodConstant.OneDeployFlex; } diff --git a/tests/handlers/contentPreparer.spec.ts b/tests/handlers/contentPreparer.spec.ts index 71d0b505c..29f500245 100644 --- a/tests/handlers/contentPreparer.spec.ts +++ b/tests/handlers/contentPreparer.spec.ts @@ -185,6 +185,7 @@ describe('Check ContentPreparer', function () { it('should use zipdeploy for all other skus', function () { const preparer = new ContentPreparer(); + const params = Builder.GetDefaultActionParameters(); [PackageType.folder, PackageType.zip].forEach(p => { [RuntimeStackConstant.Linux, RuntimeStackConstant.Windows].forEach(r => { @@ -193,7 +194,7 @@ describe('Check ContentPreparer', function () { // @ts-ignore const result = preparer.derivePublishMethod( StateConstant.PreparePublishContent, - p, r, f, a + p, r, f, a, params ); if (r !== RuntimeStackConstant.Linux && f !== FunctionSkuConstant.Consumption) {