⛔Never push sensitive information such as client id's, secrets or keys into repositories including in the README file⛔
This azure functions solution is part of Apprentice Ambassador Network (AAN) project. Here we have background jobs in form of Azure functions that carry out periodical jobs like sending out notifications or cleaning up data.
The notification job uses NServiceBus protocol to send a message per notification to the notification queue. The functions connects directly with the aan-hub database to get and update data.
- A clone of this repository
- Storage emulator like Azurite for local config source
- An Azure Service Bus instance with a Topic called
bundle-1
(optional, only required when working on notification function)
You can find the latest config file in das-employer-config repository.
In the SFA.DAS.AAN.Hub.Jobs
project, if not exist already, add local.settings.json file with following content:
{
"IsEncrypted": false,
"Values": {
"AzureWebJobsStorage": "UseDevelopmentStorage=true;",
"FUNCTIONS_WORKER_RUNTIME": "dotnet-isolated",
"ConfigurationStorageConnectionString": "UseDevelopmentStorage=true;",
"ConfigNames": "SFA.DAS.AANHub.Jobs",
"EnvironmentName": "LOCAL",
"SendNotificationsFunctionSchedule": "0 */3 * * * *",
"MemberDataCleanupFunctionSchedule": "0 */3 * * * *",
"SynchroniseApprenticeDetailsFunctionSchedule": "0 0 0 * * *"
},
"AzureWebJobs.SendNotificationsFunction.Disabled": "false",
"AzureWebJobs.MemberDataCleanupFunction.Disabled": "false",
"AzureWebJobs.SynchroniseApprenticeDetailsFunction.Disabled": "false"
}
When actively developing a function, it may be a good idea to disable other functions by adding "AzureWebJobs.<function-name>.Disabled": "true"
to the local config, example seen above.
- The functions uses database defined in das-aan-hub-api as primary data source.
- The notification functions depends on das-notifications Api to listen to the queue and forward the notification requests to Gov Notify to send out emails.
- SFA.DAS.Notifications.Messages
- SFA.DAS.NServiceBus
- SFA.DAS.Configuration.AzureTableStorage
- .Net 8.0
- Azure Functions V4
- Azure Table Storage
- NServiceBus
- NUnit
- Moq
- FluentAssertions