All the functions codes of a specific function app would be located in the root folder with one or many subfolders and a host configuration file. The host.json file will contain runtime specific configurations. And each function folder will have one or more code files, function.json, configurations, and other function dependencies:
wwwroot
| - host.json
| - myazurenodefunction
| | - function.json
| | - index.js
| | - node_modules|
| | - ... packages ...
| | - package.json
| - myazurecsharpfunction
| | - function.json
| | - run.csx
With the folder structure we need to apply the best method of branching strategy for robust development and smooth deployment. The best practice is to have multiple branches with a master, which is a default branch, for easy development, and future easy release into production. Those branches are feature, develop, release, and hot fixes branches.
The feature branch helps easy tracking of a feature, as well as aiding parallel development between team members. A feature branch might branch from a develop branch, but should always merge back to a develop branch. The next main branch would be a develop branch and this branch lives through the life cycle of project development and support. When the source code from a develop branch is stable, then it is merged back to the master branch, after successful release, and every merge to the master will trigger a production release.
A release branch may be from a develop branch, but they must merge back to the develop and master branches. The release branch is used for preparation of new production release. The release branch is used for next big release. It provides with us room for minor bug fixes, and for setting up meta data for release. When the release branch is ready to be a real release then we need to make sure it is merged with the master and the commit must be tagged for future historical versions. Finally, the release branch should be merged with the develop branch, so that we get all the changes of this release in future releases.
Last of all is the hotfix branch. This is almost the same as the release branch, as it helps us in production release. Hotfix is actually useful when production deployment fails and you need to hotfix production, so that we can get it back live. So to resolve the production failure, we branch hotfix branch off a production tag from the master branch, so that one team can fix the production failure and rest of the team can continue development on the develop branch. The rule of thumb is that the hotfix branch might branch from a master and then, once hotfix is successful, the changes are merged back to the master. They also need to merge to the develop branch, to make sure we have these hotfix changes in future releases.