This sample Azure Function (v2) app sends a message to Azure Service Bus and receives the message from the Azure Service Bus. While sending and receiving the message, it is validated against the schema stored at the local file system.
In order to run this console application, the following Azure services MUST be ready to use:
- Azure Service Bus topic and subscription, and its connection string.
- Choose the configuration –
Debug
orRelease
. - Update
local.settings.json
with:{ "IsEncrypted": false, "Values": { "AzureWebJobsStorage": "UseDevelopmentStorage=true", "FUNCTIONS_WORKER_RUNTIME": "dotnet", "AzureServiceBusConnectionString": "[AZURE_SEVICE_BUS_CONNECTION_STRING]", "ServiceBusTopic": "[AZURE_SERVICE_BUS_TOPIC]", "ServiceBusTopicSubscription": "[AZURE_SERVICE_BUS_SUBSCRIPTION]" } }
- Put some break points wherever preferred.
- Run the function app locally, and send a request to the following endpoint:
http://localhost:7071/api/servicebus/publish