This demo leverages services of two clouds (Azure and AWS) and leverages Dispatch as the glue between them.
Azure Blob Storage -> Eventgrid -> Dispatch -> AWS Rekognition -> Slack
dispatch create -f eventdriver.yaml
Links:
- https://docs.microsoft.com/en-us/azure/event-grid/manage-event-delivery
- https://docs.microsoft.com/en-us/azure/storage/blobs/storage-blob-event-quickstart?toc=%2fazure%2fevent-grid%2ftoc.json
- Create a container in Azure Blob Storage
- Create an event subscription forwarding the event to the event driver URL
- ensure cloudevent schema
- Add Azure storage credentials:
{ "azure_account_name": "...", "azure_account_key": "...", "azure_public_container": "..." }
dispatch create secret azure-storage azure-secrets.json
- Add Slack webhook url:
{ "webhook-url": "https://hooks.slack.com/services/..." }
dispatch create secret slack slack-secrets.json
- Create the recognition service instance:
dispatch create -f rekognition.yaml
- Create the eventgrid driver type and driver:
dispatch create -f eventdriver.yaml
- Create the eventgrid subcription pushing to Dispatch:
- Open Azure portal
- Create the subscription emitting cloudevents
- Show contents of label.py function highlighting dependencies, secret injection and service injection.
- Create the image with required dependencies:
dispatch create -f image.yaml
- Create the label function:
dispatch create -f function.yaml
- Subscribe the label function to the azure event:
dispatch create -f subscription.yaml
- Upload pic to label:
az storage blob upload --file hotdog.png --container-name dispatchcontainer --name hotdog.png