Nx plugin for Azure Functions to initialize, create, build, run and publish Azure Functions inside your NX workspace.
npm install @nxazure/func

This plugin allows you to initialize, create, build, run and publish Azure Functions inside your NX workspace.
For NX <= 19, use @nxazure/func version 1.2.0 and lower
For NX >= 20, use @nxazure/func version 1.2.1 and higher
1. Quick Start
2. Features
3. Known possible issues
4. Publish to Azure
5. Limitations
1. Make sure your environment is set as described in the Azure Functions docs.
2. Make sure you install the latest Azure Functions Core Tools. The minimum required version is 4.0.5390. You can check your currently installed version by running func --version command.
3. Create an NX workspace with any method.
``bash`
npx create-nx-workspace@latest my-org
3. Add the @nxazure/func package
`bash`
npm install -D @nxazure/func
4. Initialize a function app
`bash`
nx g @nxazure/func:init my-new-app --directory=apps/my-new-app
5. Add a function to the app
`bash`
nx g @nxazure/func:new myNewFunc --project=my-new-app --template="HTTP trigger"
6. Run the function app
`bash`
nx start my-new-app
1. Support for TS Config paths (e.g., import { tool } from '@my-org/my-lib')node_modules
2. Support for a single folder in the root dir (just like in other monorepo solutions)func
3. Environment variables are loaded by NX (from .env files) but they can be overwritten by individual local.settings.json files
4. All current templates that are supported by the CLI tool are supported.nx run-many --target=start --all
5. Run multiple functions at once
6. Publish the function app straight to your Azure account (az login is required)
1. If after creation the build is failing, try updating @types/node and/or typescript versions.
2. To be able to publish a function to your Azure account, an az login is required first.
3. If you are using the flat eslint config, you might want to add the following to the end of your base config export:
`js`
{
ignores: ['apps//dist', 'apps//_registerPaths.ts'],
}
1. Sign in to Azure
`bash`
az login
2. Make sure you select the correct subscription
`bash`
az account set --subscription "
You can learn more about it on Microsoft Learn.
3. Use the name of your local NX app and the name of your existing function app on Azure to run the publish command:
`bash``
nx publish
4. Wait for the process to finish and the triggers to properly sync
Currently, the plugin supports only TypeScript functions.