Microsoft Tech Summit 2017
Visual Studio Team Services を使った
Serverless のための継続的デリバリー
Microsoft Tech Summit 2017
モダンな開発スタイル
Microsoft Tech Summit 2017
継続的デリバリ
Microsoft Tech Summit 2017
Serverless
を始めてほしい
Redmond Microsoft campus
Data Factory
Blob Storage
Key Vault
Storage Queue
Event Hub
Stream Analytics
Log Analytics
Power BI
SQL Server
Azure SQL Server
Redis Cache
Serverless 地獄
地獄
地獄
地獄
地獄
Function App
Function
Function
Function
AppSettings
Connection
Strings
面倒
地獄
(再掲載)
地獄
(再掲載)
テスト
リリース
地獄
(再掲載)
Ver 2.0
Data Factory
Blob Storage
Key Vault
Storage Queue
Event Hub
Stream Analytics
Log Analytics
Power BI
SQL Server
Azure SQL Server
Redis Cache
(再掲載)
AppSettings
EndpointA: xxx
AppSettings
EndpointB: xxx
地獄(再掲載)
Data Factory
Blob Storage
Key Vault
Storage Queue
Event Hub
Log Analytics
SQL Server
Redis Cache
Terraform / ARM
Logic App どうするよ?
Visual Studio で
ローカル開発する
Architecture
Orchestration – Manage the Complexity
Durable Functions – Orchestrators for Azure
Functions
Reduce ComplexitySimplify
Enable Long Running FunctionsEnable
Orchestrate FunctionsCoordinate
Why do we need “Durable Functions”
Long Running
& Local State
01
Simplify
Function
Coordination
02
Easy Function
Communication
03
Code-Only
04
What is Durable Functions?
Automatic Save of
Local State
03
No JSON
schemas,
No designer!
01
Sync & Async
Functions Calls
02
F1 F2 F3 F4
// calls functions in sequence
public static async Task<object> Run(DurableOrchestrationContext ctx)
{
try
{
var x = await ctx.CallFunctionAsync("F1");
var y = await ctx.CallFunctionAsync("F2", x);
var z = await ctx.CallFunctionAsync("F3", y);
return await ctx.CallFunctionAsync("F4", z);
}
catch (Exception)
{
// global error handling/compensation goes here
}
}
F1
F2
F3
public static async Task Run(DurableOrchestrationContext ctx)
{
var parallelTasks = new List<Task<int>>();
// get a list of N work items to process in parallel
object[] workBatch = await ctx.CallFunctionAsync<object[]>("F1");
for (int i = 0; i < workBatch.Length; i++)
{
Task<int> task = ctx.CallFunctionAsync<int>("F2",
workBatch[i]);
parallelTasks.Add(task);
}
await Task.WhenAll(parallelTasks);
// aggregate all N outputs and send result to F3
int sum = parallelTasks.Sum(t => t.Result);
await ctx.CallFunctionAsync("F3", sum);
}
Worker
Worker
Worker
Worker
Worker
Stateful/Partitioned
Stateless
Control Queue(s)
Triggers orchestrator
function execution
Work Item Queue
Triggers activity function execution
History & Instance Tables
Key Takeaways - Orchestrator functions
Code Stateful Durable
When
sleeping, not
billed
Automatically
wake up
Scalable
Serverless
を始めてみよう
https://github.com/Azure-Samples/azure-serverless-workshop-
team-assistant/tree/lang/jp
https://blogs.msdn.microsoft.com/kenakamu/
• Azure WebJobs SDK Script: https://github.com/Azure/azure-webjobs-sdk-script
• Azure Functions CLI: https://github.com/Azure/azure-functions-cli
• Durable Functions: https://docs.microsoft.com/en-us/azure/azure-functions/durable-functions-overview
• Azure Samples: https://azure.microsoft.com/en-us/resources/samples/?sort=0&service=functions
• Logic Apps: https://github.com/logicappsio
• Event Grid: https://docs.microsoft.com/en-us/azure/event-grid/overview
Visual Studio Team Services を使った Serverless のための継続的デリバリ

Visual Studio Team Services を使った Serverless のための継続的デリバリ

Editor's Notes

  • #2 1. 頭に、サーバーレスは簡単だと思った。 2. でも、そのあとに地獄がまっている。 ゆえに、こういうことをすればちゃんとすればいいよね。 正しいやり方をシェアします。 無い世界:なかったらどうなるか? ->だからこれを使う必然性がありますよね。 スマートフォン アプリの数 (数字を持ってくる)3か月以内で使われなくなるとか。 持って帰れるものは少ないので減らす
  • #6 絵(始めている絵)+文字
  • #9 アジェンダは文字でしない -> 絵+文字を閉じ込める。ものがおおい。もってかえって欲しかった分量と、データ量が異なった。
  • #12 もっと地獄 みなさんより先に地雷を踏みました。だから皆さんは踏まなくてもいいですよ。 文字が多ければ多いほど、良くない。渡せる情報は、見ている人が、キーワードで検索をするための、パスを渡す。 (キーワードを)
  • #14 ライブラリの扱い難しっ! 地獄 (ひらがなで終わるとわかり)
  • #21 結婚式の引き出物 -> 上げるほうは、沢山あげたいけど、受け取る方はそんないらない。 持って帰れるコアメッセージは1つか、2つ、続きはWebでというパスがあればいい アクションごとにファンクションが定義される これが地獄の種なんですよ。 -> コスモスDB がポチポチしたら作れる。これが、10こ20個になると、一個一個設定するのは愚の骨頂
  • #23 知ってるか、知らないか?というのは、その場で聞く 知っている人にはもう一歩あるんですよね。 ブリッジが必要(前のスライドからの関連性。)エクスペリエンスを共有する。(10個やるの?)
  • #25 デモがある必然性があるように、、、 知っている人は、こうやって、ほかの人に伝えてくださいね。 花束の例 (花束を渡す例、ちょまどさん、しょくばに飾っていおいて)
  • #27 私のお勧め。いろいろあります。ちなみに、お勧めはこれ。
  • #37 正しく表現をしているが、伝えることを考えると。 -> 以前は、 プロセスではなく、何をつくるか?カレーつくる。これにより何ができあがるかが。処理が正しく行われる環境であることを保証するために。おこなっている。問題が起きたら、元に戻す 誰が、何を、どのようにするか? (あなたが、、、今までの環境でテストをして、、、、テスト結果を見て、突き合わせてOKだったら、これはOKとしていましたよね?)
  • #40 良くなる時には、ない世界を説明する(手作業で、、、)
  • #51 Add master slave
  • #57 Aks how many people have experience with coding? Encouraging Developer driven world
  • #58 We will expose a mechanism for sending named events to an orchestrator from outside the orchestration context – e.g. REST API and/or output binding.
  • #59 Detailed design is pending.
  • #61 絵(始めている絵)+文字