Skip to content

Commit

Permalink
adding support for flex consumption plan
Browse files Browse the repository at this point in the history
  • Loading branch information
patelchandni committed May 21, 2024
1 parent 0b92b39 commit 16151a0
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 2 deletions.
2 changes: 1 addition & 1 deletion src/handlers/contentPreparer.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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://<scmsite>/api/publish to deploy since Flex consumption plan is detected.');
return PublishMethodConstant.OneDeployFlex;
}
Expand Down
3 changes: 2 additions & 1 deletion tests/handlers/contentPreparer.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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 => {
Expand All @@ -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) {
Expand Down

0 comments on commit 16151a0

Please sign in to comment.