As you all know, there are different triggers available in the Azure Functions. And sometimes it becomes handy to define Cloud solutions. Here is an Azure Function HTTP Trigger scenario.
Customer receive Marketing emails and but choose to unsubscribe / opt out. Then Third Party Marketing Solution sends a webhook in order to update the consents. In this diagram, I have shown Dynamics 365 CRM as the system which stores the consent. But it could be any system which stores the consents.
Azure function with HTTP Trigger will consume the webhook and updates the consent. In short words, it is used as a light weight API here. So next time that customer will not be included in the Marketing emails. Azure API Management is used here as an API Gateway to secure the Azure Function End point. Diagram is given below.