This project contains Azure Functions for PLAC.
- Data Import function, timer triggered
- Tier Classification function, triggered by Service Bus Topic
- Go to Azure portal
- Create a new service bus
- choose a service name and click on create
- choose standard on pricing tier
- Edit your new service bus and click on Shared access strategies and RootManageSharedAccessKey and copy the primary connection string
- In Plac functions project settings, paste your connection string as AzureWebJobsServiceBus setting
- Create a new service bus topic
- Create a subscription on your new topic
- Set
TIER_CLASSIFICATION_TOPICin project settings - Make sure that topicName and subscriptionName are correct in TierClassificationFunction/function.json
Now you can test the service bus by running a post request on http://localhost:7071/admin/functions/DataImportFunction
Make sure you have installed (globally) the latest the Azure Functions Core Tools. For instance:
npm i -g azure-functions-core-tools@3 --unsafe-perm true
Run the program:
npm run start
Using Postman, you need to send a POST request to the following endpoint:
- Local: POST http://localhost:7071/admin/functions/DataImportFunction
- Dev: POST https://plac-functions-dev.azurewebsites.net/admin/functions/DataImportFunction
Request Headers:
- Content-Type: application/json
Request Body (select 'raw' in postman):
- Even if it doesn't need any parameter, you have to send an empty objet.
- By default, the function will compute last run time based on a 5 minutes frequency.
- For test/QA purpose, you can set a custom start date, for example:
{
"input": "2020-09-10"
}
This example will fetch all RR items modified after 2020-09-10 00:00.