GithubHelp home page GithubHelp logo

weatherbot's Introduction

This folder contains a Bot Project created with Bot Framework Composer.

The full documentation for Composer lives here: https://github.com/microsoft/botframework-composer

To test this bot locally, open this folder in Composer, then click "Start Bot"

Provision Azure Resources to Host Bot

This project includes a script that can be used to provision the resources necessary to run your bot in the Azure cloud. Running this script will create all of the necessary resources and return a publishing profile in the form of a JSON object. This JSON object can be imported into Composer's "Publish" tab and used to deploy the bot.

  • From this project folder, navigate to the scripts/ folder
  • Run npm install
  • Run node provisionComposer.js --subscriptionId=<YOUR AZURE SUBSCRIPTION ID> --name=<NAME OF YOUR RESOURCE GROUP> --appPassword=<APP PASSWORD> --environment=<NAME FOR ENVIRONMENT DEFAULT to dev>
  • You will be asked to login to the Azure portal in your browser.
  • You will see progress indicators as the provision process runs. Note that it will take roughly 10 minutes to fully provision the resources.

It will look like this:

{
  "accessToken": "<SOME VALUE>",
  "name": "<NAME OF YOUR RESOURCE GROUP>",
  "environment": "<ENVIRONMENT>",
  "settings": {
    "applicationInsights": {
      "InstrumentationKey": "<SOME VALUE>"
    },
    "cosmosDb": {
      "cosmosDBEndpoint": "<SOME VALUE>",
      "authKey": "<SOME VALUE>",
      "databaseId": "botstate-db",
      "containerId": "botstate-container"
    },
    "blobStorage": {
      "connectionString": "<SOME VALUE>",
      "container": "transcripts"
    },
    "luis": {
      "endpointKey": "<SOME VALUE>",
      "authoringKey": "<SOME VALUE>",
      "region": "westus"
    },
    "MicrosoftAppId": "<SOME VALUE>",
    "MicrosoftAppPassword": "<SOME VALUE>"
  }
}```

When completed, you will see a message with a JSON "publishing profile" and instructions for using it in Composer.


## Publish bot to Azure

To publish your bot to a Azure resources provisioned using the process above:

* Open your bot in Composer
* Navigate to the "Publish" tab
* Select "Add new profile" from the toolbar
* In the resulting dialog box, choose "azurePublish" from the "Publish Destination Type" dropdown
* Paste in the profile you received from the provisioning script

When you are ready to publish your bot to Azure, select the newly created profile from the sidebar and click "Publish to selected profile" in the toolbar.

## Refresh your Azure Token

When publishing, you may encounter an error about your access token being expired. This happens when the access token used to provision your bot expires.

To get a new token:

* Open a terminal window
* Run `az account get-access-token`
* This will result in a JSON object printed to the console, containing a new `accessToken` field.
* Copy the value of the accessToken from the terminal and into the publish `accessToken` field in the profile in Composer.

weatherbot's People

Watchers

 avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.