Submit Search
ゆるふわAzure Functions
0 likes
224 views
Keiji Kamebuchi
20160723 jazug東北in仙台
Software
Read more
1 of 63
Download now
Download to read offline
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
More Related Content
What's hot
(20)
PDF
[JANOG35.5] WhiteBox SW検証 ~サーバサイド編~
gree_tech
PPTX
WebAssemblyとBlazor 、WebAssembly System Interfaceでコンテナライズの設計を解説
Takao Tetsuro
PPTX
できる!サーバレスアーキテクチャ
azuma satoshi
PDF
Apache Mesosってなに
Shingo Kitayama
PPTX
KubernetesでGPUクラスタを管理したい
Yuji Oshima
PDF
Azure Functions 入門
jz5 MATSUE
PPTX
[SAPPORO CEDEC] サービスの効果を高めるグリー内製ツールの技術と紹介
gree_tech
PDF
Azure DevOps Online Vol.3 - Inside Azure Pipelines
Kazushi Kamegawa
PDF
Infrastrucure as a CodeにおけるJenkinsの役割
Takashi Honda
PDF
Spring native について
Takamasa Mitsuji
PDF
今日からはじめるディープラーニング
Shingo Kitayama
PPTX
20170624 interact2017 open shift on azure
Takayoshi Tanaka
PPTX
Google Compute Engine 入門
Yuko Oshima
PPTX
1st step LogicFlow
Tomoyuki Obi
PDF
Azure DevOps と開発管理
Tsukasa Kato
PDF
cf-containers-broker を使ってローカル環境もサービスの恩恵をうける
Takeshi Morikawa
PDF
コンテナ時代にインフラエンジニアは何をするのか
gree_tech
PPTX
start Heroku
Hazuki Wakabayashi
PDF
KubernetesでPHPを動かした話
gree_tech
PDF
ProjectAtomic-and-geard
Naoto TAKAHASHI
[JANOG35.5] WhiteBox SW検証 ~サーバサイド編~
gree_tech
WebAssemblyとBlazor 、WebAssembly System Interfaceでコンテナライズの設計を解説
Takao Tetsuro
できる!サーバレスアーキテクチャ
azuma satoshi
Apache Mesosってなに
Shingo Kitayama
KubernetesでGPUクラスタを管理したい
Yuji Oshima
Azure Functions 入門
jz5 MATSUE
[SAPPORO CEDEC] サービスの効果を高めるグリー内製ツールの技術と紹介
gree_tech
Azure DevOps Online Vol.3 - Inside Azure Pipelines
Kazushi Kamegawa
Infrastrucure as a CodeにおけるJenkinsの役割
Takashi Honda
Spring native について
Takamasa Mitsuji
今日からはじめるディープラーニング
Shingo Kitayama
20170624 interact2017 open shift on azure
Takayoshi Tanaka
Google Compute Engine 入門
Yuko Oshima
1st step LogicFlow
Tomoyuki Obi
Azure DevOps と開発管理
Tsukasa Kato
cf-containers-broker を使ってローカル環境もサービスの恩恵をうける
Takeshi Morikawa
コンテナ時代にインフラエンジニアは何をするのか
gree_tech
start Heroku
Hazuki Wakabayashi
KubernetesでPHPを動かした話
gree_tech
ProjectAtomic-and-geard
Naoto TAKAHASHI
Viewers also liked
(11)
PDF
Azure How to Learn &ゆるふわ雑談Q&A
Keiji Kamebuchi
PDF
Azure App Service Overview LT
Keiji Kamebuchi
PDF
スクリプトによるAzure管理Tips / JAZUG 2014.09.26
Keiji Kamebuchi
PDF
クラウドことはじめ
Keiji Kamebuchi
PDF
AzureでLaravel動かしてみた
Keiji Kamebuchi
PDF
Azure概要とハイブリッドWebサイトとか / 2014.09.27
Keiji Kamebuchi
PDF
ちょっと分かった気になるAzure概要
Keiji Kamebuchi
PDF
VYATTA USERS MEETING Spring 2014 - JAZUG
Keiji Kamebuchi
PDF
Infrastructure as code for azure
Keiji Kamebuchi
PDF
C#ユーザー会 //build/ まとめ(サーバー編)
Keiji Kamebuchi
PDF
Azure Functions と Serverless - 概要と企業向け Tips
Keiji Kamebuchi
Azure How to Learn &ゆるふわ雑談Q&A
Keiji Kamebuchi
Azure App Service Overview LT
Keiji Kamebuchi
スクリプトによるAzure管理Tips / JAZUG 2014.09.26
Keiji Kamebuchi
クラウドことはじめ
Keiji Kamebuchi
AzureでLaravel動かしてみた
Keiji Kamebuchi
Azure概要とハイブリッドWebサイトとか / 2014.09.27
Keiji Kamebuchi
ちょっと分かった気になるAzure概要
Keiji Kamebuchi
VYATTA USERS MEETING Spring 2014 - JAZUG
Keiji Kamebuchi
Infrastructure as code for azure
Keiji Kamebuchi
C#ユーザー会 //build/ まとめ(サーバー編)
Keiji Kamebuchi
Azure Functions と Serverless - 概要と企業向け Tips
Keiji Kamebuchi
Ad
Similar to ゆるふわAzure Functions
(20)
PPTX
Azure serverless!! azure functionsでサーバーを意識しない開発
Yuki Hattori
PPTX
Azure Function GAした!Visual Studio Tools for Azure Functions もプレビューだ!
Yasuaki Matsuda
PPTX
Azure Functions あれこれ
Yasuaki Matsuda
PDF
[Japan Tech summit 2017] APP 003
Microsoft Tech Summit 2017
PDF
Azure Functionsでサーバーレスアプリケーション構築
ryosuke matsumura
PDF
[AC11] サーバー管理よ、サヨウナラ。サーバーレスアーキテクチャの意義と実践
de:code 2017
PDF
Azure Functionsでサーバーレスアプリケーション構築
ryosuke matsumura
PPTX
サーバー管理よ、サヨウナラ。サーバーレス アーキテクチャの意義と実践
真吾 吉田
PPTX
Visual Studio 2017 で Azure Functions の開発
Yasuaki Matsuda
PDF
20190514 Smart Store - Azure servlerless architecture
Issei Hiraoka
PDF
Smart Store サーバーレスアーキテクチャ編
Microsoft Azure Japan
PDF
サーバーレスで作るスマホアプリバックエンド
Tsukasa Kato
PPTX
「Azure durable functions」の概要
裕之 木下
PDF
[HAKODATE Developer Conference 2018] 「Azure Functions」で始めるサーバーレス アプリケーション開発
Naoki (Neo) SATO
PDF
20190731 Azure Functions x Line at Azure Tech Lab #4
Issei Hiraoka
PPTX
PythonによるAzureサーバレスアプリケーション開発 / Serverless Application Development with Python
Yoichi Kawasaki
PDF
Azure Functions Tips
Yuta Matsumura
PDF
Azure Functionsから始めるServerless
ryosuke matsumura
PPTX
azure functionsとcsx
裕之 木下
PDF
【de:code 2020】 「あつまれ フロントエンドエンジニア」 Azure Static Web Apps がやってきた
日本マイクロソフト株式会社
Azure serverless!! azure functionsでサーバーを意識しない開発
Yuki Hattori
Azure Function GAした!Visual Studio Tools for Azure Functions もプレビューだ!
Yasuaki Matsuda
Azure Functions あれこれ
Yasuaki Matsuda
[Japan Tech summit 2017] APP 003
Microsoft Tech Summit 2017
Azure Functionsでサーバーレスアプリケーション構築
ryosuke matsumura
[AC11] サーバー管理よ、サヨウナラ。サーバーレスアーキテクチャの意義と実践
de:code 2017
Azure Functionsでサーバーレスアプリケーション構築
ryosuke matsumura
サーバー管理よ、サヨウナラ。サーバーレス アーキテクチャの意義と実践
真吾 吉田
Visual Studio 2017 で Azure Functions の開発
Yasuaki Matsuda
20190514 Smart Store - Azure servlerless architecture
Issei Hiraoka
Smart Store サーバーレスアーキテクチャ編
Microsoft Azure Japan
サーバーレスで作るスマホアプリバックエンド
Tsukasa Kato
「Azure durable functions」の概要
裕之 木下
[HAKODATE Developer Conference 2018] 「Azure Functions」で始めるサーバーレス アプリケーション開発
Naoki (Neo) SATO
20190731 Azure Functions x Line at Azure Tech Lab #4
Issei Hiraoka
PythonによるAzureサーバレスアプリケーション開発 / Serverless Application Development with Python
Yoichi Kawasaki
Azure Functions Tips
Yuta Matsumura
Azure Functionsから始めるServerless
ryosuke matsumura
azure functionsとcsx
裕之 木下
【de:code 2020】 「あつまれ フロントエンドエンジニア」 Azure Static Web Apps がやってきた
日本マイクロソフト株式会社
Ad
ゆるふわAzure Functions
1.
ゆるふわ Azure Functions Japan Azure
User Group 東北 勉強会 in 仙台 ~おもしろいぜ Azure~ 2016.07.23 JAZUG @kosmosebi
2.
Self Introduction { "name" :
"Keiji Kamebuchi", "corporation" : "pnop Inc.", "mail" : "
[email protected]
", "web" : ["http://buchizo.wordpress.com/", "http://azure.moe/"], "twitter" : "@kosmosebi", "award" : ["Microsoft MVP for Azure", "Microsoft Regional Director"], "timezone" : "-08:00 (PST)" } Copyright© 2016, JAZUG All Rights Reserved. 2 buchizo Senior Fellow @kosmosebi
3.
Agenda Overview Under the hood Conclusion Copyright©
2016, JAZUG All Rights Reserved. 3
4.
お約束 このセッションは 2016年7月23日 時点の 情報を基にしています Azure
Functions は本日時点で Public Preview です Copyright© 2016, JAZUG All Rights Reserved. 4
5.
Overview Copyright© 2016, JAZUG
All Rights Reserved. 5
6.
Azure Functions? Copyright© 2016,
JAZUG All Rights Reserved. 6
7.
Azure Functions とは イベント駆動の”機能”実行プラットフォーム 柔軟で強力なスクリプト実行環境 様々なイベントやサービスに対応 トリガー:スケジュール、HTTP
(Webhook)、キュー、 ファイル作成時など バインディング:ファイル作成やPush通知を容易に オープンソース Copyright© 2016, JAZUG All Rights Reserved. 7
8.
Serverless? OSレイヤー以下を抽象化しサーバーを意識させない 自動的にスケールし、任意の処理が実行できる パッチやメンテナンスを意識しなくてよい インフラストラクチャの抽象化 Azure Functions は
“Serverless”実行モデル Serverless compute platform とも言えます PaaS として提供されている他のサービスや概念を拡張 Copyright© 2016, JAZUG All Rights Reserved. 8
9.
これまでは 目的の処理まで遠い ポータル インスタンス 各種操作 etc. Copyright© 2016, JAZUG
All Rights Reserved. 9
10.
これからは Functions のみ 最低限Functions の ポータルのみ 作成、管理操作 コーディング、実行、 モニタリング Copyright©
2016, JAZUG All Rights Reserved. 10
11.
Start! Copyright© 2016, JAZUG
All Rights Reserved. 11 https://functions.azure.com/signin
12.
メイン画面 Copyright© 2016, JAZUG
All Rights Reserved. 12
13.
アーキテクチャ Copyright© 2016, JAZUG
All Rights Reserved. 13 Triggers Input Bindings Output Bindings
14.
バインディング 他のサービスとの接続を容易にする機能 Blob や OneDrive
上のファイル、Push通知などを Function App 内で操作できる仕組み アプリケーション内でサービスへの接続や参照を 省略可能に Copyright© 2016, JAZUG All Rights Reserved. 14
15.
トリガー Function App が起動する条件 手動起動、スケジュール、キュー、Blob上の ファイル生成時など バインディングの1つとして定義(input) Copyright©
2016, JAZUG All Rights Reserved. 15
16.
バインディング設定画面 Copyright© 2016, JAZUG
All Rights Reserved. 16
17.
サポートしているバインディング 1 /
2 Copyright© 2016, JAZUG All Rights Reserved. 17 種別 サービス トリガー インプット アウトプット スケジュール (Timer) Azure Functions ✅ - - HTTP (REST / WebHook) Azure Functions ✅ - ✅* Blobストレージ Azure Storage ✅ ✅ ✅ キュー Azure Storage ✅ - ✅ テーブル Azure Storage - ✅ ✅ テーブル Azure Mobile Apps Easy Tables - ✅ ✅ NoSQL Database Azure DocumentDB - ✅ ✅ ストリーム Azure Event Hubs ✅ - ✅ Push通知 Azure Notification Hubs - - ✅ *
18.
サポートしているバインディング 2 /
2 Copyright© 2016, JAZUG All Rights Reserved. 18 種別 サービス トリガー インプット アウトプット キュー / トピック Azure Service Bus Queue / Topic - - ✅ SaaS ファイル Box ✅ ✅ ✅ SaaS ファイル Dropbox ✅ ✅ ✅ SaaS ファイル OneDrive ✅ ✅ ✅ SaaS ファイル OneDrive for Business ✅ ✅ ✅ SaaS ファイル FTP - ✅ ✅ SaaS ファイル SFTP - ✅ ✅ SaaS ファイル Google Drive - ✅ ✅ SendGrid SendGrid - - ✅* *
19.
Function App Azure Functions
の中核となるコード部分 実際に起動され処理されるコード(スクリプト) 多数の言語で記述可能 Copyright© 2016, JAZUG All Rights Reserved. 19
20.
言語サポート メインサポート node.js / JavaScript C#
(.NET Compiler Platform Scripting API ) 実験的なサポート F# / Python / PHP / Batch (.bat) / Bash (.sh) / PowerShell (.ps1) Copyright© 2016, JAZUG All Rights Reserved. 20
21.
開発画面 Copyright© 2016, JAZUG
All Rights Reserved. 21
22.
設定 基本的な設定 メモリ領域* 継続的インテグレーション AuthN / AuthZ CORS API定義 より詳細な設定 内部のWeb
Apps側で可能 アプリケーション設定値など Copyright© 2016, JAZUG All Rights Reserved. 22 *
23.
料金 プランを2種類から選択 App Service Plan Dynamic
Service Plan Copyright© 2016, JAZUG All Rights Reserved. 23
24.
料金 - App
Service Plan (Classic Plan*) App Service Web Apps と同じ料金体系 スペック・機能は Web Apps と同様 オートスケールやVNET接続など多数の機能を 利用可能 インスタンスのきめ細かな管理や増減、占有が可能 Web アプリケーションとの共存シナリオなど Copyright© 2016, JAZUG All Rights Reserved. 24 *
25.
料金 - Dynamic
Service Plan Azure Functions 専用の新しいプラン 実行された時間とメモリ領域サイズに応じて課金 設定メモリ領域サイズ(GB単位)* 実行時間(100ミリ秒単位)を基 に計算 メモリ領域サイズは 128 MB – 1536 MB の間で設定可能 (64 MB 間 隔) 40万 GB*sec までは無料 (= 128 MB 設定で約37日間無料) 例: 128 MB 設定で 30 秒実行 = 128 / 1024 GB * 30 sec = 3.75 GB*sec トリガー呼び出し(リクエスト)数に応じて課金 最初の100万リクエストは無料、以降100万リクエスト毎に請求 Copyright© 2016, JAZUG All Rights Reserved. 25 * https://azure.microsoft.com/ja-jp/pricing/details/functions/ *
26.
制限事項 現時点で以下の制限が存在します Public Preview に伴う制限事項 SLA
はありません 有償テクニカルサポートはありません (MSDN フォーラム または Stack Overflow は利用可) 現状利用可能なリージョンは以下のみ 米国西部 西ヨーロッパ 東南アジア Copyright© 2016, JAZUG All Rights Reserved. 26
27.
こまったら… 公式ドキュメント https://azure.microsoft.com/ja-jp/documentation/services/functions/ https://github.com/Azure/AzureFunctions 質問や問題報告、フィードバックなど Stack Overflow • http://stackoverflow.com/questions/tagged/azure-functions MSDN
Forum • https://social.msdn.microsoft.com/Forums/azure/en-US/home?forum=azurefunctions Twitter: @AzureFunctions Copyright© 2016, JAZUG All Rights Reserved. 27
28.
Under the hood Copyright©
2016, JAZUG All Rights Reserved. 28
29.
スケール スケール粒度は Function App
単位 0~10 (現状)でインスタンスが自動的に増減* 構成されているトリガーに基づきトラフィック等から判断 インスタンス内のFunction App 同時実行可能数はメモリ設定に よって異なる * Dynamic Service Plan 時のみ Copyright© 2016, JAZUG All Rights Reserved. 29
30.
システム構成 Copyright© 2016, JAZUG
All Rights Reserved. 30 リソースグループ 共有フォルダをマウント ログの読み書き
31.
ランタイム詳細 ランタイムの実体は WebJobs.Script.Host https://github.com/Azure/azure-webjobs-sdk-script 現在は4種類 FUNCTIONS_EXTENSION_VERSION で指定可能 新しいバージョンが利用可能になった場合、ポータル上で アップデート可 Copyright©
2016, JAZUG All Rights Reserved. 31
32.
ランタイムのバージョン 参考 Copyright© 2016, JAZUG
All Rights Reserved. 32 * D:¥Program Files (x86)¥SiteExtensions¥Functions¥ ** 設定値 インストールフォルダ* GitHub上のバージョン** ~0.1 0.1.10191 v1.0.0-alpha1-10191 ~0.2 0.2.10198 v1.0.0-alpha1-10198 ~0.3 0.3.10261 Functions 0.3.10261 (v1.0.0-alpha1-10261) ~0.4 0.4.10307 Functions 0.4.10307 (1.0.0-beta1-10307)
33.
フォルダー構造 Copyright© 2016, JAZUG
All Rights Reserved. 33 D:¥Home ├─data │ ├─Functions │ │ ├─sampledata │ ├─secrets ├─LogFiles │ ├─Application │ │ └─Functions │ │ ├─Function │ │ └─Host │ ├─SiteExtensions │ └─Functions ├─site │ └─wwwroot │ ├─BlobTriggerCSharp1 │ │ ├─function.json │ │ └─run.csx │ ├─host.json data¥secrets フォルダー site¥wwwroot フォルダー Function App 名フォルダー
34.
フォルダー構造 Copyright© 2016, JAZUG
All Rights Reserved. 34 project.json bin node_modules C# NuGet パッケージの参照設定などは project.json に記述 カスタムアセンブリは bin フォルダーへ node.js npm パッケージは node_modules フォルダーへ その他 バインディングされたオブジェクトは Temp フォルダに
35.
デバッグ Visual Studio を使用したリモートデバッグ App
Service Plan のみ可 ローカル実行環境でのデバッグ https://github.com/Azure/azure-webjobs-sdk-script を使用 AzureWebJobsEnv 環境変数に Development と設定する AzureWebJobsStorage , AzureWebJobsDashboard , AzureWebJobsScriptRoot 環境変数も同様に設定 参考: https://azure.microsoft.com/en-us/documentation/articles/functions-run-local/ Copyright© 2016, JAZUG All Rights Reserved. 35
36.
Function App 設定 Azure
Functions 内部の Web Apps で設定 Function App 内ではシステム環境変数から取得可能 1つの Azure Function コンテナーに含まれるすべての Function App で共通 Copyright© 2016, JAZUG All Rights Reserved. 36
37.
Function App 設定 Blob
や Event Hubs などの接続文字列 Web Apps のアプリケーション設定にて 保存 * 一部の接続文字列はパスを含めないように Copyright© 2016, JAZUG All Rights Reserved. 37
38.
アプリケーション設定の取得例 C# System.Environment.GetEnvironmentVariable("JAZUG") * ConfigurationManager 経由でも可 node.js process.env.JAZUG PwerShell $Env:JAZUG Copyright©
2016, JAZUG All Rights Reserved. 38
39.
バインディング Blob Triggerは現状ポーリング Blob 側でイベントが実装されていない為 10,000
以上の Blob が存在する場合、パフォーマンスや”漏れ”に注意 バインディング時に利用できるパラメーター 例 Blob: name {blobname}.{blobextension} Queue: expirationTime insertionTime nextVisibleTime queueTrigger (メッセージの本文) id popReceipt dequeueCount Copyright© 2016, JAZUG All Rights Reserved. 39
40.
バインディング 特殊なパラメーター %rand-guid% … GUID •
* Guid.NewGuid().ToString() %rand-int% … ランダム数値 • * (new Random()) • .Next(10000, int.MaxValue) .ToString(CultureInfo.InvariantCulture) ※~0.4以降は {rand-guid} Copyright© 2016, JAZUG All Rights Reserved. 40 name blobname blobextension %rand-guid%
41.
実行するコードスクリプトの決定ルールなど WebJobs と似たルールを使用 同一言語のスクリプトが複数存在する場合 run.{拡張子}
が起動される 複数言語の混在はエラー C# の場合 .NET Compiler Platform Scripting API でコンパイルされる (.cs / .csx が対象) public static な Run メソッドが必須(エントリポイント)** project.json ファイル* を使用して NuGet パッケージの指定など可 * .NET Core CLI 関連のドキュメントを参照 ** ~0.4以降はメタデータのentryPointプロパティで複数指定可能に Copyright© 2016, JAZUG All Rights Reserved. 41
42.
開発Tips / C# Run
メソッドの引数はバインディングで指定した名前で実装 一部outputのバインディングには out パラメーター修飾子を利用 CancellationToken token を使用してグレースフル シャットダウンに 応答可 外部アセンブリの読み込みは #r ディレクティブを使用 project.json で指定した場合は不要( using ステートメントで読み込み) カスタムアセンブリは Function App フォルダ直下の bin フォルダーに保存 外部スクリプト(.csx)の読み込みは #load ディレクティブを使用 相対パスで指定 参考: https://azure.microsoft.com/ja-jp/documentation/articles/functions-reference-csharp/ Copyright© 2016, JAZUG All Rights Reserved. 42
43.
開発Tips / JavaScript/node.js module.exports
で function(context){} を1つエクスポート(必須) inputなバインディングは引数指定可(context でアクセスは可能) 現状、node.js のバージョンは 5.9.1 固定 パッケージは Function App フォルダ内に npm install 等を使用して node_modules フォルダーに保存 利用時は通常通り require(‘パッケージ’) TypeScript/CoffeeScript サポート ラインタイム側での自動コンパイルなどは未サポート(現状) 参考: https://azure.microsoft.com/ja-jp/documentation/articles/functions-reference-node/ Copyright© 2016, JAZUG All Rights Reserved. 43
44.
開発Tips / その他 バインディングされたオブジェクトはテンポラリの フォルダ上で扱う D:¥local¥Temp¥Functions¥Binding¥<ジョブID>¥<バインディング名> C#
や node.js 以外の言語では上記パスが環境変数で 提供されるので適宜読み出し・書き込みを行う Copyright© 2016, JAZUG All Rights Reserved. 44
45.
バインディングされたオブジェクトの取得例 C# #r "Microsoft.WindowsAzure.Storage" using System; using
Microsoft.WindowsAzure.Storage.Blob; public static void Run(CloudBlockBlob inputBlob, CloudBlockBlob outputBlob, TraceWriter log) { log.Info(inputBlob.StorageUri.PrimaryUri.ToString()); outputBlob.StartCopyFromBlob(inputBlob); } Copyright© 2016, JAZUG All Rights Reserved. 45
46.
バインディングされたオブジェクトの取得例 PowerShell $requestBody = Get-Content
$Env:req -Raw | ConvertFrom-Json $name = $requestBody.name Out-File -Encoding Ascii $Env:res -inputObject "Hello $name" D:¥local¥Temp¥Functions¥Binding¥<ジョブID>¥req D:¥local¥Temp¥Functions¥Binding¥<ジョブID>¥res Copyright© 2016, JAZUG All Rights Reserved. 46
47.
CORS ブラウザから呼び出す場合に設定 一般的な CORS と同様 既定値について AzureFunctions
UX のブランチと対応 functions.azure.com … 本番環境 functions-staging.azure.com … master functions-next.azure.com … dev * https://github.com/projectkudu/AzureFunctionsPortal Copyright© 2016, JAZUG All Rights Reserved. 47
48.
認証 HTTPトリガー時に設定 1. Web Apps
の AuthN/AuthZ を使用 2. API Keyを使用 code クエリパラメーターでキーを渡す または x-functions-key HTTPリクエストヘッダでキーを渡す モード: Standard • 認証レベル: Admin / Function / Anonymouse * モード: Webhook • Webhook の種類: GitHub / Generic JSON * Anonymous を除き他の設定時はAPI Key必須 Copyright© 2016, JAZUG All Rights Reserved. 48
49.
API Key の管理 secrets
フォルダーで管理* <Function App名>.json {"key":"<Function App専用のキー>"} host.json { "masterKey": "<Adminレベル用のキー>", "functionKey": "<全Function App共通キー>" } Copyright© 2016, JAZUG All Rights Reserved. 49
50.
モニタリング / ログ 消費ユニット
/ インスタンス数 Monitoring タブから参照可能 Copyright© 2016, JAZUG All Rights Reserved. 50 * Dynamic Service Plan 時のみ
51.
モニタリング / ログ 請求関連 https://account.windowsazure.com
等で確認 コンピューティング期間 (GB秒) - Functions コンピューティング要求 - Functions Copyright© 2016, JAZUG All Rights Reserved. 51
52.
モニタリング / ログ Function
App 単位のログ 統合されたモニター機能は Coming Soon 現状、WebJobs ダッシュボード 上にて参照可能 Copyright© 2016, JAZUG All Rights Reserved. 52
53.
モニタリング / ログ https://<Functions名>.scm.azurewebsites.net/azurejobs/#/functions Copyright©
2016, JAZUG All Rights Reserved. 53
54.
モニタリング / ログ ログの実態 Azure
Table 上の AzureFunctionsLogTable コンテナー バインドされている値の詳細や 出力されたログの確認など ホストに関するログなど Azure Blob 上の azure-webjobs-hosts コンテナー Copyright© 2016, JAZUG All Rights Reserved. 54 * Dynamic Service Plan 時のみ
55.
モニタリング / ログ 実行数や実行時間などのライブストリーム Copyright©
2016, JAZUG All Rights Reserved. 55
56.
デプロイ - アプリケーション SCM
を使用して継続的インテグレーション GitHub や Bitbucket など Web Apps と同様に設定可能 その他 FTP経由や WebDeploy を使用したデプロイも可 Azure File Storage を SMB で直接マウントできる環境の場合、 直接ファイルをコピーすることも可 Copyright© 2016, JAZUG All Rights Reserved. 56
57.
デプロイ - インフラ Azure
Resource Manager を使用したデプロイ Quick start templateも利用可能 https://github.com/Azure/azure-quickstart- templates/tree/master/101-function-app-create-dynamic Copyright© 2016, JAZUG All Rights Reserved. 57
58.
その他注意事項 カスタムドメイン名 Web Apps 側で設定しても
HTTPトリガーな Function は 認識しない * 404 Not found となる スロット スロットは利用不可 Copyright© 2016, JAZUG All Rights Reserved. 58
59.
Openness Azure Functions に関するソースは
GitHub 上で公開 MITライセンスで提供 WebJobs.Script https://github.com/Azure/azure-webjobs-sdk-script Azure Functions UX https://github.com/projectkudu/AzureFunctionsPortal Azure Functions Templates https://github.com/Azure/azure-webjobs-sdk-templates * WebJobs-SDK および WebJobs-SDK-Extension も参照 Copyright© 2016, JAZUG All Rights Reserved. 59
60.
Openness マルチ言語対応 C#, node.js, F#,
PHP, Python, Batch, Bash, PowerShell ホストのマルチプラットフォーム ランタイムそのものはオンプレでも、Azureではない プラットフォームでも実行可能 * 但し現状、手厚いサポートは無い Copyright© 2016, JAZUG All Rights Reserved. 60
61.
Conclusion Copyright© 2016, JAZUG
All Rights Reserved. 61
62.
まとめ Azure Functions は機能(Function)に注力できる プラットフォーム 必要な時に必要な機能を実装・実行しましょう C#,
node.js など今あるスキルを活かしながら 新しいプラットフォームについて最小限の知識で Function に注力することができます Try Azure Functions! http://functions.azure.com/ Copyright© 2016, JAZUG All Rights Reserved. 62
63.
Appendix Try Azure Functions
http://functions.azure.com/ Try Azure App Service http://tryappservice.azure.com/ Documents https://azure.microsoft.com/ja-jp/documentation/services/functions/ Stack Overflow http://stackoverflow.com/questions/tagged/azure-functions MSDN Forum https://social.msdn.microsoft.com/Forums/azure/en-US/home?forum=azurefunctions Fork Azure Functions https://github.com/azure/azure-webjobs-sdk-script Copyright© 2016, JAZUG All Rights Reserved. 63
Download