Basic Site Provisioning using SharePoint Framework client-side web part and Microsoft Bot Framework

Summary

Sample SharePoint Framework client-side web part illustrating Site Provisioning using Microsoft Bot Framework.

preview.png

 

Applies to

Solution

Solution Author(s)
js-bot-framework Joseph Velliah (SPRIDER, @sprider)

Version history

Version Date Comments
1.0 December 13, 2016 Initial release

Disclaimer

THIS CODE IS PROVIDED AS IS WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESS OR IMPLIED, INCLUDING ANY IMPLIED WARRANTIES OF FITNESS FOR A PARTICULAR PURPOSE, MERCHANTABILITY, OR NON-INFRINGEMENT.


Minimal Path to Awesome

  • clone this repo from here

Register Bot

  • go to https://dev.botframework.com/ and sign in with your Microsoft account
  • click on Register a bot link at the top botregister-step1.png
  • fill all the details like Name, Bot handle, Description and Messaging endpoint
  • generate a new App ID and password by clicking Create Microsoft App ID and password button. Save this value somewhere as we will use in this next step
  • accept the terms and click Register
  • your bot is now registered
  • click edit link under Web Chat channel and notedown the Secret key to configure the client web part botregister-step3
  • you can test your connection here by typing hello message and click Send. Try this step after completing “Publish Bot in Azure Web App” step

Publish Bot in Azure Web App

  • in the Azure Management Portal at https://portal.azure.com create a new Web App(example: https://asksprider.azurewebsites.net/)
  • download the publishing profile from the web app we just created. This will be used to publish the Bot in Azure using Visual Studio
  • Open the web.config file in AskSPRider.sln and update the MicrosoftAppId, MicrosoftAppPassword, O365AdminId and O365AdminPassword
    • MicrosoftAppId – App ID generated from Bot Registration Process
    • MicrosoftAppPassword – App Secret generated from Bot Registration Process
    • O365AdminId – SharePoint Online Admin User Id(example: user@tenant.onmicrosoft.com)
    • O365AdminPassword – SharePoint Online Admin Password
  • save the web.config file
  • right click on the project and publish the bot in Azure using the publishing profile downloaded

Configure web part

  • go to the working directory to the webpart folder in the command line run:
    • npm i
    • tsd install
    • gulp serve
  • add Ask SP Rider webpart and edit it
    • configure bot name and web chat secret key botregister-step4
    • type hello and proceed with site creation process
    • final output botregister-step4

Features

This project illustrates the following concepts:

  • connecting SharePoint Framework client-side web part to a custom bot
  • showing how to embed bot within client-side web part
  • how to create a sub-site by posting set of questions to the user via bot
  • bot form field validations
Advertisements

About Joseph Velliah
As a SharePoint Developer my professional interests tend to be technical and SharePoint focused. I run a blog at "SP RIDER" where you can expect to read HOW TOs and scenarios that I run into during my day to day job. I hope my posts will give back a little to the community that is helped me.

Comments are closed.

%d bloggers like this: