Azure Bot Service with Application Insights
Creates Azure Bot Service with Application Insights
This example lives in the pulumi/examples repository. Check out just this directory to use it:
git clone --filter=blob:none --sparse https://github.com/pulumi/examples pulumi-examplesgit -C pulumi-examples sparse-checkout set classic-azure-cs-botservicecd pulumi-examples/classic-azure-cs-botserviceStarting point for building Azure Bot Service hosted in Azure App Service.
Provisions Azure Bot Service, Azure Bot Channel registration and Azure Application Insights to be used in combination with App Service - registering Azure AD Microsoft Application with secret.
This will deploy the echo bot code within the ~/bot directory - you can tweak the contents or replace the contents with your own bot. Please ensure you publish the bot first to the ~/bot/publish subfolder, following the instructions in the “Publish the bot” step below.
Prerequisites#
Deploying the example#
-
Publish the bot. Within the
botsubfolder, publish the bot to a subfolder calledpublish:Terminal window dotnet publish -o publish -
Within the
classic-azure-cs-botservicefolder, create a new stack:Terminal window pulumi stack init dev -
Log in to the Azure CLI (you will be prompted to do this during deployment if you forget this step):
Terminal window az login -
Configure the location to deploy the resources to and the Azure subscription:
Terminal window pulumi config set azure:location "North Europe"pulumi config set azure:subscriptionId <YOUR_SUBSCRIPTION_ID> -
Configure the bot name:
Terminal window pulumi config set botName PulumiBot1 -
Deploy the stack:
Terminal window pulumi upPreviewing changes:...Performing changes:...info: 14 changes performed:+ 14 resources createdUpdate duration: 1m22s -
Check the deployed bot using either:
-
Azure Portal Azure Bot Service - Test in Webchat feature
-
Bot Framework Emulator pointing to the output bot endpoint and Microsoft Application Id and the secret you supplied:
BotEndpoint: "https://app8asdf.azurewebsites.net/api/messages"MicrosoftAppId: "b5e65403-923c-4568-z2f6-a6f41b258azz"MicrosoftAppPassword: "<secret>"
-
Cleaning up#
Once you’re finished, tear down your stack’s resources by destroying and removing it:
pulumi destroypulumi stack rm