line/line-bot-sample-ms

Name: line-bot-sample-ms

Owner: LINE

Description: null

Created: 2017-04-13 09:48:24.0

Updated: 2017-11-11 23:51:36.0

Pushed: 2017-04-13 10:18:16.0

Homepage: null

Size: 29

Language: C#

GitHub Committers

UserMost Recent Commit# Commits

Other Committers

UserEmailMost Recent Commit# Commits

README

Introduction

The ASP.NET Core Linebot for Hackathon application.

Getting Started

Open solution or project

Open solution(sln) file in the Visual Studio 2017 or project(csproj) file in the Visual Studio Code. You can also open in the command prompt or terminal.

Configuration

Configure properties of the LINE Messaging API by one of environment variables, appsettings.json and user secrets. Database server is required to run. MySQL for Development environment. Microsoft SQL Server for Azule enviromnent. This will be setup by Startup.cs so you can switch to another database server.

Environment variables

Set environment variables as shown in the following example.

On Windows.

ectionStrings:MainDatabase=[Your database connection string]
:ChannelId=[Your channel id]
:ChannelSecret=[Your channel secret]
:ChannelAccessToken=[Your channel access token]
:WebhookPath=[Your webhook path]
osoft:CognitiveService:Face:SubscriptionKey=[Your subscription key of the Microsoft Congnitive Service Face]

On Mac OS X / Linux.

port ConnectionStrings__MainDatabase=[Your database connection string]
port Line__ChannelId=[Your channel id]
port Line__ChannelSecret=[Your channel secret]
port Line__ChannelAccessToken=[Your channel access token]
port Line__WebhookPath=[Your webhook path]
port Microsoft__CognitiveService__Face__SubscriptionKey=[Your subscription key of the Microsoft Congnitive Service Face]

(Note: Double underscore)

appsettings.json

Edit the appsettings.json file as shown in the following example.

Caution: Please be careful not to commit or publish your confidential information to the Internet. It is strongly recommended that you store your confidential information as environment variables.


ogging": {
"IncludeScopes": false,
"LogLevel": {
  "Default": "Warning"
}

onnectionStrings": {
"MainDatabase": "[Your database connection string]"

ine": {
"ChannelId": "[Your channel id]",
"ChannelSecret": "[Your channel secret]",
"ChannelAccessToken": "[Your channel access token]",
"WebhookPath":  "[Your webhook path]"

icrosoft": {
"CognitiveService": {
  "Face": {
    "SubscriptionKey": "[Your subscription key of the Microsoft Congnitive Service Face]"
  }
}


User secrets

It can also be stored as user secrets in the development environment.

Restore, Build and Run

Restore packages, build and start debugging in the Visual Studio 2017 or Visual Studio Code. You can also use the following dotnet command in the project directory.

tnet restore
tnet build
tnet run
Deploy

Finally, you can deploy this application to the App Service of Microsoft Azule.

Disclaimer

This application was developed for demonstration purpose of Hackathon. Use of this application is at your own risk.


This work is supported by the National Institutes of Health's National Center for Advancing Translational Sciences, Grant Number U24TR002306. This work is solely the responsibility of the creators and does not necessarily represent the official views of the National Institutes of Health.