Giter Club home page Giter Club logo

azurechatbot's Introduction

AzureChatbot

An implementation of Bot Framework v4 with Python.

This bot has been created using Bot Framework, it is a simple Azure chatbot for asking questions about IaaS Virtual Machines. Example of questions/utterances are:

  • What is the Ip address of 'VM_Name'?
  • I would like to check an ip address (Chatbot prompts for VM name)
  • Can you test connectivity between VM1 and VM2 on TCP port 22? (Uses Network Watcher)
  • Check connectivity to VM2 (Chatbot prompts for all other missing information needed)
  • Can you test connectivity (Chatbot prompts for: source, destination, protocol, tcp, port)
  • ...

Some other capabilities are:

  • Handle user interruptions for such things as Help or Cancel
  • Prompt for and validate requests for information from the user

Prerequisites

This chatbot requires prerequisites in order to run.

  • Python 3.7
  • Run pip install -r requirements.txt to install all dependencies
  • Run az login (this bot uses Azure CLI client profile which requires that your local user be logged in via Azure CLI. You can also modify the code to use a Service Principal instead)

This bot uses LUIS, an AI based cognitive service, to implement language understanding. See below for how to create a trial Luis Application (quick setup, no cost)

Create a LUIS Application to enable language understanding

LUIS language model setup, training, and application configuration steps can be found here.

If you wish to create a LUIS application via the CLI, these steps can be found in the README-LUIS.md.

Import cognitive model to LUIS Application

The file cognitiveModels/AzureChatBot.json contains a sample model that you can import into your LUIS Application so that the Entities, Intents and Utterances will be setup and you can start using the bot immediately. Note that the model requires that all your Azure Virtual Machines be listed, you can either manually edit the file or use the helper python script generate_vm_entity_sublist.py to generate a JSON snippet in the right format with all your VMs (make sure you add your subscription information in config.py first).

Running the sample

  • Update LuisAppId, LuisAPIKey and LuisAPIHostName in config.py with the information retrieved from the LUIS portal
  • Update config.py with your Azure Subscription(s) information. More than one subscription is supported
  • Run python app.py
  • Alternatively to the last command, you can set the file in an environment variable with set FLASK_APP=app.py in windows (export FLASK_APP=app.py in mac/linux) and then run flask run --host=127.0.0.1 --port=3978

Testing the bot using Bot Framework Emulator

Bot Framework Emulator is a desktop application that allows bot developers to test and debug their bots on localhost or running remotely through a tunnel.

  • Install the Bot Framework Emulator version 4.3.0 or greater from here

Connect to the bot using Bot Framework Emulator

  • Launch Bot Framework Emulator
  • Enter a Bot URL of http://localhost:3978/api/messages

Testing Azure connection

Run python test_azure_resource_broker.py to test your Azure CLI connection by fetching a list of all your virtual machines

azurechatbot's People

Contributors

vmehmeri avatar

Watchers

James Cloos 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.