Azure / Azure/azure-functions-nodejs-library

Run Script once after Deployment

Open
#316 0 comments 0 reactions 0 assignees View on GitHub
area:nodejs-functions
Dominant language
TypeScript
Stars
70
Forks
35
Avg merge
4d 18h
Merged PRs (30d)
6

Description

We have to update our Cosmos DB after we deploy a new version of our function app.

What is the recommended way to do this?

The database is not available from the Internet.
The solution should be as portable as possible, as we might switch to other Azure services.

The [appStart hook](https://learn.microsoft.com/en-us/azure/azure-functions/functions-reference-node?tabs=javascript%2Clinux%2Cazure-cli&pivots=nodejs-model-v4#app-hooks) seems wrongs since it would run multiple times and slow down API responses.

Using Kudu seems bad for multiple reasons:
- The repo has been archived and is no longer maintained
- No documentation on how to run something once on deployment. [This](https://github.com/projectkudu/kudu/wiki/Customizing-deployments) seems to be something else because we don't want to change the deployment itself. We want to run a migration afterwards.

Thanks for your time

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.