Skip to content

Commit 13425b4

Browse files
committed
updated deploy & test instructions
1 parent b154d45 commit 13425b4

File tree

6 files changed

+69
-12
lines changed

6 files changed

+69
-12
lines changed

README.md

Lines changed: 65 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22

33
![Accounts Payable Bot using Azure Bot Service](https://raw.githubusercontent.com/jomit/ap-bot/master/images/architecture.png)
44

5-
#### Prerequisites
5+
### Prerequisites
66

77
- Active [Azure Subscription](https://azure.microsoft.com/en-us/free)
88

@@ -12,17 +12,17 @@
1212

1313
- Install [Bot Framework Emulator](https://github.com/Microsoft/BotFramework-Emulator/releases)
1414

15-
#### Bot Service
15+
### Bot Service
1616

1717
*Note: Creating the web app bot in Azure also creates an AAD App. If you do not have access to create apps in AAD you can ask your administrator to create a Converged Application at [apps.dev.microsoft.com](https://apps.dev.microsoft.com/) and add you as Owner. Once you are added as owner, you can generate a new password and use it while creating the web app bot*
1818

1919
- Create a [Web App Bot](https://docs.microsoft.com/en-us/azure/bot-service/bot-service-quickstart?view=azure-bot-service-3.0)
2020
- Under Bot template select Language Understanding NodeJS.
21-
- Click on `Application Settings` and copy values for `MicrosoftAppId`,`MicrosoftAppPassword`,`LuisAppId` and`LuisAPIKey`
21+
- Click on `Application Settings` and copy values for `MicrosoftAppId`,`MicrosoftAppPassword`,`LuisAppId` and`LuisAPIKey` and update it in the `web\sample.env` file.
2222

23-
#### LUIS
23+
### LUIS
2424

25-
*Note: If you have created the Web App Bot the LUIS app will be created for you automatically.*
25+
*Note: If you have created the Web App Bot the LUIS app will be created for you automatically.*
2626

2727
- Log in to [www.luis.ai](http://www.luis.ai/) and under `My Apps` click the app that was created.
2828
- Copy name of the LUIS App and update it in the `luis-model\contosoapbot.json` file.
@@ -32,11 +32,68 @@
3232

3333
![Import LUIS Model](https://raw.githubusercontent.com/jomit/ap-bot/master/images/import-luis-model.png)
3434

35-
#### Deploy & Test Locally
35+
### Service Bus
3636

37-
- TODO
37+
- Create a new [Service Bus namespace in Azure](https://docs.microsoft.com/en-us/azure/service-bus-messaging/service-bus-quickstart-portal)
38+
- Under the namespace create a new queue named `requests`
39+
- Under `Shared access policies`, click on `RootManageSharedAccessKey` and copy value for `Primary Connection String`.
40+
- Update the `ServiceBusConnectionString` in `web\sample.env` and `console\sample.env` files.
3841

39-
#### Deploy on Azure
42+
### Databases
43+
44+
- **Analytics DB**
45+
- Create a new Azure SQL DB (or a local SQL Server DB).
46+
- Create table in the DB using `web\analytics\dbscript.sql`.
47+
- Update the `SqlAnalyticsConnectionString` in `web\sample.env` file.
48+
49+
- **Invoice DB**
50+
- Create a new DB on your local SQL Server named `ContosoEdw`.
51+
- Run `console\dbscript\localdb.sql`.
52+
- Update the `sqledwConnectionString` in `console\sample.env` file.
53+
54+
### Servicenow
55+
56+
- Create a servicenow developer account and [create a new dev instance](https://developer.servicenow.com/app.do#!/instance).
57+
- Login to the dev instance and update the admin password.
58+
- Copy dev instance `url`, `password` and update `ServiceNowUrl`, `ServiceNowPassword` in `web\sample.env` file.
59+
60+
- *Note: While testing you can click on `Incidents` to see the new tickets created by the Bot*
61+
62+
### Test Locally
63+
64+
- Rename `web\sample.env`, `console\sample.env` to `.env`
65+
66+
- **Start Bot Web App**
67+
- `cd web`
68+
- `npm install`
69+
- `npm start`
70+
71+
- **Start Bot Process Job**
72+
- `cd console`
73+
- `npm install`
74+
- `npm start`
75+
76+
- **Start Bot Emulator**
77+
- `Endpoint Url : http://localhost:3978/api/messages`
78+
- `Microsoft App ID: [Use MicrosoftAppId from .env file]`
79+
- `Microsoft App Password: [Use MicrosoftAppPassword from .env file]`
80+
- Click Connect
81+
82+
- Type `Hi` in the bot emulator, it should return the text from the Greeting Dialog
83+
84+
![Bot Emulator - Hi](https://raw.githubusercontent.com/jomit/ap-bot/master/images/bot-emulator.png)
85+
86+
- Test bot processor job integration using below sentences, you can always type `help` to get more details:
87+
88+
- **Payment Status** - `what is the payment status for invoice number 11001 and vendor Contoso Inc`
89+
- **PO Status** - `what is the status for po number 11001`
90+
- **Invoice Copy** - `could I have a copy of invoice 11001 from vendor Contoso Inc`
91+
92+
![Invoice Dialogs](https://raw.githubusercontent.com/jomit/ap-bot/master/images/invoice-dialogs.png)
93+
94+
- To Test Servicenow, log in to the dev intance and click on `Incidents` to see the tickets created/updated by the Bot
95+
96+
### Deploy on Azure
4097

4198
- *TODO*
4299

console/sample.env

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
ServiceBusConnectionString=
22
ServiceBusQueueName=requests
3-
sqledwConnectionString=
3+
sqledwConnectionString='Server=localhost\SQLEXPRESS2017;Uid=user;Pwd=password;Database=ContosoEdw'
44
APP_ID=
55
APP_PASSWORD=
66
APP_SCOPES=openid profile offline_access User.Read Mail.Read Mail.Send

images/bot-emulator.png

81.9 KB
Loading

images/invoice-dialogs.png

144 KB
Loading

web/helper.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -44,7 +44,7 @@
4444
helper.startIdleTimeout = function(session){
4545
idleTimeout = setTimeout(() => {
4646
session.beginDialog("HumanHandoffDialog");
47-
},20000);
47+
},30000);
4848
};
4949

5050
helper.stopIdleTimeout = function(callback){

web/sample.env

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ EmailUser=
1010
EmailPassword=
1111
EmailFrom=
1212
EmailTo=
13-
SqlAnalyticsConnectionString=
13+
SqlAnalyticsConnectionString='Server=localhost\SQLEXPRESS2017;Uid=user;Pwd=password;Database=ContosoAPBotAnalytics'
1414
ServiceNowUrl=
15-
ServiceNowUserName=
15+
ServiceNowUserName=admin
1616
ServiceNowPassword=

0 commit comments

Comments
 (0)