Approval Bot Sample
Follow these steps to enable running the bot locally for debugging.
- Bot Framework Emulator - Note: The installer does not seem to create any shortcuts to the app. I recommend browsing to
%localappdata%\botframework\app-3.5.35\botframework-emulator.exeand creating a shortcut on your desktop.
- Azure Cosmos DB Emulator
- Visual Studio 2017
Clone the repository locally.
Make a copy of the ./ApprovalBot/PrivateSettings.example.config file in the same directory, and name the copy
Open ApprovalBot.sln in Visual Studio, then open the PrivateSettings.config file.
Register an app at the Application Registration Portal. Get an application ID and secret, and add a Web platform with the redirect URL set to
Set the value of
MicrosoftAppIdto the app ID you just generated, and set the value of
MicrosoftAppPasswordto the secret you just generated.
Open a command prompt and run ngrok with the following command line:
ngrok http 3979 --host-header=localhost:3979
When ngrok starts up, copy the second Forwarding value, which should be an https URL like
https://c8653c26.ngrok.io. Paste this value in the value of
NgrokRootUrlin PrivateSettings.config, and save your changes.
IMPORTANT: Leave ngrok running while you run the sample. If you stop ngrok and re-start it, the forwarding URL changes, and you'll need to update the value of
Start the Azure Cosmos DB Emulator. This needs to be running before you start the sample.
Press F5 to debug the sample.
Run the Bot Framework Emulator. At the top, where it says Enter your endpoint URL, enter
That will prompt for app ID and password. Enter your app ID and secret, and leave Locale blank.
hito confirm the connection.
Limitations when running locally
When running the sample locally, the approval request email that sent is a little different. Because it's not running on a confirmed, registered domain, we must send the message to and from the same account. What that means is that when you get to the point where you request approval, you must include yourself in the list of approvers.
You can include other approvers, but the message they receive won't show the adaptive card. Login to your own mailbox with Outlook to test the adaptive card.
This project welcomes contributions and suggestions. Most contributions require you to agree to a Contributor License Agreement (CLA) declaring that you have the right to, and actually do, grant us the rights to use your contribution. For details, visit https://cla.microsoft.com.
When you submit a pull request, a CLA-bot will automatically determine whether you need to provide a CLA and decorate the PR appropriately (e.g., label, comment). Simply follow the instructions provided by the bot. You will only need to do this once across all repos using our CLA.