久森 達郎(日本マイクロソフト株式会社)
吉田 真吾(株式会社セクションナイン)
http://readwrite.com/2012/10/15/why-the-future-of-software-and-apps-is-serverless/
クラウドの利用形態
ストレージ
サーバー
ネットワーク
OS
ミドルウエア
仮想化
データ
アプリケーション
ランタイム
OS
ミドルウエア
データ
アプリケーション
ランタイムユ
ー
ザ
ー
管
理
アプリケーション
データ
ベ
ン
ダ
ー
管
理
Azure 仮想マシンWindows Server
Linux
Azure App Service Office 365
ベ
ン
ダ
ー
管
理
ユ
ー
ザ
ー
管
理
ユ
ー
ザ
ー
管
理
ベ
ン
ダ
ー
管
理
PaaS の悩み
アプリケーション
データ
Azure
App Service
ベ
ン
ダ
ー
管
理
ユ
ー
ザ
ー
管
理
Monolithic
Frontend
Middle tier
Backend
Microservice
1
Microservice
2
Microservice
3
Microservice
4
Microservice
5
Function 1
Function 2
Function 3
Function 4
Function 5
Function 6
Function 7
Function 8
Function 9
Function 10
Function 11
Function 12
Azure Functions
On-demand serverless code
Develop, debug, test, deploy in Visual Studio
CI/CD support in Visual Studio Team Services and Github
https://github.com/Azure/Azure-Functions
• Azure WebJobs SDK script - Azure Functions ランタイム
• Azure WebJobs SDK - Azure Functions ランタイム コアとバインディング
• Azure WebJobs SDK extensions - バインディング リポジトリ
• Azure Functions CLI - Azure Functions CLI コマンドライン ツール
• Azure Functions Portal - Functions 開発ポータル
• Azure Functions templates - 各種 Functions テンプレート
• Azure Functions samples - 各種サンプルコード リポジトリ
Azure Logic Apps
On-demand serverless workflows
100+ data and app connectors built-in
Integrated Visual Studio tooling
 ブラウザでワークフロー定義
 “メールが来たらチャット通知
する”
 “特定のツイートがあったら記
録して通知する”
 Excelファイルがアップロード
されたらCSV変換してテーブ
ルに挿入する
サーバーレス開発で考えるべき4点
Design Develop Deploy Monitor
Design
Design Develop Deploy Monitor
•
•
バインディング サービス トリガー インプット
アウトプッ
ト
スケジュール Azure Functions ✔
HTTP
(REST または Webhook)
Azure Functions
✔ ✔
Blob Storage Azure Storage (Azure Storage) ✔ ✔ ✔
イベント Azure Event Hubs ✔ ✔
キュー Azure Storage (Azure Storage) ✔ ✔
キューとトピック Azure Service Bus ✔ ✔
Storage テーブル Azure Storage (Azure Storage) ✔ ✔
SQL テーブル Azure Mobile Apps ✔ ✔
NoSQL DB Azure DocumentDB ✔ ✔
プッシュ通知 Azure Notification Hub ✔
Twilio SMS テキスト Twilio ✔
SendGrid 電子メール SendGrid ✔
/FB
/FA Function A
/FC
API proxy endpoints
HttpTrigger function endpoints
Key:
Design: APIを抽象化してまとめよう
Function App A
Function C/FC
Function App C
Function B/FB
Function App B
/funcproc
O365
App
Insights
/index.html
Azure Functions Proxies
/logicproc
Client
- Browser
- Program
Trigger
- HTTP
- etc
Function
- Node
- etc
Function App
環境変数
ファイル
- $req
- $res
リクエスト
Develop
Design Develop Deploy Monitor
JavaScript
 Use Visual Studio Code or any Node debugger
C#
 Visual Studio 2017 Tools for Azure Functions
https://aka.ms/vs2017functiontools
Deploy
Design Develop Deploy Monitor
Resource deployment
• Azure Resource Managerテンプレートでデプロイ
Content deployment
• Visual Studio からデプロイ
• Azure CLI (Logic App) からデプロイ
• CI/CD (VSTS) 経由でデプロイ
Safe deployment practices (New!)
• WebAppsでおなじみのデプロイスロット機能が実装されました
• AppService PlanならFunctionもBlue-Green Deploy可能に!
 デプロイ環境を複数作って、それぞれをスイッチさせることが可能
App Service Plan
sample1.azurewebsites.net
sample2.azurewebsites.net
sample3.azurewebsites.net
devスロット
sample2-dev.azurewebsites.net
testスロット
sample2-test.azurewebsites.net
prodスロット
sample2-prod.azurewebsites.net
stagingスロット
sample2-staging.azurewebsites.net
Monitor
Design Develop Deploy Monitor
 開発中や運用時、Function一つ一つの状況をみたいときに有効
 ライブメトリクスストリームが便利
https://www.infoq.com/jp/news/2017/05/Azure-Functions-Insight
イベントソース
バッチ系ビッグデータ処理
分析パイプライン
EVENT INGESTION
ENGINE
SQL DATA
WAREHOUSE
DATA LAKE STORAGE
& ANALYTICS
STREAM
ANALYTICS
WEB
CUSTOM
SERVICES
ウェアラブル
POS
デジタル
サイネージ
ボット
キオスク
端末
スマホアプリ
センサー
WORKFLOW
ORCHESTRATION
ENTERPRISE INTEGRATION
CUSTOM INTELLIGENCE
INTELLIGENT
SERVICES
CUSTOM
FUNCTIONS
MACHINE
LEARNING
COGNITIVE
SERVICES
Azure IoT Edge IoT Hub
Devices
Local Storage
Azure Machine
Learning
(Container)
Container
Management
Device
Twin
Device
Twin
Azure Stream
Analytics
(Container)
Azure Functions
(Container)
Cognitive Services
(Container)
Custom Code
(Container)
Module
Twin
Module
Twin
Module
Twin
Module
Twin
Module
Twin
Module
Twin
Module
Twin
Module
Twin
Module
Twin
Module
Twin
Functions
Runtime
© 2017 Microsoft Corporation. All rights reserved.
本情報の内容(添付文書、リンク先などを含む)は、作成日時点でのものであり、予告なく変更される場合があります。

[AC11] サーバー管理よ、サヨウナラ。サーバーレスアーキテクチャの意義と実践