diff --git a/README.md b/README.md index bcd461e..cb5798d 100644 --- a/README.md +++ b/README.md @@ -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. @@ -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. @@ -42,4 +43,11 @@ For more information see the [Code of Conduct FAQ](https://opensource.microsoft. contact [opencode@microsoft.com](mailto:opencode@microsoft.com) with any additional questions or comments. ## License -This project is licensed under the MIT License - see the [LICENSE](LICENSE) file for details. \ No newline at end of file +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 diff --git a/Samples/Csharp/CognitiveServices-Knowledge/QnA/README.md b/Samples/Csharp/CognitiveServices-Knowledge/QnA/README.md index b5e000a..25dc18a 100644 --- a/Samples/Csharp/CognitiveServices-Knowledge/QnA/README.md +++ b/Samples/Csharp/CognitiveServices-Knowledge/QnA/README.md @@ -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. diff --git a/Samples/Csharp/CognitiveServices-Knowledge/QnA/azuredeploy.json b/Samples/Csharp/CognitiveServices-Knowledge/QnA/azuredeploy.json new file mode 100644 index 0000000..a537667 --- /dev/null +++ b/Samples/Csharp/CognitiveServices-Knowledge/QnA/azuredeploy.json @@ -0,0 +1,143 @@ +{ + "$schema": "http://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 + } + } + ] + } + ] + } \ No newline at end of file diff --git a/Samples/Csharp/Fundamentals/DoctorCode/README.md b/Samples/Csharp/Fundamentals/DoctorCode/README.md index 800acfa..ee1cde3 100644 --- a/Samples/Csharp/Fundamentals/DoctorCode/README.md +++ b/Samples/Csharp/Fundamentals/DoctorCode/README.md @@ -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. diff --git a/Samples/Csharp/Fundamentals/DoctorCode/azuredeploy.json b/Samples/Csharp/Fundamentals/DoctorCode/azuredeploy.json new file mode 100644 index 0000000..7f4e880 --- /dev/null +++ b/Samples/Csharp/Fundamentals/DoctorCode/azuredeploy.json @@ -0,0 +1,121 @@ +{ + "$schema": "http://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 + } + } + ] + } + ] + } \ No newline at end of file diff --git a/Samples/Node/CognitiveServices-Knowledge/QnA/.env b/Samples/Node/CognitiveServices-Knowledge/QnA/.env index 8e685a0..6fbf5ba 100644 --- a/Samples/Node/CognitiveServices-Knowledge/QnA/.env +++ b/Samples/Node/CognitiveServices-Knowledge/QnA/.env @@ -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/' diff --git a/Samples/Node/CognitiveServices-Knowledge/QnA/README.md b/Samples/Node/CognitiveServices-Knowledge/QnA/README.md index 5c04563..dcf4431 100644 --- a/Samples/Node/CognitiveServices-Knowledge/QnA/README.md +++ b/Samples/Node/CognitiveServices-Knowledge/QnA/README.md @@ -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. @@ -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) { @@ -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/' ``` diff --git a/Samples/Node/CognitiveServices-Knowledge/QnA/azuredeploy.json b/Samples/Node/CognitiveServices-Knowledge/QnA/azuredeploy.json new file mode 100644 index 0000000..6d6c06d --- /dev/null +++ b/Samples/Node/CognitiveServices-Knowledge/QnA/azuredeploy.json @@ -0,0 +1,151 @@ +{ + "$schema": "http://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/Node/CognitiveServices-Knowledge/QnA" + }, + "WebsiteNodeDefaultVersion": { + "type": "string", + "defaultValue": "6.9.1" + }, + "MicrosoftAppId": { + "type": "string" + }, + "MicrosoftAppPassword": { + "type": "string" + }, + "OcpApimSubscriptionKey": { + "type": "string" + }, + "KnowledgeBase": { + "type": "string" + }, + "QnaServiceApiUrl": { + "type": "string", + "defaultValue": "https://westus.api.cognitive.microsoft.com/qnamaker/v2.0/knowledgebases/" + } + }, + "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": "WEBSITE_NODE_DEFAULT_VERSION", + "value": "[parameters('WebsiteNodeDefaultVersion')]" + }, + { + "name": "Project", + "value": "[parameters('Project')]" + }, + { + "name": "MICROSOFT_APP_ID", + "value": "[parameters('MicrosoftAppId')]" + }, + { + "name": "MICROSOFT_APP_PASSWORD", + "value": "[parameters('MicrosoftAppPassword')]" + }, + { + "name": "OCP_APIM_SUBSCRIPTION_KEY", + "value": "[parameters('OcpApimSubscriptionKey')]" + }, + { + "name": "KNOWLEDGE_BASE", + "value": "[parameters('KnowledgeBase')]" + }, + { + "name": "QNA_SERVICE_API_URL", + "value": "[parameters('QnaServiceApiUrl')]" + } + ] + } + }, + { + "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 + } + } + ] + } + ] + } diff --git a/Samples/Node/CognitiveServices-Knowledge/QnA/src/controller/qnaQueryService.js b/Samples/Node/CognitiveServices-Knowledge/QnA/src/controller/qnaQueryService.js index 6c558db..baa89b6 100644 --- a/Samples/Node/CognitiveServices-Knowledge/QnA/src/controller/qnaQueryService.js +++ b/Samples/Node/CognitiveServices-Knowledge/QnA/src/controller/qnaQueryService.js @@ -13,7 +13,7 @@ const request = require('request'); module.exports = function () { 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) { diff --git a/Samples/Node/CognitiveServices-Language/Fridge/README.md b/Samples/Node/CognitiveServices-Language/Fridge/README.md index a297af1..caacd6b 100644 --- a/Samples/Node/CognitiveServices-Language/Fridge/README.md +++ b/Samples/Node/CognitiveServices-Language/Fridge/README.md @@ -1,4 +1,9 @@ -# Fridge Sample +# Fridge + +[![Deploy to Azure][Deploy Button]][Deploy Node/CognitiveServices-Language/Fridge] + +[Deploy Button]: https://azuredeploy.net/deploybutton.png +[Deploy Node/CognitiveServices-Language/Fridge]: https://azuredeploy.net ## Description Fridge is a bot that helps you to manage refrigerator inventory. You can add or delete an item or see or clear the inventory of your fridge. The bot uses LUIS (Language Understanding Intelligent Service) Cognitive Service to recognize your intents so that you can talk to the bot as if you are talking to a person. This sample bot will serve as a good example of incorporating natural language processing service to Skype bots. diff --git a/Samples/Node/CognitiveServices-Language/Fridge/azuredeploy.json b/Samples/Node/CognitiveServices-Language/Fridge/azuredeploy.json new file mode 100644 index 0000000..154a878 --- /dev/null +++ b/Samples/Node/CognitiveServices-Language/Fridge/azuredeploy.json @@ -0,0 +1,136 @@ +{ + "$schema": "http://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/Node/CognitiveServices-Language/Fridge" + }, + "WebsiteNodeDefaultVersion": { + "type": "string", + "defaultValue": "6.9.1" + }, + "MicrosoftAppId": { + "type": "string" + }, + "MicrosoftAppPassword": { + "type": "string" + }, + "MicrosoftLuisEndpoint": { + "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": "WEBSITE_NODE_DEFAULT_VERSION", + "value": "[parameters('WebsiteNodeDefaultVersion')]" + }, + { + "name": "Project", + "value": "[parameters('Project')]" + }, + { + "name": "MICROSOFT_APP_ID", + "value": "[parameters('MicrosoftAppId')]" + }, + { + "name": "MICROSOFT_APP_PASSWORD", + "value": "[parameters('MicrosoftAppPassword')]" + }, + { + "name": "MICROSOFT_LUIS_ENDPOINT", + "value": "[parameters('MicrosoftLuisEndpoint')]" + } + ] + } + }, + { + "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 + } + } + ] + } + ] + } diff --git a/Samples/Node/Fundamentals/DoctorCode/README.md b/Samples/Node/Fundamentals/DoctorCode/README.md index c9c4b0a..92e524f 100644 --- a/Samples/Node/Fundamentals/DoctorCode/README.md +++ b/Samples/Node/Fundamentals/DoctorCode/README.md @@ -1,5 +1,10 @@ # Doctor Code +[![Deploy to Azure][Deploy Button]][Deploy Node/Fundamentals/DoctorCode] + +[Deploy Button]: https://azuredeploy.net/deploybutton.png +[Deploy Node/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 user when your bot meets the user for the first time. diff --git a/Samples/Node/Fundamentals/DoctorCode/azuredeploy.json b/Samples/Node/Fundamentals/DoctorCode/azuredeploy.json new file mode 100644 index 0000000..de962ab --- /dev/null +++ b/Samples/Node/Fundamentals/DoctorCode/azuredeploy.json @@ -0,0 +1,129 @@ +{ + "$schema": "http://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/Node/Fundamentals/DoctorCode" + }, + "WebsiteNodeDefaultVersion": { + "type": "string", + "defaultValue": "6.9.1" + }, + "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": "WEBSITE_NODE_DEFAULT_VERSION", + "value": "[parameters('WebsiteNodeDefaultVersion')]" + }, + { + "name": "Project", + "value": "[parameters('Project')]" + }, + { + "name": "MICROSOFT_APP_ID", + "value": "[parameters('MicrosoftAppId')]" + }, + { + "name": "MICROSOFT_APP_PASSWORD", + "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 + } + } + ] + } + ] + }