NOTE: this repository is really old. I'm archiving it until I have bandwidth to update. In the meantime, you can see working az functions in my exoplanets
repo.
Adding templates here so I can spin up AZ functions quickly.
Following the tutorial from the MSFT docs Last updated: March 8th 2021
Name | Folder | Description | State |
---|---|---|---|
Digital Twin HTTP Trigger | AZfuncHTTPtrig | Given an id, fetches remaining twin data from ADT | working |
Azure Event Hub trigger | AZfuncEHtrigger | Given a eventhub message, patches a tiwn in ADT | started |
local.settings.json
- which you can get here, but it's also generated when you runfunc init
.function.json
- for each app, there are specific function parameters that are omited from the code here. You'll need to create that file.- to build an environment you can use the
requirements.txt
. That has everything for the trigger-simulators as well as the functions.
az dt role-assignment create --dt-name <your-Azure-Digital-Twins-instance> --assignee "<principal-ID>" --role "Azure Digital Twins Data Owner"
- run
func init
to create the extra json files that you will need, as well as starting the project func start
to start the local functions repo
To create your .venv (required to run the function locally):
python -m venv .venv
.venv\scripts\activate
pip install -r requirements.txt
az account set --subscription {your subscription}
to set the subscription may not be needed.