In this demo scenario, we will demonstrate the sample application that is deployed as part of the template. The application consists of an API Management API that allows a message to be published to a Service Bus topic. An Azure Function and a Logic App workflow are triggered by the message. The function stores the message in table storage, while the workflow stores the message in blob storage. Using the API, stored messages can be retrieved. See the following diagram for an overview:
For this scenario, you'll need to deploy all optional resources except for the Event Hubs namespace. The following resources will be deployed:
See the Naming Convention section in the readme for more information on the naming convention.
Follow the Test section in the README to publish a few messages to the Service Bus topic.
Show the deployed API and its operations.
- Navigate to the API Management instance in the Azure portal.
- Click the
APIs
tab. - Select the
AISQuick Sample
API. - Review the operations:
POST Publish Message
: Publishes a message to the Service Bus topic and returns an ID. This ID can be used in subsequent operations to retrieve the message from storage.GET Blob
: Retrieves a message from blob storage.GET Table Entity
: Retrieves a message from table storage.
Show the secrets stored in Key Vault.
- Navigate to the Key Vault in the Azure portal.
- Click the
Secrets
tab. - Verify that a secret has been created for the API Management master subscription key.
Show the Service Bus topic and its subscriptions.
- Navigate to the Service Bus namespace in the Azure portal.
- Click the
Topics
tab and open theaisquick-sample
topic. - View the traffic that has passed through the topic in the overview.
- Click the
Subscriptions
tab to see the subscriptions created for the Function App and Logic App.
Show the Logic App and deployed workflow.
- Navigate to the Logic App in the Azure portal.
- Click the
Workflows
tab. - Select the
aisquick-sample-workflow
workflow. - Review the workflow in the designer:
- The workflow is triggered by a Service Bus message.
- The message is parsed to extract the ID.
- The message is stored in blob storage with the ID in the file name.
- Click the
Run history
tab and review the executed runs. - Go back to the Logic App.
- Click the
Connections
tab. - Open the
Service Provider Connections
tab and review the deployed connections. - Click the
Parameters
tab and review the available parameters. - Click the
Environment variables
tab. - Show that the
ApiManagement_subscriptionKey
variable uses a key vault reference. - Show the different variables used by the connections.
Show the source code.
- Open SampleFunction.cs.
- Show the
ServiceBusTrigger
attribute, which is configured with the Service Bus topic and subscription, and uses theServiceBusConnection
connection. - Show the
TableOutput
output binding, which uses theStorageAccountConnection
connection to store the return value in table storage.
Show the deployed function.
- Navigate to the Function App in the Azure portal.
- Click
SampleFunction
in the Functions tab on the Overview screen. - Open the
Invocations
tab. - Show the function invocations that have occurred. It might take a few minutes for the first invocation to appear.
NOTE: If you've deployed and removed the same environment multiple times, you might see older invocation history from previous deployments. - Go back to the Function App.
- Click the
Environment variables
tab. - Show that the
ApiManagement_subscriptionKey
variable uses a key vault reference. - Show the different
Connection
variables that can be used by triggers and bindings within the function.
Show the messages stored in blob and table storage.
- Navigate to the Storage Account in the Azure portal.
- Click the
Storage browser
tab. - Select
Blob containers
and thenaisquick-sample
. - Show the messages stored in blob storage.
- Select
Tables
and thenaisquickSample
. - Show the messages stored in table storage.