Skip to content

Commit

Permalink
Merge pull request #11 from Microsoft/DeployToAzureButton
Browse files Browse the repository at this point in the history
Deploy to azure button
  • Loading branch information
karen-j-lee committed Sep 30, 2017
2 parents bbd9023 + be3181e commit 045002c
Show file tree
Hide file tree
Showing 13 changed files with 723 additions and 10 deletions.
14 changes: 11 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ Learn basics of Skype bot development.

Sample | Description | C# | Node
------------ | ------------- | :-----------: | :-----------:
Doctor Code | A bot that teaches how to implement basic functionalities in a Skype bot | [View Sample](/Samples/Csharp/Fundamentals/DoctorCode) | [View Sample](/Samples/Node/Fundamentals/DoctorCode)
Doctor Code | A bot that teaches how to implement basic functionalities in a Skype bot | [View Sample](/Samples/Csharp/Fundamentals/DoctorCode)[![Deploy to Azure][Deploy Button]][Deploy Csharp/Fundamentals/DoctorCode] | [View Sample](/Samples/Node/Fundamentals/DoctorCode)[![Deploy to Azure][Deploy Button]][Deploy Node/Fundamentals/DoctorCode]

## Storage
Learn how to store and retrieve information from Skype bot using cloud services.
Expand All @@ -32,7 +32,8 @@ Add intelligent features to your bots using [Microsoft Cognitive Services](https

Sample | Description | C# | Node
------------ | ------------- | :-----------: | :-----------:
Fridge | A bot that manages your refrigerator inventory using LUIS (Language Understanding Intelligent Service) | [View Sample](/Samples/Csharp/CognitiveServices-Language/Fridge) | [View Sample](/Samples/Node/CognitiveServices-Language/Fridge)
Fridge | A bot that manages your refrigerator inventory using LUIS (Language Understanding Intelligent Service). | [View Sample](/Samples/Csharp/CognitiveServices-Language/Fridge) | [View Sample](/Samples/Node/CognitiveServices-Language/Fridge)[![Deploy to Azure][Deploy Button]][Deploy Node/CognitiveServices-Language/Fridge]
QnA | A bot that helps you get answers based on FAQs using QnAMaker service. | [View Sample](/Samples/Csharp/CognitiveServices-Knowledge/QnA)[![Deploy to Azure][Deploy Button]][Deploy Csharp/CognitiveServices-Knowledge/QnA] | [View Sample](/Samples/Node/CognitiveServices-Knowledge/QnA)[![Deploy to Azure][Deploy Button]][Deploy Node/CognitiveServices-Knowledge/QnA]

## Contributing
This project welcomes contributions and suggestions. Most contributions require you to agree to a Contributor License Agreement (CLA) declaring that you have the right to, and actually do, grant us the rights to use your contribution. For details, visit https://cla.microsoft.com.
Expand All @@ -42,4 +43,11 @@ For more information see the [Code of Conduct FAQ](https://opensource.microsoft.
contact [[email protected]](mailto:[email protected]) with any additional questions or comments.

## License
This project is licensed under the MIT License - see the [LICENSE](LICENSE) file for details.
This project is licensed under the MIT License - see the [LICENSE](LICENSE) file for details.

[Deploy Button]: https://azuredeploy.net/deploybutton.png
[Deploy Csharp/Fundamentals/DoctorCode]: https://azuredeploy.net?repository=https://github.com/Microsoft/skype-dev-bots/tree/master/Samples/Csharp/Fundamentals/DoctorCode
[Deploy Node/Fundamentals/DoctorCode]: https://azuredeploy.net?repository=https://github.com/Microsoft/skype-dev-bots/tree/master/Samples/Node/Fundamentals/DoctorCode
[Deploy Node/CognitiveServices-Language/Fridge]: https://azuredeploy.net?repository=https://github.com/Microsoft/skype-dev-bots/tree/master/Samples/Node/CognitiveServices-Language/Fridge
[Deploy Csharp/CognitiveServices-Knowledge/QnA]: https://azuredeploy.net?repository=https://github.com/Microsoft/skype-dev-bots/tree/master/Samples/Csharp/CognitiveServices-Knowledge/QnA
[Deploy Node/CognitiveServices-Knowledge/QnA]: https://azuredeploy.net?repository=https://github.com/Microsoft/skype-dev-bots/tree/master/Samples/Node/CognitiveServices-Knowledge/QnA
7 changes: 6 additions & 1 deletion Samples/Csharp/CognitiveServices-Knowledge/QnA/README.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,9 @@
# QnA Bot Sample
# QnA Sample

[![Deploy to Azure][Deploy Button]][Deploy Csharp/CognitiveServices-Knowledge/QnA]

[Deploy Button]: https://azuredeploy.net/deploybutton.png
[Deploy Csharp/CognitiveServices-Knowledge/QnA]: https://azuredeploy.net

## Description
QnA is a bot that helps you get answers based on FAQs. The bot uses Azure Cognitive knowledge base QnAMaker service. You can ask Azure Support questions and either get the answers to the question, or get proposed answer/question if the asked question doesn't have answers from the knowledge base.
Expand Down
143 changes: 143 additions & 0 deletions Samples/Csharp/CognitiveServices-Knowledge/QnA/azuredeploy.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,143 @@
{
"$schema": "http:https://schema.management.azure.com/schemas/2014-04-01-preview/deploymentTemplate.json#",
"contentVersion": "1.0.0.0",
"parameters": {
"siteName": {
"defaultValue": "skype-dev-bots",
"type": "string"
},
"hostingPlanName": {
"type": "string"
},
"siteLocation": {
"type": "string"
},
"sku": {
"type": "string",
"allowedValues": [
"Free",
"Shared",
"Basic",
"Standard"
],
"defaultValue": "Free"
},
"workerSize": {
"type": "string",
"allowedValues": [
"0",
"1",
"2"
],
"defaultValue": "0"
},
"repoUrl": {
"type": "string"
},
"branch": {
"type": "string"
},
"Project": {
"type": "string",
"defaultValue": "Samples/Csharp/CognitiveServices-Knowledge/QnA/Qna_Bot"
},
"MicrosoftAppId": {
"type": "string"
},
"MicrosoftAppPassword": {
"type": "string"
},
"QnaSubscriptionKey": {
"type": "string"
},
"QnaKnowledgeBaseId": {
"type": "string"
},
"QnaBaseUrl": {
"type": "string",
"defaultValue": "https://westus.api.cognitive.microsoft.com/qnamaker/v2.0/"
}
},
"resources": [
{
"apiVersion": "2014-06-01",
"name": "[parameters('hostingPlanName')]",
"type": "Microsoft.Web/serverFarms",
"location": "[parameters('siteLocation')]",
"properties": {
"name": "[parameters('hostingPlanName')]",
"sku": "[parameters('sku')]",
"workerSize": "[parameters('workerSize')]",
"numberOfWorkers": 1
}
},
{
"apiVersion": "2014-06-01",
"name": "[parameters('siteName')]",
"type": "Microsoft.Web/Sites",
"location": "[parameters('siteLocation')]",
"dependsOn": [
"[concat('Microsoft.Web/serverFarms/', parameters('hostingPlanName'))]"
],
"tags": {
"[concat('hidden-related:', resourceGroup().id, '/providers/Microsoft.Web/serverfarms/', parameters('hostingPlanName'))]": "empty"
},
"properties": {
"name": "[parameters('siteName')]",
"serverFarm": "[parameters('hostingPlanName')]"
},
"resources": [
{
"apiVersion": "2014-04-01",
"type": "config",
"name": "web",
"dependsOn": [
"[concat('Microsoft.Web/Sites/', parameters('siteName'))]"
],
"properties": {
"appSettings": [
{
"name": "Project",
"value": "[parameters('Project')]"
},
{
"name": "MicrosoftAppId",
"value": "[parameters('MicrosoftAppId')]"
},
{
"name": "MicrosoftAppPassword",
"value": "[parameters('MicrosoftAppPassword')]"
},
{
"name": "QnASubscriptionKey",
"value": "[parameters('QnaSubscriptionKey')]"
},
{
"name": "QnAKnowledgeBaseId",
"value": "[parameters('QnaKnowledgeBaseId')]"
},
{
"name": "QnABaseUrl",
"value": "[parameters('QnaBaseUrl')]"
}
]
}
},
{
"apiVersion": "2014-04-01",
"name": "web",
"type": "sourcecontrols",
"dependsOn": [
"[resourceId('Microsoft.Web/Sites', parameters('siteName'))]",
"[concat('Microsoft.Web/Sites/', parameters('siteName'), '/config/web')]"
],
"properties": {
"RepoUrl": "[parameters('repoUrl')]",
"branch": "[parameters('branch')]",
"IsManualIntegration": true
}
}
]
}
]
}
5 changes: 5 additions & 0 deletions Samples/Csharp/Fundamentals/DoctorCode/README.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,10 @@
# Doctor Code

[![Deploy to Azure][Deploy Button]][Deploy Csharp/Fundamentals/DoctorCode]

[Deploy Button]: https://azuredeploy.net/deploybutton.png
[Deploy Csharp/Fundamentals/DoctorCode]: https://azuredeploy.net

## Description
Doctor Code teaches a developer how to implement few basic functionalities in a Skype bot. You can now build a bot using a bot. Currently, Doctor Code teaches you the following.
- Greet a user: How to send a greeting to your users when your bot meets the users for the first time.
Expand Down
121 changes: 121 additions & 0 deletions Samples/Csharp/Fundamentals/DoctorCode/azuredeploy.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,121 @@
{
"$schema": "http:https://schema.management.azure.com/schemas/2014-04-01-preview/deploymentTemplate.json#",
"contentVersion": "1.0.0.0",
"parameters": {
"siteName": {
"defaultValue": "skype-dev-bots",
"type": "string"
},
"hostingPlanName": {
"type": "string"
},
"siteLocation": {
"type": "string"
},
"sku": {
"type": "string",
"allowedValues": [
"Free",
"Shared",
"Basic",
"Standard"
],
"defaultValue": "Free"
},
"workerSize": {
"type": "string",
"allowedValues": [
"0",
"1",
"2"
],
"defaultValue": "0"
},
"repoUrl": {
"type": "string"
},
"branch": {
"type": "string"
},
"Project": {
"type": "string",
"defaultValue": "Samples/Csharp/Fundamentals/DoctorCode/DrCodeBot"
},
"MicrosoftAppId": {
"type": "string"
},
"MicrosoftAppPassword": {
"type": "string"
}
},
"resources": [
{
"apiVersion": "2014-06-01",
"name": "[parameters('hostingPlanName')]",
"type": "Microsoft.Web/serverFarms",
"location": "[parameters('siteLocation')]",
"properties": {
"name": "[parameters('hostingPlanName')]",
"sku": "[parameters('sku')]",
"workerSize": "[parameters('workerSize')]",
"numberOfWorkers": 1
}
},
{
"apiVersion": "2014-06-01",
"name": "[parameters('siteName')]",
"type": "Microsoft.Web/Sites",
"location": "[parameters('siteLocation')]",
"dependsOn": [
"[concat('Microsoft.Web/serverFarms/', parameters('hostingPlanName'))]"
],
"tags": {
"[concat('hidden-related:', resourceGroup().id, '/providers/Microsoft.Web/serverfarms/', parameters('hostingPlanName'))]": "empty"
},
"properties": {
"name": "[parameters('siteName')]",
"serverFarm": "[parameters('hostingPlanName')]"
},
"resources": [
{
"apiVersion": "2014-04-01",
"type": "config",
"name": "web",
"dependsOn": [
"[concat('Microsoft.Web/Sites/', parameters('siteName'))]"
],
"properties": {
"appSettings": [
{
"name": "Project",
"value": "[parameters('Project')]"
},
{
"name": "MicrosoftAppId",
"value": "[parameters('MicrosoftAppId')]"
},
{
"name": "MicrosoftAppPassword",
"value": "[parameters('MicrosoftAppPassword')]"
}
]
}
},
{
"apiVersion": "2014-04-01",
"name": "web",
"type": "sourcecontrols",
"dependsOn": [
"[resourceId('Microsoft.Web/Sites', parameters('siteName'))]",
"[concat('Microsoft.Web/Sites/', parameters('siteName'), '/config/web')]"
],
"properties": {
"RepoUrl": "[parameters('repoUrl')]",
"branch": "[parameters('branch')]",
"IsManualIntegration": true
}
}
]
}
]
}
2 changes: 1 addition & 1 deletion Samples/Node/CognitiveServices-Knowledge/QnA/.env
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,6 @@ MICROSOFT_APP_ID=''
MICROSOFT_APP_PASSWORD=''

# QnAMaker service API Variables
OCP_API_SUBSCRIPTION_KEY=''
OCP_APIM_SUBSCRIPTION_KEY=''
KNOWLEDGE_BASE=''
QNA_SERVICE_API_URL='https://westus.api.cognitive.microsoft.com/qnamaker/v2.0/knowledgebases/'
11 changes: 8 additions & 3 deletions Samples/Node/CognitiveServices-Knowledge/QnA/README.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,10 @@
# QnA Bot Sample

[![Deploy to Azure][Deploy Button]][Deploy Node/CognitiveServices-Knowledge/QnA]

[Deploy Button]: https://azuredeploy.net/deploybutton.png
[Deploy Node/CognitiveServices-Knowledge/QnA]: https://azuredeploy.net

## Description
QnA is a bot that helps you get answers based on FAQs. The bot uses Azure Cognitive knowledge base QnAMaker service. You can ask Azure Support questions and either get the answers to the question, or get proposed answer/question if the asked question doesn't have answers from the knowledge base.

Expand Down Expand Up @@ -38,7 +43,7 @@ From "My services" -> "View code", you can find the knowledge base ID and Ocp-Ap
```
const headers = {
'content-type': 'application/json',
'Ocp-Apim-Subscription-Key': process.env.OCP_API_SUBSCRIPTION_KEY
'Ocp-Apim-Subscription-Key': process.env.OCP_APIM_SUBSCRIPTION_KEY
};
function query(question, counts) {
Expand Down Expand Up @@ -113,10 +118,10 @@ From "My services" -> "View code", you can find the knowledge base ID and Ocp-Ap
Set up the environment for your bot as described [here](https://docs.microsoft.com/en-us/bot-framework/nodejs/bot-builder-nodejs-quickstart). Install Node.js and npm if not already installed, and install the Bot Builder SDK for Node.js and restify as instructed.

#### Update Configurations
In the .env file, add QnA Maker service API Variables including: OCP_API_SUBSCRIPTION_KEY, KNOWLEDGE_BASE and QNA_SERVICE_API_URL.
In the .env file, add QnA Maker service API Variables including: OCP_APIM_SUBSCRIPTION_KEY, KNOWLEDGE_BASE and QNA_SERVICE_API_URL.
```
# QnA Maker service API Variables
OCP_API_SUBSCRIPTION_KEY='value'
OCP_APIM_SUBSCRIPTION_KEY='value'
KNOWLEDGE_BASE='value'
QNA_SERVICE_API_URL='https://westus.api.cognitive.microsoft.com/qnamaker/v2.0/knowledgebases/'
```
Expand Down
Loading

0 comments on commit 045002c

Please sign in to comment.