This folder contains the C# code for the Command Handler Function. This function handles the insertion of data by publishing events to Azure Event Hubs.
CommandHandler.csproj
: C# project file for the Command Handler function.CommandHandler.cs
: Main code for the Command Handler function.deploy-command-handler.yml
: GitHub Action workflow to automate the deployment of the Command Handler function.
- Azure Subscription: You need an active Azure account.
- Azure Function App: Ensure the Azure Function App is created (using the Bicep template in the
/infrastructure
folder). - GitHub Secrets Configuration:
AZURE_FUNCTIONAPP_PUBLISH_PROFILE_COMMAND_HANDLER
: Publish profile for the Azure Function App.
-
Add Required Secrets to GitHub:
- Go to your repository's Settings > Secrets and variables > Actions > New repository secret.
- Add the following secret:
AZURE_FUNCTIONAPP_PUBLISH_PROFILE_COMMAND_HANDLER
: The publish profile for your Azure Function App.
-
Run the GitHub Action:
- Push your changes to the
main
branch or manually trigger the Deploy Command Handler Function workflow from the Actions tab.
- Push your changes to the
-
Monitor the Deployment:
- Go to the Actions tab in your GitHub repository.
- Select the Deploy Command Handler Function workflow to monitor the deployment progress.
- The Command Handler Function listens for HTTP POST requests.
- Upon receiving a request, it validates the data, then publishes the event to Azure Event Hubs.
- The Update Processor Function will process the event and update the Command DB.
This project is licensed under the MIT License - see the LICENSE file for details.