Hi there 👋! Thank you for showing interest in contributing to azd
.
In general, to make contributions a smooth and easy experience, we encourage the following:
- Check existing issues for bugs or enhancements.
- Open an issue if things aren't working as expected, or if an enhancement is being proposed.
- Start a conversation on the issue if you are thinking of submitting a pull request.
- Submit a pull request. The
azd
team will work with you to review the changes and provide feedback. Once the pull request is accepted, a member will merge the changes. Thank you for taking time out of your day to help improve our community!
Prerequisites:
- Go 1.23
Build:
cd cli/azd
go build
Run the newly produced azd
or azd.exe
binary:
- Unix-like systems:
./azd
- Windows:
.\azd.exe
Run tests:
go test ./... -short
Run tests (including end-to-end functional tests)
go test ./...
Run cspell (install cspell):
cspell lint "**/*.go" --relative --config ./.vscode/cspell.yaml
Run linter (install golangci-lint):
golangci-lint run ./...
Note: On Windows you may need to add
C:\Program Files\Git\usr\bin
to%PATH%
If you don't have a preferred editor for Go code, we recommend Visual Studio Code.
Launch and debug:
- Open VSCode in either
cli/azd
(preferred) or in the root directory. - In VSCode, put a breakpoint on the line of code you would like to debug.
- Press F5. Alternatively: Select the "Run and Debug" side pane. With the launch task set to "Debug azd cli", click on the launch button.
- An interactive VSCode prompt should appear. Provide the args for running
azd
in this prompt window. Press enter when you're done. azd
should now be running inside the VSCode terminal with the debugger attached.
Launch azd
separately, then attach:
- Set
AZD_DEBUG=true
in your shell. If this environment variable is set,azd
will pause early in its startup process and allow you to attach to it. - In VSCode, run the launch task "Attach to process".
- Select
azd
and press enter. - VSCode debugger should now be attached to the running
azd
process. - In the shell with
azd
running, press enter to resume execution.
Tip: Use the VSCode terminal to perform all
azd
build and run commands.
- Create a new branch:
git checkout -b my-branch-name
- Make your change, add tests, and ensure tests pass
- Submit a pull request:
gh pr create --web
(install gh cli if needed). Select "Create a fork" to set up a fork for the first time if prompted for.
Windows Security may block execution of unsigned .exe files. This may happen when validating unsigned .exe files produced in a PR build.
> azd version
Access is denied.
To fix:
- Run
where azd
(cmd) or(Get-Command azd).Source
(PowerShell) to get the command path - Click the Start button and type
Windows Security
, select and launch the "Windows Security" application - Select
Virus & threat protection
tab on the left side of the window - Click the
Manage settings
link underVirus & threat protection settings
- Scroll down in the window to the
Exclusions
heading and click theAdd or remove exclusions link
- Select
Add an exclusion
and add the path to the exe from step 1