Skip to content
This repository was archived by the owner on Dec 9, 2024. It is now read-only.

Conversation

@mydiemho
Copy link
Contributor

  1. use the current Azure recommended zip deploy method to run function from deployment package
  2. remove support for individual function deploy since that's not supported by zipdeploy

@mydiemho mydiemho requested review from tbarlow12 and wbreza May 22, 2019 23:09
}
};

await this._sendFile(requestOptions, functionZipFile);
Copy link
Contributor

Choose a reason for hiding this comment

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

Feels like we need some error handling/logging for when this fails. I'm also curious on timeout... if you have a big enough file, will it kill the upload? Or maybe all of this is covered in the _sendFile function?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I was wondering too what’s the best way to handle this. _sendFile is an async function already but the zipdeploy api also let you set an isAsyncFlag (https://github.com/projectkudu/kudu/wiki/Deploying-from-a-zip-file-or-url#asynchronous-zip-deployment). Though I’m not sure how an async within an async would work.

Copy link
Contributor

Choose a reason for hiding this comment

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

I think even a simple try/catch around the await that logs the error could be a start

@pjlittle
Copy link
Contributor

Looking good. Does it make sense to add corresponding tests or are we going to revisit that for the deeper refactor efforts?

@mydiemho
Copy link
Contributor Author

@pjlittle we should discuss how we want to approach unit tests at standup

Copy link
Contributor

@tbarlow12 tbarlow12 left a comment

Choose a reason for hiding this comment

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

Looks great. +1 on unit tests

}
};

await this._sendFile(requestOptions, functionZipFile);
Copy link
Contributor

Choose a reason for hiding this comment

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

I think even a simple try/catch around the await that logs the error could be a start

1. remove individual function deploy support
Copy link
Contributor

@wbreza wbreza left a comment

Choose a reason for hiding this comment

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

Added some feedback - Let's discuss if you have any questions.

if (functionZipFile) {
this.serverless.cli.log(`-> Uploading ${functionZipFile}`);

const uploadUrl = `https://${functionAppName}${constants.scmDomain}${constants.scmZipDeployApiPath}`;
Copy link
Contributor

Choose a reason for hiding this comment

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

I don't think these constants should be used. In theory this should be the only function that should use this URL. Also - the scmDomain is not a constant and will change based on the configuration of the function app.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

scmDomain is coming from config.ts, how will that change with the function app?

return response.data.value || [];
}

public async uploadFunctions(functionApp): Promise<any> {
Copy link
Contributor

Choose a reason for hiding this comment

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

I know we are using zipDeploy method for the service deployment - but I think we should keep a more generic name as the method name. Later on when we introduce runFromPackage we will have multiple branches within this method. Let's stick with uploadFunctions for now.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

just to be clear, I am adding runFromPackage in this PR already, it's the change in the arm template

},
{
"name": "WEBSITE_NODE_DEFAULT_VERSION",
"value": "8.11.1"
Copy link
Contributor

Choose a reason for hiding this comment

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

Just occurred to me that we should probably target the latest Node 8.x LTX, v8.16.0, which comes with NPM v.4.1: https://nodejs.org/en/download/releases/

I would assume this is supported?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

going to put this in a different pr and test :D

@pjlittle
Copy link
Contributor

LGTM :shipit:

Copy link
Contributor

@tbarlow12 tbarlow12 left a comment

Choose a reason for hiding this comment

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

LGTM

@mydiemho mydiemho merged commit 4968deb into dev May 24, 2019
@mydiemho mydiemho deleted the myho/zipDeploy branch May 24, 2019 19:36
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants