Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
37 commits
Select commit Hold shift + click to select a range
c053850
Make sure ci build fails if unit tests fail
ejizba Aug 18, 2022
22259ca
Split types into multiple files (#3)
ejizba Aug 19, 2022
f9c5430
Add bufferBody property to http request (#4)
ejizba Aug 23, 2022
ad0f20b
Bump version (#5)
ejizba Aug 23, 2022
c02aa7d
Copy over latest types-core from worker
ejizba Aug 23, 2022
258f042
Update notice
ejizba Aug 25, 2022
52945a3
Remove enums from core api (#6)
ejizba Aug 26, 2022
949472a
Clean up error naming (#11)
ejizba Aug 26, 2022
b0ba713
Add HttpRequest.get method to types (#10)
ejizba Aug 26, 2022
f193568
Fix bug where nested "bytes" property fails with TypeError (#9)
ejizba Aug 26, 2022
3059701
Bump version
ejizba Aug 26, 2022
80c72f7
Make RPC HTTP converter copy input by value (#14)
hossam-nasr Sep 27, 2022
3b99686
Update bundle/package process as fitting for an npm package (#26)
ejizba Sep 27, 2022
163ba51
update version (#27)
hossam-nasr Sep 27, 2022
7e03daf
Update dependencies (#32)
ejizba Oct 25, 2022
bd93dca
Add a flag to allow suppressing of bad pattern errors/warnings (#33)
hossam-nasr Nov 1, 2022
c2bec64
Bump version [v3.x]
ejizba Nov 1, 2022
a0861b4
Bump version to 3.5.0 (#42)
ejizba Dec 5, 2022
6740c15
Turn on "return-await" eslint rule [v3.x] (#48)
ejizba Dec 16, 2022
752fd22
Mark Node 18 as GA (#57)
ejizba Feb 1, 2023
c3271ba
Bump webpack from 5.74.0 to 5.76.0 (#67)
dependabot[bot] Mar 15, 2023
d2cb03f
Update v3 readme for v4 announcement (#68)
ejizba Mar 23, 2023
2b2177c
Add build version to prerelease package drop (#93)
ejizba Jun 1, 2023
6b680b1
Bump word-wrap from 1.2.3 to 1.2.4 (#114)
dependabot[bot] Jul 25, 2023
7c4deb5
add node 20 to test pipeline (v3) (#140)
hossam-nasr Sep 13, 2023
1d89ce9
add node 20 preview support to readme (v3) (#136)
hossam-nasr Sep 13, 2023
4292066
Validate tag/version in release pipeline (#143)
ejizba Sep 15, 2023
f237118
Adjust v3.x branch for v4 GA (#149)
ejizba Sep 26, 2023
a7c950c
Add code mirror pipeline (#263)
ejizba May 29, 2024
25c4639
Switch to 1es pipelines [v3.x] (#266)
ejizba Jun 6, 2024
c708cc3
Update release pipeline to use 1es templates [v3.x] (#271)
ejizba Jun 12, 2024
dda970c
Run builds nightly (#276)
ejizba Jun 24, 2024
3f316a7
Add Node.js 22 to tests (#278)
ejizba Jun 24, 2024
d22a8c2
Fix public builds from forks (#282)
ejizba Jul 11, 2024
05138f3
add build vulnerability scan (#318)
hallvictoria Dec 18, 2024
c0c0823
Release @azure/functions 3.5.2 with uuid 13.0.2 (#447)
TsuyoshiUshio Jun 17, 2026
b3cf29b
v3: pin uuid to 8.3.2 and re-enable Node 16/18 tests
Jun 17, 2026
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 4 additions & 1 deletion .eslintrc.json
Original file line number Diff line number Diff line change
Expand Up @@ -50,13 +50,16 @@
"error", {
"accessibility": "no-public"
}
]
],
"no-return-await": "off",
"@typescript-eslint/return-await": "error"
},
"ignorePatterns": [
"**/*.js",
"**/*.mjs",
"**/*.cjs",
"dist",
"out",
"azure-functions-language-worker-protobuf"
]
}
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,7 @@ jspm_packages
azure-functions-language-worker-protobuf/*

dist
out
pkg
*.tgz

Expand Down
2 changes: 1 addition & 1 deletion .vscode/tasks.json
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
"kind": "build",
"isDefault": true
},
"problemMatcher": "$tsc-watch",
"problemMatcher": ["$ts-checker-webpack-watch"],
"isBackground": true,
"presentation": {
"reveal": "never"
Expand Down
25 changes: 25 additions & 0 deletions CONTRIBUTING.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
# Contributing

- Clone the repository locally and open in VS Code
- Run "Extensions: Show Recommended Extensions" from the [command palette](https://code.visualstudio.com/docs/getstarted/userinterface#_command-palette) and install all extensions listed under "Workspace Recommendations"
- Run `npm install`
- Run `npm run build`
- Run `npm link`
- Create or open a local function app to test with
- In the local function app:
- Make sure you are calling `func.setup()` somewhere in your app, as described above in the "Usage" section
- Run `npm link @azure/functions`. This will point your app to the local repository for the `@azure/functions` package
- Add the following settings to your "local.settings.json" file or configure them directly as environment variables
- `languageWorkers__node__arguments`: `--inspect`
> 💡 Tip: Set `logging__logLevel__Worker` to `debug` if you want to view worker-specific logs in the output of `func start`
- Start the app (i.e. run `func start` or press <kbd>F5</kbd>)
- Back in the framework repository, press <kbd>F5</kbd> and select the process for your running function app
- Before you submit a PR, run `npm test` and fix any issues. If you want to debug the tests, switch your [launch profile](https://code.visualstudio.com/docs/editor/debugging) in VS Code to "Launch Unit Tests" and press <kbd>F5</kbd>.

## Code of Conduct

This project has adopted the [Microsoft Open Source Code of Conduct](https://opensource.microsoft.com/codeofconduct/). For more information see the [Code of Conduct FAQ](https://opensource.microsoft.com/codeofconduct/faq/) or contact [opencode@microsoft.com](mailto:opencode@microsoft.com) with any additional questions or comments.

## Contributing to type definitions

The type definitions are located in the `types` folder. Please make sure to update the tests in `./test/types/index.test.ts` as well.
389 changes: 0 additions & 389 deletions NOTICE.html

This file was deleted.

67 changes: 26 additions & 41 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,29 +1,43 @@
# Azure Functions Node.js Framework
# Azure Functions Node.js Programming Model

|Branch|Status|Support level|Node.js Versions|
|---|---|---|---|
|v4.x|[![Build Status](https://img.shields.io/azure-devops/build/azfunc/Azure%2520Functions/145/v4.x)](https://azfunc.visualstudio.com/Azure%20Functions/_build/latest?definitionId=145&branchName=v4.x) [![Test Status](https://img.shields.io/azure-devops/tests/azfunc/Azure%2520Functions/146/v4.x?compact_message)](https://azfunc.visualstudio.com/Azure%20Functions/_build/latest?definitionId=146&branchName=v4.x)|Preview|18 (preview)|
|v3.x (default)|[![Build Status](https://img.shields.io/azure-devops/build/azfunc/Azure%2520Functions/145/v3.x)](https://azfunc.visualstudio.com/Azure%20Functions/_build/latest?definitionId=145&branchName=v3.x) [![Test Status](https://img.shields.io/azure-devops/tests/azfunc/Azure%2520Functions/146/v3.x?compact_message)](https://azfunc.visualstudio.com/Azure%20Functions/_build/latest?definitionId=146&branchName=v3.x)|GA (Recommended)|18 (preview), 16, 14|
|v3.x|[![Build Status](https://img.shields.io/azure-devops/build/azfunc/public/514/v3.x)](https://azfunc.visualstudio.com/public/_build/latest?definitionId=514&branchName=v3.x) [![Test Status](https://img.shields.io/azure-devops/tests/azfunc/public/514/v3.x?compact_message)](https://azfunc.visualstudio.com/public/_build/latest?definitionId=514&branchName=v3.x)|GA|20, 18|

## Install

```
npm install @azure/functions
```bash
npm install @azure/functions@3
```

## Usage
## Documentation

- [Azure Functions JavaScript Developer Guide](https://learn.microsoft.com/azure/azure-functions/functions-reference-node?pivots=nodejs-model-v3)
- [Create your first TypeScript function](https://docs.microsoft.com/azure/azure-functions/create-first-function-vs-code-typescript?pivots=nodejs-model-v3)
- [Create your first JavaScript function](https://docs.microsoft.com/azure/azure-functions/create-first-function-vs-code-node?pivots=nodejs-model-v3)

Prior to version 3.5.0, this package only contained TypeScript type definitions. Starting with version 3.5.0 it _also_ contains the underlying Azure Functions Framework for Node.js. This framework package is included by default in [v4.x of the Azure Functions runtime](https://docs.microsoft.com/azure/azure-functions/functions-versions?pivots=programming-language-javascript), meaning you do _not_ need to include the package in your app. However, there may be cases where you want a specific version of the package, so you can override the default shipped in Azure with the below steps.
## Considerations

- The Node.js "programming model" shouldn't be confused with the Azure Functions "runtime".
- _**Programming model**_: Defines how you author your code and is specific to JavaScript and TypeScript.
- _**Runtime**_: Defines underlying behavior of Azure Functions and is shared across all languages.
- The programming model version is strictly tied to the version of the [`@azure/functions`](https://www.npmjs.com/package/@azure/functions) npm package, and is versioned independently of the [runtime](https://learn.microsoft.com/azure/azure-functions/functions-versions?pivots=programming-language-javascript). Both the runtime and the programming model use "4" as their latest major version, but that is purely a coincidence.
- You can't mix the v3 and v4 programming models in the same function app. As soon as you register one v4 function in your app, any v3 functions registered in _function.json_ files are ignored.

## Usage

### TypeScript:
Prior to version 3.5.0, this package only contained TypeScript type definitions. Starting with version 3.5.0 it _also_ contains the underlying Azure Functions Programming Model for Node.js. This package is included by default in [v4.x of the Azure Functions runtime](https://docs.microsoft.com/azure/azure-functions/functions-versions?pivots=programming-language-javascript), meaning you do _not_ need to include the package in your app. However, there may be cases where you want a specific version of the package, so you can override the default shipped in Azure with the below steps.

For a full tutorial, see [how to create your first TypeScript function](https://docs.microsoft.com/azure/azure-functions/create-first-function-vs-code-typescript).
### TypeScript

1. Specify a main entrypoint in your package.json

```json
"main": "dist/src/index.js"
```

2. Add the following code to your entrypoint file (e.g. `src/index.ts`):

```typescript
import * as func from '@azure/functions';

Expand All @@ -32,47 +46,18 @@ For a full tutorial, see [how to create your first TypeScript function](https://

**IMPORTANT NOTE**: If you only want this package for the TypeScript type definitions, you may list this package in the "devDependencies" section of your package.json. If you are overriding the default shipped in Azure as described above, the package must be listed in the production "dependencies" section of your package.json.

For more documentation, see the [TypeScript developer guide](https://docs.microsoft.com/azure/azure-functions/functions-reference-node#typescript).

### JavaScript

For a full tutorial, see [how to create your first JavaScript function](https://docs.microsoft.com/azure/azure-functions/create-first-function-vs-code-node).

1. Specify a main entrypoint in your package.json

```json
"main": "src/index.js"
```

2. Add the following code to your entrypoint file:

```javascript
const func = require('@azure/functions');

func.setup();
```

For more documentation, see the [JavaScript developer guide](https://docs.microsoft.com/azure/azure-functions/functions-reference-node).

## Contributing

- Clone the repository locally and open in VS Code
- Run "Extensions: Show Recommended Extensions" from the [command palette](https://code.visualstudio.com/docs/getstarted/userinterface#_command-palette) and install all extensions listed under "Workspace Recommendations"
- Run `npm install`
- Run `npm run build`
- Run `npm link`
- Create or open a local function app to test with
- In the local function app:
- Make sure you are calling `func.setup()` somewhere in your app, as described above in the "Usage" section
- Run `npm link @azure/functions`. This will point your app to the local repository for the framework package
- Add the following settings to your "local.settings.json" file or configure them directly as environment variables
- `languageWorkers__node__arguments`: `--inspect`
> 💡 Tip: Set `logging__logLevel__Worker` to `debug` if you want to view worker-specific logs in the output of `func start`
- Start the app (i.e. run `func start` or press <kbd>F5</kbd>)
- Back in the framework repository, press <kbd>F5</kbd> and select the process for your running function app
- Before you submit a PR, run `npm run lint` and `npm test` and fix any issues. If you want to debug the tests, switch your [launch profile](https://code.visualstudio.com/docs/editor/debugging) in VS Code to "Launch Unit Tests" and press <kbd>F5</kbd>.

### Code of Conduct

This project has adopted the [Microsoft Open Source Code of Conduct](https://opensource.microsoft.com/codeofconduct/). For more information see the [Code of Conduct FAQ](https://opensource.microsoft.com/codeofconduct/faq/) or contact [opencode@microsoft.com](mailto:opencode@microsoft.com) with any additional questions or comments.

### Contributing to type definitions

The type definitions are located in the `types` folder. Any changes should be applied directly to `./types/index.d.ts`. Please make sure to update the tests in `./types/index.test.ts` as well.
64 changes: 0 additions & 64 deletions azure-pipelines/build.yml

This file was deleted.

17 changes: 17 additions & 0 deletions azure-pipelines/code-mirror.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
trigger:
branches:
include:
- v*.x

resources:
repositories:
- repository: eng
type: git
name: engineering
ref: refs/tags/release

variables:
- template: ci/variables/cfs.yml@eng

extends:
template: ci/code-mirror.yml@eng
58 changes: 58 additions & 0 deletions azure-pipelines/official-build.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,58 @@
parameters:
- name: IsPrerelease
type: boolean
default: true

trigger:
batch: true
branches:
include:
- v3.x

# CI only, does not trigger on PRs.
pr: none

schedules:
- cron: '30 10 * * *'
displayName: Nightly build
always: true
branches:
include:
- v3.x

resources:
repositories:
- repository: 1es
type: git
name: 1ESPipelineTemplates/1ESPipelineTemplates
ref: refs/tags/release

extends:
template: v1/1ES.Official.PipelineTemplate.yml@1es
parameters:
pool:
name: 1es-pool-azfunc
image: 1es-windows-2022
os: windows

stages:
- stage: WindowsUnitTests
dependsOn: []
jobs:
- template: /azure-pipelines/templates/test.yml@self

- stage: LinuxUnitTests
dependsOn: []
jobs:
- template: /azure-pipelines/templates/test.yml@self
pool:
name: 1es-pool-azfunc
image: 1es-ubuntu-22.04
os: linux

- stage: Build
dependsOn: []
jobs:
- template: /azure-pipelines/templates/build.yml@self
parameters:
IsPrerelease: ${{ parameters.IsPrerelease }}
67 changes: 67 additions & 0 deletions azure-pipelines/public-build.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,67 @@
# This build is used for public PR and CI builds.

trigger:
batch: true
branches:
include:
- v3.x

pr:
branches:
include:
- v3.x

schedules:
- cron: '30 10 * * *'
displayName: Nightly build
always: true
branches:
include:
- v3.x

resources:
repositories:
- repository: 1es
type: git
name: 1ESPipelineTemplates/1ESPipelineTemplates
ref: refs/tags/release

extends:
template: v1/1ES.Unofficial.PipelineTemplate.yml@1es
parameters:
pool:
name: 1es-pool-azfunc-public
image: 1es-windows-2022
os: windows

sdl:
codeql:
compiled:
enabled: true
runSourceLanguagesInSourceAnalysis: true

settings:
# PR's from forks do not have sufficient permissions to set tags.
skipBuildTagsForGitHubPullRequests: ${{ variables['System.PullRequest.IsFork'] }}

stages:
- stage: WindowsUnitTests
dependsOn: []
jobs:
- template: /azure-pipelines/templates/test.yml@self

- stage: LinuxUnitTests
dependsOn: []
jobs:
- template: /azure-pipelines/templates/test.yml@self
pool:
name: 1es-pool-azfunc-public
image: 1es-ubuntu-22.04
os: linux

- stage: Build
dependsOn: []
jobs:
- template: /azure-pipelines/templates/build.yml@self
parameters:
IsPrerelease: true
Loading