- The goal of this guide is to help you start contributing to Durable Functions
- OS
- Windows 10 (suggested)
- Language runtimes
- .NET Core 2.0
- Editor
- Visual Studio 2017 (recommended)
- Misc tools (suggested)
- Azure Storage Emulator or real Azure Storage Account
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)
- Build the project and Visual Studio will identify all the tests in the solution.
- Set an environment variable named AzureWebJobsStorage set to an Azure General Purpose Storage Account connection string.
Note: While it is possible to use the local storage emulator (
UseDevelopmentStorage=true
), this is not recommended as performance and reliability are severely impacted while running unit tests; using a real storage account in Azure will yield much better results.
- Run the unit tests via Visual Studio Test Explorer by selecting "Run All"
All tests for Durable Functions are found in test/Common. These tests are written using the XUnit framework.
NOTE: In order to run any tests you write in our CI pipeline, the test must have one of the following attributes:
[Trait("Category", PlatformSpecificHelpers.TestCategory)]
[Trait("Category", PlatformSpecificHelpers.TestCategory + "_BVT")]
[Trait("Category", PlatformSpecificHelpers.FlakeyTestCategory)]
Please avoid writing flakey tests.
Durable Functions are distributed as a NuGet package. So in order to test your changes, you need to integrate it in a function. For that you need the following steps:
- Create a local NuGet source on your dev machine - e.g. C:\LocalNuGet.
- Then add the local NuGet source as a NuGet package source in Visual Studio.
- Modify the code.
- Build the project and this will create a new NuGet package with your changes.
- Add the newly built Durable Functions NuGet package to the local NuGet source. The command to add packages to this location is nuget add package.nupkg -Source C:\LocalNuGet .
- Update your local NuGet cache (%USERPROFILE%\.nuget\packages) with the newest version of the Durable Functions NuGet package.
- In Visual Studio, add the new NuGet package from your local NuGet source to a function.
- Run Azure Storage Emulator with version 5.6 or higher.
- Run the function and debug.
- Leave comments on your PR and @ people for attention
- @AzureFunctions on twitter
- (MSFT Internal only) Functions Dev teams channel & email