Suche senden
Hochladen
ゆるふわAzure Functions
•
0 gefällt mir
•
222 views
Keiji Kamebuchi
Folgen
20160723 jazug東北in仙台
Weniger lesen
Mehr lesen
Software
Diashow-Anzeige
Melden
Teilen
Diashow-Anzeige
Melden
Teilen
1 von 63
Jetzt herunterladen
Downloaden Sie, um offline zu lesen
Empfohlen
Infrastructure as Codeの取り組みと改善
Infrastructure as Codeの取り組みと改善
Takashi Honda
Azure <3 Openness
Azure <3 Openness
Keiji Kamebuchi
Introduction of Azure Docker Integration
Introduction of Azure Docker Integration
Takekazu Omi
半日でわかる コンテナー技術 (入門編)
半日でわかる コンテナー技術 (入門編)
Toru Makabe
Terraform Bootcamp - Azure Infrastructure as Code隊
Terraform Bootcamp - Azure Infrastructure as Code隊
Toru Makabe
20151024 Azureデータストア概要
20151024 Azureデータストア概要
Keiji Kamebuchi
これからのOpenShiftの話をしよう
これからのOpenShiftの話をしよう
Kazuto Kusama
GCP vs 他社クラウド
GCP vs 他社クラウド
Hasegawa Yusuke
Empfohlen
Infrastructure as Codeの取り組みと改善
Infrastructure as Codeの取り組みと改善
Takashi Honda
Azure <3 Openness
Azure <3 Openness
Keiji Kamebuchi
Introduction of Azure Docker Integration
Introduction of Azure Docker Integration
Takekazu Omi
半日でわかる コンテナー技術 (入門編)
半日でわかる コンテナー技術 (入門編)
Toru Makabe
Terraform Bootcamp - Azure Infrastructure as Code隊
Terraform Bootcamp - Azure Infrastructure as Code隊
Toru Makabe
20151024 Azureデータストア概要
20151024 Azureデータストア概要
Keiji Kamebuchi
これからのOpenShiftの話をしよう
これからのOpenShiftの話をしよう
Kazuto Kusama
GCP vs 他社クラウド
GCP vs 他社クラウド
Hasegawa Yusuke
[JANOG35.5] WhiteBox SW検証 ~サーバサイド編~
[JANOG35.5] WhiteBox SW検証 ~サーバサイド編~
gree_tech
WebAssemblyとBlazor 、WebAssembly System Interfaceでコンテナライズの設計を解説
WebAssemblyとBlazor 、WebAssembly System Interfaceでコンテナライズの設計を解説
Takao Tetsuro
できる!サーバレスアーキテクチャ
できる!サーバレスアーキテクチャ
azuma satoshi
Apache Mesosってなに
Apache Mesosってなに
Shingo Kitayama
KubernetesでGPUクラスタを管理したい
KubernetesでGPUクラスタを管理したい
Yuji Oshima
Azure Functions 入門
Azure Functions 入門
jz5 MATSUE
[SAPPORO CEDEC] サービスの効果を高めるグリー内製ツールの技術と紹介
[SAPPORO CEDEC] サービスの効果を高めるグリー内製ツールの技術と紹介
gree_tech
Azure DevOps Online Vol.3 - Inside Azure Pipelines
Azure DevOps Online Vol.3 - Inside Azure Pipelines
Kazushi Kamegawa
Infrastrucure as a CodeにおけるJenkinsの役割
Infrastrucure as a CodeにおけるJenkinsの役割
Takashi Honda
Spring native について
Spring native について
Takamasa Mitsuji
今日からはじめるディープラーニング
今日からはじめるディープラーニング
Shingo Kitayama
20170624 interact2017 open shift on azure
20170624 interact2017 open shift on azure
Takayoshi Tanaka
Google Compute Engine 入門
Google Compute Engine 入門
Yuko Oshima
1st step LogicFlow
1st step LogicFlow
Tomoyuki Obi
Azure DevOps と開発管理
Azure DevOps と開発管理
Tsukasa Kato
cf-containers-broker を使ってローカル環境もサービスの恩恵をうける
cf-containers-broker を使ってローカル環境もサービスの恩恵をうける
Takeshi Morikawa
コンテナ時代にインフラエンジニアは何をするのか
コンテナ時代にインフラエンジニアは何をするのか
gree_tech
start Heroku
start Heroku
Hazuki Wakabayashi
KubernetesでPHPを動かした話
KubernetesでPHPを動かした話
gree_tech
ProjectAtomic-and-geard
ProjectAtomic-and-geard
Naoto TAKAHASHI
Azure How to Learn &ゆるふわ雑談Q&A
Azure How to Learn &ゆるふわ雑談Q&A
Keiji Kamebuchi
Azure App Service Overview LT
Azure App Service Overview LT
Keiji Kamebuchi
Weitere ähnliche Inhalte
Was ist angesagt?
[JANOG35.5] WhiteBox SW検証 ~サーバサイド編~
[JANOG35.5] WhiteBox SW検証 ~サーバサイド編~
gree_tech
WebAssemblyとBlazor 、WebAssembly System Interfaceでコンテナライズの設計を解説
WebAssemblyとBlazor 、WebAssembly System Interfaceでコンテナライズの設計を解説
Takao Tetsuro
できる!サーバレスアーキテクチャ
できる!サーバレスアーキテクチャ
azuma satoshi
Apache Mesosってなに
Apache Mesosってなに
Shingo Kitayama
KubernetesでGPUクラスタを管理したい
KubernetesでGPUクラスタを管理したい
Yuji Oshima
Azure Functions 入門
Azure Functions 入門
jz5 MATSUE
[SAPPORO CEDEC] サービスの効果を高めるグリー内製ツールの技術と紹介
[SAPPORO CEDEC] サービスの効果を高めるグリー内製ツールの技術と紹介
gree_tech
Azure DevOps Online Vol.3 - Inside Azure Pipelines
Azure DevOps Online Vol.3 - Inside Azure Pipelines
Kazushi Kamegawa
Infrastrucure as a CodeにおけるJenkinsの役割
Infrastrucure as a CodeにおけるJenkinsの役割
Takashi Honda
Spring native について
Spring native について
Takamasa Mitsuji
今日からはじめるディープラーニング
今日からはじめるディープラーニング
Shingo Kitayama
20170624 interact2017 open shift on azure
20170624 interact2017 open shift on azure
Takayoshi Tanaka
Google Compute Engine 入門
Google Compute Engine 入門
Yuko Oshima
1st step LogicFlow
1st step LogicFlow
Tomoyuki Obi
Azure DevOps と開発管理
Azure DevOps と開発管理
Tsukasa Kato
cf-containers-broker を使ってローカル環境もサービスの恩恵をうける
cf-containers-broker を使ってローカル環境もサービスの恩恵をうける
Takeshi Morikawa
コンテナ時代にインフラエンジニアは何をするのか
コンテナ時代にインフラエンジニアは何をするのか
gree_tech
start Heroku
start Heroku
Hazuki Wakabayashi
KubernetesでPHPを動かした話
KubernetesでPHPを動かした話
gree_tech
ProjectAtomic-and-geard
ProjectAtomic-and-geard
Naoto TAKAHASHI
Was ist angesagt?
(20)
[JANOG35.5] WhiteBox SW検証 ~サーバサイド編~
[JANOG35.5] WhiteBox SW検証 ~サーバサイド編~
WebAssemblyとBlazor 、WebAssembly System Interfaceでコンテナライズの設計を解説
WebAssemblyとBlazor 、WebAssembly System Interfaceでコンテナライズの設計を解説
できる!サーバレスアーキテクチャ
できる!サーバレスアーキテクチャ
Apache Mesosってなに
Apache Mesosってなに
KubernetesでGPUクラスタを管理したい
KubernetesでGPUクラスタを管理したい
Azure Functions 入門
Azure Functions 入門
[SAPPORO CEDEC] サービスの効果を高めるグリー内製ツールの技術と紹介
[SAPPORO CEDEC] サービスの効果を高めるグリー内製ツールの技術と紹介
Azure DevOps Online Vol.3 - Inside Azure Pipelines
Azure DevOps Online Vol.3 - Inside Azure Pipelines
Infrastrucure as a CodeにおけるJenkinsの役割
Infrastrucure as a CodeにおけるJenkinsの役割
Spring native について
Spring native について
今日からはじめるディープラーニング
今日からはじめるディープラーニング
20170624 interact2017 open shift on azure
20170624 interact2017 open shift on azure
Google Compute Engine 入門
Google Compute Engine 入門
1st step LogicFlow
1st step LogicFlow
Azure DevOps と開発管理
Azure DevOps と開発管理
cf-containers-broker を使ってローカル環境もサービスの恩恵をうける
cf-containers-broker を使ってローカル環境もサービスの恩恵をうける
コンテナ時代にインフラエンジニアは何をするのか
コンテナ時代にインフラエンジニアは何をするのか
start Heroku
start Heroku
KubernetesでPHPを動かした話
KubernetesでPHPを動かした話
ProjectAtomic-and-geard
ProjectAtomic-and-geard
Andere mochten auch
Azure How to Learn &ゆるふわ雑談Q&A
Azure How to Learn &ゆるふわ雑談Q&A
Keiji Kamebuchi
Azure App Service Overview LT
Azure App Service Overview LT
Keiji Kamebuchi
スクリプトによるAzure管理Tips / JAZUG 2014.09.26
スクリプトによるAzure管理Tips / JAZUG 2014.09.26
Keiji Kamebuchi
クラウドことはじめ
クラウドことはじめ
Keiji Kamebuchi
AzureでLaravel動かしてみた
AzureでLaravel動かしてみた
Keiji Kamebuchi
Azure概要とハイブリッドWebサイトとか / 2014.09.27
Azure概要とハイブリッドWebサイトとか / 2014.09.27
Keiji Kamebuchi
ちょっと分かった気になるAzure概要
ちょっと分かった気になるAzure概要
Keiji Kamebuchi
VYATTA USERS MEETING Spring 2014 - JAZUG
VYATTA USERS MEETING Spring 2014 - JAZUG
Keiji Kamebuchi
Infrastructure as code for azure
Infrastructure as code for azure
Keiji Kamebuchi
C#ユーザー会 //build/ まとめ(サーバー編)
C#ユーザー会 //build/ まとめ(サーバー編)
Keiji Kamebuchi
Azure Functions と Serverless - 概要と企業向け Tips
Azure Functions と Serverless - 概要と企業向け Tips
Keiji Kamebuchi
Andere mochten auch
(11)
Azure How to Learn &ゆるふわ雑談Q&A
Azure How to Learn &ゆるふわ雑談Q&A
Azure App Service Overview LT
Azure App Service Overview LT
スクリプトによるAzure管理Tips / JAZUG 2014.09.26
スクリプトによるAzure管理Tips / JAZUG 2014.09.26
クラウドことはじめ
クラウドことはじめ
AzureでLaravel動かしてみた
AzureでLaravel動かしてみた
Azure概要とハイブリッドWebサイトとか / 2014.09.27
Azure概要とハイブリッドWebサイトとか / 2014.09.27
ちょっと分かった気になるAzure概要
ちょっと分かった気になるAzure概要
VYATTA USERS MEETING Spring 2014 - JAZUG
VYATTA USERS MEETING Spring 2014 - JAZUG
Infrastructure as code for azure
Infrastructure as code for azure
C#ユーザー会 //build/ まとめ(サーバー編)
C#ユーザー会 //build/ まとめ(サーバー編)
Azure Functions と Serverless - 概要と企業向け Tips
Azure Functions と Serverless - 概要と企業向け Tips
Ähnlich wie ゆるふわAzure Functions
【de:code 2020】 「あつまれ フロントエンドエンジニア」 Azure Static Web Apps がやってきた
【de:code 2020】 「あつまれ フロントエンドエンジニア」 Azure Static Web Apps がやってきた
日本マイクロソフト株式会社
Azure Stack Hybrid DevOpsデモンストレーション
Azure Stack Hybrid DevOpsデモンストレーション
Masahiko Ebisuda
Windows Azure PHP Tips
Windows Azure PHP Tips
Microsoft Openness Japan
de:code 2019 Cloud トラック 総まとめ!
de:code 2019 Cloud トラック 総まとめ!
Minoru Naito
Azure Function GAした!Visual Studio Tools for Azure Functions もプレビューだ!
Azure Function GAした!Visual Studio Tools for Azure Functions もプレビューだ!
Yasuaki Matsuda
2020/06/16 tsjp-azure-staticwebapps-vs_codespaces
2020/06/16 tsjp-azure-staticwebapps-vs_codespaces
Issei Hiraoka
[Japan Tech summit 2017] APP 003
[Japan Tech summit 2017] APP 003
Microsoft Tech Summit 2017
PHP on Windows Azure in Open Source Conference
PHP on Windows Azure in Open Source Conference
Microsoft
Application development with c#, .net 6, blazor web assembly, asp.net web api...
Application development with c#, .net 6, blazor web assembly, asp.net web api...
Shotaro Suzuki
Azure Fundamental
Azure Fundamental
Yui Ashikaga
俺的 Build 2021 Update まとめ
俺的 Build 2021 Update まとめ
Yui Ashikaga
Ignite 2021秋 recap - 開発者向け新機能紹介
Ignite 2021秋 recap - 開発者向け新機能紹介
Kazushi Kamegawa
20150704 MS Azure最新 - innovation egg 第4回
20150704 MS Azure最新 - innovation egg 第4回
Keiji Kamebuchi
2021/03/19 パブリッククラウドを活かす運用プロセス自動化
2021/03/19 パブリッククラウドを活かす運用プロセス自動化
Issei Hiraoka
Azureお助けサービス概要
Azureお助けサービス概要
Keiji Kamebuchi
Azure DevOpsとVisual Studio App CenterをモバイルアプリのCI/CDに活用しよう
Azure DevOpsとVisual Studio App CenterをモバイルアプリのCI/CDに活用しよう
Shinya Nakajima
Chefで始めるWindows Server構築
Chefで始めるWindows Server構築
Takashi Kanai
Azure DevOps で始めるスタートダッシュ
Azure DevOps で始めるスタートダッシュ
Yasuaki Matsuda
Azure Functions あれこれ
Azure Functions あれこれ
Yasuaki Matsuda
Google App Engine Java 入門
Google App Engine Java 入門
tantack
Ähnlich wie ゆるふわAzure Functions
(20)
【de:code 2020】 「あつまれ フロントエンドエンジニア」 Azure Static Web Apps がやってきた
【de:code 2020】 「あつまれ フロントエンドエンジニア」 Azure Static Web Apps がやってきた
Azure Stack Hybrid DevOpsデモンストレーション
Azure Stack Hybrid DevOpsデモンストレーション
Windows Azure PHP Tips
Windows Azure PHP Tips
de:code 2019 Cloud トラック 総まとめ!
de:code 2019 Cloud トラック 総まとめ!
Azure Function GAした!Visual Studio Tools for Azure Functions もプレビューだ!
Azure Function GAした!Visual Studio Tools for Azure Functions もプレビューだ!
2020/06/16 tsjp-azure-staticwebapps-vs_codespaces
2020/06/16 tsjp-azure-staticwebapps-vs_codespaces
[Japan Tech summit 2017] APP 003
[Japan Tech summit 2017] APP 003
PHP on Windows Azure in Open Source Conference
PHP on Windows Azure in Open Source Conference
Application development with c#, .net 6, blazor web assembly, asp.net web api...
Application development with c#, .net 6, blazor web assembly, asp.net web api...
Azure Fundamental
Azure Fundamental
俺的 Build 2021 Update まとめ
俺的 Build 2021 Update まとめ
Ignite 2021秋 recap - 開発者向け新機能紹介
Ignite 2021秋 recap - 開発者向け新機能紹介
20150704 MS Azure最新 - innovation egg 第4回
20150704 MS Azure最新 - innovation egg 第4回
2021/03/19 パブリッククラウドを活かす運用プロセス自動化
2021/03/19 パブリッククラウドを活かす運用プロセス自動化
Azureお助けサービス概要
Azureお助けサービス概要
Azure DevOpsとVisual Studio App CenterをモバイルアプリのCI/CDに活用しよう
Azure DevOpsとVisual Studio App CenterをモバイルアプリのCI/CDに活用しよう
Chefで始めるWindows Server構築
Chefで始めるWindows Server構築
Azure DevOps で始めるスタートダッシュ
Azure DevOps で始めるスタートダッシュ
Azure Functions あれこれ
Azure Functions あれこれ
Google App Engine Java 入門
Google App Engine Java 入門
ゆるふわ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" : "kamebuchi@pnop.co.jp", "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
Jetzt herunterladen