Filing issues is a great way to contribute to the SDK. Here are some guidelines:
- Include as much detail as you can be about the problem
- Point to a test repository (e.g. hosted on GitHub) that can help reproduce the issue. This works better then trying to describe step by step how to create a repro scenario.
- Github supports markdown, so when filing bugs make sure you check the formatting before clicking submit.
If you don't know what a pull request is read this https://help.github.com/articles/using-pull-requests.
Before we can accept your pull-request you'll need to sign a Contribution License Agreement (CLA). You can sign ours here. However, you don't have to do this up-front. You can simply clone, fork, and submit your pull-request as usual.
When your pull-request is created, we classify it. If the change is trivial, i.e. you just fixed a typo, then the PR is labelled with cla-not-required. Otherwise it's classified as cla-required. In that case, the system will also also tell you how you can sign the CLA. Once you signed a CLA, the current and all future pull-requests will be labelled as cla-signed. Signing the CLA might sound scary but it's actually super simple and can be done in less than a minute.
Before submitting a feature or substantial code contribution please discuss it with the team and ensure it follows the product roadmap. Note that all code submissions will be rigorously reviewed and tested by the Azure Functions Core Tools team, and only those that meet the bar for both quality and design/roadmap appropriateness will be merged into the source.
Install .NET SDK for cross-platform support.
Build the project from the repository root:
dotnet buildThe output will be in out/bin/Azure.Functions.Cli/debug/.
Running and debugging:
-
VS Code - Press
F5to run and debug. You'll be prompted for:- The command (e.g.,
start,new,init) - Optional
--script-rootpath to your test function app
- The command (e.g.,
-
Visual Studio - Press
F5to run and debug. Configure the launch profile to set:- The command via
command line arguments - Path to your test function app path via
working directory
- The command via
Command line:
Run the CLI from source:
dotnet run --project src/Cli/func -- <command>Running against a specific function app:
Option 1 - Run from the function app directory:
cd myTestFunctionApp
dotnet run --project PATH_TO_CORE_TOOLS_REPO/src/Cli/func -- <command>Option 2 - Use the --script-root parameter:
dotnet run --project src/Cli/func -- <command> --script-root PATH_TO_TEST_APPOption 3 - Add the built executable to your PATH:
export PATH=$PATH:/path/to/azure-functions-core-tools/out/bin/Azure.Functions.Cli/debug
func <command>Tests can be run using:
- Visual Studio Test Explorer - Use Test Explorer in Visual Studio
- VS Code - Using the
.NET Core Test Explorerextension to discover and run tests - Command line - Use
dotnet testcommands below
dotnet test test/Cli/Func.UnitTests/Azure.Functions.Cli.UnitTests.csprojE2E tests require Azure Storage emulator (Azurite).
Option 1 - Using the provided script:
./eng/scripts/start-emulators.ps1Option 2 - Manual setup:
- Download Azurite
- Start Azurite before running tests:
azurite --silent --skipApiVersionCheck
Then run the E2E tests:
dotnet test test/Cli/Func.E2ETests/Azure.Functions.Cli.E2ETests.csprojNote: The build automatically copies func to the test output directory (out/bin/Azure.Functions.Cli.E2ETests/debug/). To test a different func executable, set the FUNC_PATH environment variable:
export FUNC_PATH=/path/to/custom/funcIf tests fail due to missing templates, download them:
./eng/scripts/download-templates.ps1 -OutputPath "./out/bin/Azure.Functions.Cli.E2ETests/debug"The script downloads templates to a templates/ folder in the specified output directory.