EDIT:
Locally debugging Azure Function apps (which is the type of application created by the Bot Service) is somewhat complex at this time. The process is also undergoing changes between the Azure SDK 2.9.6 and 3.0. The tooling for VS2017 is also undergoing some changes: .NET Web Development and Tools Blog
Update 3-10-2017: This preview copy of Azure Functions Tools does not
work with the newly released Azure SDK 3.0. If you want to continue
using these tools on Visual Studio 2015, you will need to remain on
the 2.9.6 SDK. Additionally, there are no Azure Function Tools
currently available for Visual Studio 2017. We are actively working
on the 2017 tools, and will provide an update in the next few weeks
regarding our plans and strategy.
This blog post by Benjamin Perkins has a nice walk through: https://blogs.msdn.microsoft.com/benjaminperkins/2016/12/01/how-i-tested-my-chatbot-that-i-created-using-the-bot-services-on-azure/
There's also this : Debugging Bots Built using Azure Bot Service on Windows
The C# environment in Azure Bot Service has more in common with
Node.js than a typical C# app because it requires a runtime host, much
like the Node engine. In Azure, the runtime is part of the hosting
environment in the cloud, but you’ll need to replicate that
environment locally on your desktop.
First, you need to set up your environment. You’ll need:
- A local copy of your Azure Bot Service code (see Setting up Continuous Integration )
- The Bot Framework Emulator
- The Azure Functions CLI
- DotNet CLI
and if you want breakpoint debugging in Visual Studio 15:
- Visual Studio 15—the Community Edition will work fine
- The Command Task Runner Visual Studio Extension
After installing the tools above, you have everything you need to
debug your C# bot locally.
Open a command prompt and navigate to the folder where your
project.json file lives in your repository. Issue the command dotnet
restore to restore the various packages referenced in your bot.
Note: Visual Studio 2017 RC is changing how it handles dependencies
from a project.json to a .csproj model when loading in Visual Studio.
As a result, you will need to download the csproj here:
https://aka.ms/bf-debug-project and save the .csproj into your
/repo/messages folder before running the dotnet restore command.
Note these are also requirements:
Azure 2.9.6 .NET SDK
Visual Studio Tools for Azure Functions
And there's this: https://blogs.msdn.microsoft.com/appserviceteam/2017/03/16/publishing-a-net-class-library-as-a-function-app/ you will find a description of how to publish a function app from visual studio, and how to download and execute an existing function app in visual studio.
Install the Azure Functions CLI from npm.
If you’ve installed the Visual Studio Tools for Azure Functions, just add func.exe to your path from %USERPROFILE%\AppData\Local\Azure.Functions.Cli\1.0.0-beta.93 (or the latest version on your machine).
Go to the Kudu console for your Function App in Function App Settings -> Kudu. Navigate to site and click on the download icon to the left of wwwroot (click on the animated gif below). Or, from an authenticated session, go to https://[YOURFUNCTIONAPP].scm.azurewebsites.net/api/zip/site/wwwroot/.
Unzip the file wwwroot.zip on your local machine. From that directory, run the following:
func azure login
func azure functionapp list
func azure functionapp fetch-app-settings [name]
This will create a local file called appsettings.json. These settings
are only used locally by the Functions CLI. Since this file contains
secrets, be sure not to check this file in to source control! (The
Azure Functions CLI adds appsettings.json to .gitignore for you.)
Copy your downloaded files to the web project folder (including
appsettings.json). Include the script files and function.json in the
project. F5 should now work and successfully attach a debugger.