azure-functions-typescript — GitHub Copilot rule for Azure Functions
This rule guides Copilot when generating TypeScript APIs for Azure Functions, including async code and endpoint file layout. It also calls for updating the OpenAPI schema and README.md when the API changes.
.github/instructions/azure-functions-typescript.instructions.mdWhat azure-functions-typescript does
The rule applies to *.ts, *.js, and *.json files. It asks for modern TypeScript for Node.js and async/await for asynchronous work. For I/O, it favors APIs such as node:fs/promises to avoid blocking the event loop. Copilot should ask before adding a dependency.
The API uses Azure Functions with @azure/functions@4. Each endpoint belongs in its own file, following src/functions/<resource-name>-<http-verb>.ts. That convention shapes where generated functions go. When the API changes, update the OpenAPI schema if one exists, along with README.md; the rule also favors Node.js v22 LTS built-ins where possible.
What it helps with
- organize API endpoints into separate function files
- use asynchronous Node.js APIs for I/O
- keep API changes reflected in the OpenAPI schema and README.md
- ask before introducing project dependencies
Example prompts for the agent
- Add an HTTP endpoint for orders in
src/functions/orders-get.ts. - Replace blocking file access with an asynchronous Node.js API.
- Update the API and bring its OpenAPI schema and
README.mdin line.
How to install azure-functions-typescript
Manually: put the files in place
.github/instructions/azure-functions-typescript.instructions.mdThe applyTo field sets which files it applies to
Manually: put the files in place
.claude/rules/azure-functions-typescript.mdThe paths frontmatter field limits the files: move applyTo from the source into paths
AGENTS.md
Codex reads AGENTS.md: paste the rule text there
Manually: put the files in place
.cursor/rules/azure-functions-typescript.mdcFrontmatter: description, globs, alwaysApply. Move applyTo from the source into globs, or the rule will not attach on its own
Manually: put the files in place
.devin/rules/azure-functions-typescript.mdManually: put the files in place
.clinerules/azure-functions-typescript.mdStep by step, with commands for each platform: AGENTS.md vs CLAUDE.md: what they are and which one to use
Questions about azure-functions-typescript
How do I install azure-functions-typescript in GitHub Copilot?
Add the rule file to your project at .github/instructions/azure-functions-typescript.instructions.md.
What does azure-functions-typescript do?
It guides Copilot on TypeScript API code for Azure Functions, including async operations, endpoint file layout, and API documentation updates.
How should I name an endpoint function file?
Use src/functions/<resource-name>-<http-verb>.ts, with one function file per endpoint.
Source text
azure-functions-typescript.instructions.md · MIT
--- description: 'TypeScript patterns for Azure Functions' applyTo: '**/*.ts, **/*.js, **/*.json' --- ## Guidance for Code Generation - Generate modern TypeScript code for Node.js - Use `async/await` for asynchronous code - Whenever possible, use Node.js v22 LTS built-in modules instead of external packages - Always use Node.js async functions, like `node:fs/promises` instead of `fs` to avoid blocking the event loop - Ask before adding any extra dependencies to the project - The API is built using Azure Functions using `@azure/functions@4` package. - Each endpoint should have its own function file, and use the following naming convention: `src/functions/<resource-name>-<http-verb>.ts` - When making changes to the API, make sure to update the OpenAPI schema (if it exists) and `README.md` file accordingly.
© github · MIT · github/awesome-copilot