-
Notifications
You must be signed in to change notification settings - Fork 442
Contributor Onboarding
The goal of this document is to help folks who want to contribute to the Azure Functions host (aka azure-webjobs-sdk-script).
🚧 This document is still a WIP 🚧
- The host is currently going through a redesign for v2 which moves it onto .NET core and move languages out into their own separate repos. These guidelines are generally written for the work going on in
dev
which is v2. Themaster
branch and a few others are stillv1
and have a different workflow. - The host has some dependencies on having some Azure resources provisioned, so before you get started, make sure you have reliable access to an Azure subscription. E2E tests require a lot of various services to be provisioned. If you're making large contributions which would affect E2E tests, it'll be expected that you can provision those services yourself.
- Be nice :) Everyone is busy and sometimes it can take a bit to get responses on things. Just be patient and, if you do poke someone for help, please be courteous and respectful.
- OS
- Windows 10 (suggested)
- Mac OS X/Linux (not-recommended for now)
- While you can develop from a Mac/Linux machine, it can be a rough experience and not all unit tests pass today. We have improvements where we hope to make this easier.
- Language runtimes
- Note: today you have to have Node.js and Java installed, but in the long run we hope move those tests out into their own repos
- Java 8 (JDK and JRE required)
- Node 8.4+
- .NET Core 2.0
- Editor
- Visual Studio 2017 (recommended)
- VS Code (works, but has some quirks running tests)
- Misc tools (suggested)
- git - source control
- nvm (nvm-windows for windows) - Node Version Manager (for managing multiple versions of Node.js)
- Commander/ConEmu(Windows)/iTerm(mac) - console managers; makes dealing with lots of consoles more manageable
-
functions core tools - helps for making samples/etc.
npm i -g azure-functions-core-tools@core
First thing you'll want to try is to run the Function host locally.
- Set the WebJobs.Script.WebHost to the startup project
- Change the debug configuration to "WebJobs.Script.WebHost.Core"
- Add
AzureWebJobsScriptRoot
setting pointing at your test project- You can add this variable a few ways:
- Add a Environment Variable via a global variable (have to restart VS afterwards)
- Add a setting to appsettings.json (be careful not to check it in)
- Add an environment variable via the Debug configuration for the project (be careful not to check it in)
- You can create a simple hello world function app via the function core tools CLI. In a sample directory just run:
The output of $PWD is your current directory, use that full path
func init func new -l javascript -t httptrigger -n hello echo $PWD
- You can add this variable a few ways:
- (optional) If you want to view logging output, set the following properties:
- WebJobs.Script.WebHost > Properties > Debug > Launch: Project
- Environment variables:
-
ASPNETCORE_ENVIRONMENT
=Development
-
AZURE_FUNCTIONS_ENVIRONMENT
=Development
-
- Click debug - this should launch a new terminal and browser window. If you created a new HTTP-triggered function named "hello", you should be able to add "api/hello" to your base URL and see your Function's response and the
context.log
statement in the terminal.
If you want to test anything other than HTTP, it will require the AzureWebJobsStorage
settings get set to an Azure Storage Account connection string. You'll also need to add settings for any non-storage services you might want to connect to. You can do this via the same 3 methods described above.
There are three test projects in the WebJobs.Script solution
- WebJobs.Script.Scaling.Tests
- WebJobs.Script.Tests
- WebJobs.Script.Test.Integration
The only thing you need to set up for the tests is your Storage Account for the integration tests. You need to set the AzureWebJobsStorage
and AzureWebJobsDashboard
settings for WebJobs.Script.Tests.Integration project. The appsettings.json method is pretty clean, but you need to create it. Be sure "CopyToOutput" is true and rebuild afterwards for the appsettings.json file. To run end to end (E2E) tests, see the set up requirements for Samples under Home.
Then open up for your test explorer (CTRL+E, T) and click Run All. If any fail, you might have set something up wrong locally.
The general flow for making a change to the script host is:
- 🍴 Fork the repo (add the fork via
git remote add me <clone url here>
- 🌳 Create a branch for your change (generally use dev) (
git checkout -b my-change
) - 🛠 Make your change
- ✔️ Test your changes
- ⬆️ Push your changes to your fork (
git push me my-change
) - 💌 Open a PR to the dev branch
- 📢 Address feedback and make sure tests pass (yes even if it's an "unrelated" test failure)
- 📦 Rebase your changes into a meaningful commits (
git rebase -i HEAD~N
whereN
is commits you want to squash) - Rebase and merge (This will be done for you if you don't have contributor access)
- ✂️ Delete your branch (optional)
- Leave comments on your PR and @ people for attention
- @AzureFunctions on twitter
- (MSFT Internal only) Functions Dev teams channel & email
- Configuration Settings
- function.json
- host.json
- host.json (v2)
- Http Functions
- Function Runtime Versioning
- Official Functions developers guide
- Host Health Monitor
- Managing Connections
- Renaming a Function
- Retrieving information about the currently running function
- Site Extension Resolution
- Linux Consumption Regions
- Using LinuxFxVersion for Linux Function apps
- Out-of-proc Cancellation Tokens
- Assembly Resolution in Azure Functions
- ILogger
- Precompiled functions
- Official Functions C# developer reference
- Contributor Onboarding
- Development Process
- Deploying the Functions runtime as a private site extension
- Authoring & Testing Language Extensions
- Bindings in out-of-proc
- Language Extensibility
- Worker Capabilities
- Investigating and reporting issues with timer triggered functions not firing
- Sharing Your Function App name privately
- Azure Functions CLI release notes [moved here]
- Function App Zipped Deployment [deprecated]