This plugin allows you to initialize, create, build, run and publish Azure Functions inside your NX workspace.
- Make sure your environment is set as described in the Azure Functions docs.
- Create an NX workspace with any method.
npx create-nx-workspace@latest my-org
- Add the @nxazure/func package
npm install -D @nxazure/func
- Initialize a function app
nx g @nxazure/func:init my-new-app
- Add a function to the app
nx g @nxazure/func:new my-new-func --project=my-new-app --template="HTTP trigger"
- Run the function app
nx start my-new-app
- If after creation the build is failing, try updating @types/node and/or typescript versions.
- To be able to publish a function to your Azure account, an az login is required first.
- Support for TS Config paths (e.g.,
import { tool } from '@my-org/my-lib'
) - Support for a single
node_modules
folder in the root dir (just like in other monorepo solutions) - All current templates that are supported by the
func
CLI tool are supported. - Run multiple functions at once
nx run-many --target=start --all
- Publish the function app straight to your Azure account (az login is required)
Currently, the plugin supports only TypeScript functions.