.azdignore lets template authors exclude files from being copied when consumers run azd init.
Place a .azdignore file at the root of your template repository to keep contributor-only files
(CI configs, internal docs, etc.) out of consumer projects.
.azdignore uses standard .gitignore pattern syntax (via go-gitignore):
*matches any characters within a path segment**matches across directory boundaries (recursive)?matches a single character!patternnegates a previously matched patterndirname/matches a directory and all its contents- Lines starting with
#are comments - Blank lines are ignored
Place .azdignore at the root of your template repository, alongside azure.yaml.
Only the root .azdignore is processed for ignore rules. Nested .azdignore files
(e.g., docs/.azdignore) are not processed but are still removed from consumer projects
to keep the output clean.
A typical .azdignore for a template repository:
# CI/CD files - consumers don't need the template's CI config
.github/
# Contributor-only documentation
CONTRIBUTING.md
CODE_OF_CONDUCT.md
docs/internal/
# Build artifacts that shouldn't be in templates
**/node_modules
*.logExclude all markdown files except README.md:
*.md
!README.md- Self-removing:
.azdignoreis always removed from the consumer's project after processing. Consumers never see the.azdignorefile. - Works with .gitignore: When initializing from a local template, both
.gitignoreand.azdignorerules apply..azdignoreis preserved during the staging copy even if a.gitignorepattern would otherwise exclude it (e.g.,.*). - No-op when absent: If no
.azdignorefile exists, all template files are copied as usual. - Security: Symlinked
.azdignorefiles are rejected. Path traversal patterns (e.g.,../) cannot escape the template directory. Files exceeding 1 MB are rejected.