Create a new Bot Framework Skill (C#)
In this tutorial
- Download and install
- Create your Skill
- Deploy your Skill
- Test your Skill
- Update your Skill manifest
- Publish your Skill
- Validate the Skill manifest endpoint
- Adding your Skill to an assistant
- Testing your Skill
Install Bot Framework development prerequisites and create a Skill using the Bot Framework Skill Template.
- Retrieve your LUIS Authoring Key
- Review the LUIS regions documentation page for the correct LUIS portal for the region you plan to deploy to. Note that www.luis.ai refers to the US region and an authoring key retrieved from this portal will not work within a Europe deployment.
- Once signed in replace your name in the top right hand corner.
- Choose Settings and make a note of the Authoring Key for the next step.
Time to Complete
A Bot Framework Skill app (in C#) that greets a new user.
Download and install
It's important to ensure all of the following pre-requisites are installed on your machine prior to attempting deployment otherwise you may run into deployment issues.
Install the Skill Template
Ensure you have updated .NET Core to the latest version.
Ensure the Node Package manager is installed.
PowerShell Core version 6 (Required for cross platform deployment support)
Install Bot Framework (CLI) tool dependencies. It's important to do this even if you have earlier versions as we make use of the latest capabilities:
npm install -g botdispatch firstname.lastname@example.org luis-apis qnamaker email@example.com botskills
Install the Azure Command Line Tools (CLI)
Create your Skill
- In Visual Studio, click File > New Project.
- Under Bot, select Skill Template.
- Name your project and click Create.
- Build your project to restore your NuGet packages.
You now have your new Skill! Follow the Deployment steps below before you try and run the project as deployment creates key dependencies required for operation.
Deploy your Skill
The Virtual Assistant require the following dependencies for end to end operation which are created through an ARM script which you can modify as required.
- Azure Web App
- Azure Storage Account (Transcripts)
- Azure Application Insights (Telemetry)
- Azure CosmosDb (State)
- Azure Cognitive Services - Language Understanding
Review the pricing and terms for the services and adjust to suit your scenario.
Run PowerShell Core (pwsh.exe) and change directory to the project directory of your assistant/skill.
Run the following command:
What do these parameters mean?
Parameter Description Required
Unique name for your bot. By default this name will be used as the base name for all your Azure Resources and must be unique across Azure so ensure you prefix with something unique and not MyAssistant Yes
The region for your Azure Resources. By default, this will be the location for all your Azure Resources Yes
The password for the Azure Active Directory App that will be used by your bot. It must be at least 16 characters long, contain at least 1 special character, and contain at least 1 numeric character. If using an existing app, this must be the existing password. Yes
The authoring key for your LUIS account. It can be found at https://www.luis.ai/user/settings or https://eu.luis.ai/user/settings Yes
You can find more detailed deployment steps including customization in the Virtual Assistant and Skill Template deployment page.
Note that if you choose to deploy your Skill manually or re-use an existing App-Service please ensure that Web Sockets are enabled on the App Service configuration pane. The deployment scripts supplied as part of the Skill template will do this automatically.
Test your Skill
Once deployment is complete, you can start debugging through the following steps:
- Open the Bot Framework Emulator.
- Within the Emulator, click File > New Bot Configuration.
- Provide the endpoint of your running Bot, e.g: http://localhost:3978/api/messages
- Provide the AppId and Secret values which you can find in your
appsettings.jsonfile under the
- Click on Save and Connect.
Update your Skill manifest
Your newly created Skill has a basic Skill manifest file provided in the root directory (
manifestTemplate.json), this has been pre-populated with the Skill ID and name and a sample action which you can modify at this stage if required.
Publish your Skill
You can now publish your Skill to Azure using the usual deployment tools and enable easier invocation of the Skill from your assistant project.
Validate the Skill manifest endpoint
- To validate your Skill is deployed and working open up a browser window and navigate to your deployed Skill manifest (
/api/skill/manifest endpoint). e.g.
Adding your Skill to an assistant
To add your new Skill to your assistant/Bot, run the following command from a command prompt within the directory of your assistant/Bot. At this time we have a PowerShell script and a preview botskills CLI.
.\Deployment\scripts\add_remote_skill.ps1 -botName "YOUR_BOT_NAME" -manifestUrl https://YOUR_SKILL.azurewebsites.net/api/skill/manifest
botskills connect --botName YOUR_BOT_NAME --remoteManifest "http://<YOUR_SKILL_MANIFEST>.azurewebsites.net/api/skill/manifest" --luisFolder "<YOUR-SKILL_PATH>\Deployment\Resources\LU\en\" --cs
See the Adding Skills for more detail on how to add skills.
Testing your Skill
Test your skill works in your Bot through the emulator by typing "sample dialog"