-
Notifications
You must be signed in to change notification settings - Fork 160
feat: Updates to deployment process to enable rollback (Part 2) #185
Conversation
PIC123
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks good! Great progress with the rollback, and standardizing on blobstore uploads makes things much more extensible
| /** | ||
| * Initialize deployment artifact container if rollback is specified | ||
| */ | ||
| public async initialize() { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Is this unnecessary because of the added params in the constructor?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Rather than initializing the blob storage here, it initializes before actually creating the blob. The problem was it was trying to initialize and create a container for an account that didn't yet exist
mydiemho
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
in description, you said Future rollback implementation will download the appropriate archive and re-deploy it to the Function App.. So what is the current implementation?
src/services/functionAppService.ts
Outdated
| /** | ||
| * Uploads artifact file to blob storage container | ||
| */ | ||
| private async uploadFunctionAppToBlobStorage() { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I would call this uploadZipArtifactToBlobStorage or uploadFunctionArtifactToBlobStorage
src/services/functionAppService.ts
Outdated
| this.log("Deploying serverless functions..."); | ||
|
|
||
| await this.zipDeploy(functionApp); | ||
| await this.uploadFunctionAppToBlobStorage(); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
commented suggestion below but this name is kinda misleading, both are zip deploy, the only difference is zip storage location
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
also why are we uploading to both place? what is the value of RUN_FROM_PACKAGE?
## High Level Overview - Uploads a timestamped archive of code to Azure Blob Storage - Adds same timestamp to ARM deployments to enable linking - **Does not set `WEBSITE_RUN_FROM_PACKAGE` to use package directly from blob storage** - Currently just used as an archive. Initially, thought to update the `WEBSITE_RUN_FROM_PACKAGE` setting with the URL for the blob (hence the implementation of the SAS URL generator), but discovered [issues with cold start when using that methodology to deploy to Windows](https://docs.microsoft.com/en-us/azure/azure-functions/run-functions-from-deployment-package#enabling-functions-to-run-from-a-package). - Future `rollback` implementation will download the appropriate archive and re-deploy it to the Function App. - This may (and probably will) change as the Azure Functions Premium plan is released on Linux or cold start issues are mitigated ## Details - Adds dependency on the `@azure/arm-storage` package - Sets `rollbackEnabled` as default - Updates broken tests because of timestamped deployment name - Add tests for blob storage operations - Allows user to still specify deployment name with rollback Resolves [AB#388], [AB#358], [AB#414] and [AB#415]
High Level Overview
WEBSITE_RUN_FROM_PACKAGEto use package directly from blob storageWEBSITE_RUN_FROM_PACKAGEsetting with the URL for the blob (hence the implementation of the SAS URL generator), but discovered issues with cold start when using that methodology to deploy to Windows.rollbackimplementation will download the appropriate archive and re-deploy it to the Function App.Details
@azure/arm-storagepackagerollbackEnabledas defaultResolves [AB#388], [AB#358], [AB#414] and [AB#415]