第13回 Tokyo Jazui Night 2018/07/18
Durable Func,ons“ J 8”70/30 ( 2 ) 1
View Slide
• twitter : @yu_ka1984• • $ (• !&"Azure%' #• Medium https://medium.com/@yuka1984• $ http://tamafuyou.hatenablog.com/
• Durable Functions • Durable Functions•
• • Durable Func-ons•
• Azure Functions /• "%+(,Durable FunctionsAzure Functions#-*!.Durable Functions(Azure Functions0&$' )&
Durable Functions4 1. 2 324. 2 324. 4 . . .4. 34 . 1.4. 34 . 13
Durable Functions3 • Activity• ! APIDB• Orchestrator• Activity #Activity$!• Starter• Orchestrator "
Activity h"ps://gist.github.com/yuka1984/4df7d7f8b44357f3d4a4b23be46fdce2
Orchestrator https://gist.github.com/yuka1984/347bead2c0720ab1c4de3e8ca9ea91d5
Starter https://gist.github.com/yuka1984/42af948abb75892461c2a206f8ff5b87
Durable Functions • (&%#(&%#$Orchestrator/41+• '#'#$Activity/41+• $!%OrchestratorActivity 1+586;• ((!%37 Orchestrator 1+9:6;• "!&!ActivityOrchestrator .*0 ) -,!&!2<
Starter48GOrchestratorD6!0'.- +G +*%$"0 +(#',&)-OrchestratorD6@F!0'.- + +',Orchestrator48GCallAc.vity4852/ +*%$"(Ac.vity?9G1 78E)0 +/ +',Orchestrator ;3Ac.vity4852Aci.vity52>B(#',&)-@F!0'.- +*%$"0 +!0'.- + +',Orchestrator48G<GCallAc.vity 52: H(#',&)[email protected]>BI=OrchestratorACallAc.vity4852(ryOrchestratorCJ
Durable Funcitons1. ! ! )&"2. Azure Functions ('3. 3%$ #Azure Functions(' Durable Functions
,1#0-3!/ 2!/)!/!/?=9 "0*)$2+'2.(&%+'2@>7;8Durable Functions46.(&%+'25<"0*)$2+'2:;8
Durable Functions95@?36$1'#1• '*(/#'#1• ,+";A8:4'#1• <7%.1 -1'#1• "!,.!1%"'&'#1>= )02 http://tamafuyou.hatenablog.com/
'/ ,& ""0+.,&%* + $#)Durable Func,ons-1( !
Azure FunctionsAzure Func*ons&+host.jsonFunc*onApp(" !6#)*" 4'2/• Func*onApp%$(".Func*on5(",3 !• Excep*on01-(" !• "!6 !
Azure FunctionsDurable Func,onsOrchestrator !• CallAc,vityWithRetryAsync• CallSubOrchestratorWithRetryAsync• try-catch-finary
≒
if / if else / else / switch
for / foreach / while / do-whilecontinue / breaklinq
try-catch / try-finaly / try-catch-finaly
CreateTimer
WaitForExternalEvent / RaiseEventAsync
Task.WhenAll / Task.WhenAny
KG/).F1. OrchestratorQ>7D? '%Table2.A:API'%S3.A:API$#L8-(,[XUY 65M=2OSlackI;NV@*&$"RB4. Slack*&$"HZ -0-&2M=WA:API$#I;5.*&$"JY-0-&65I;51E94 65PC(,0 !+04 3M=JYhttps://gist.github.com/yuka1984/c5779a0e3d070a4c6e2cf72fe46ae41d#file-orchestrator-cs
Durable Functions - -• &' ) $(*!• (*!• "#%"(*!
όοΫΤϯυॲཧΛॊೈʹߗ͘࡞ΕΔͦΕ͕ʮ%VSBCMF'VODUJPOTʯ
Durable Func,ons
$-/&0 EC +"*#• ).• EC• '• 21(,3% 4 !
7EC,%Azure Functions81!&*" "$.9A=@<E-!'" 66):0CD26(+;>/?5B 34 Durable Functions
• AL]APIVE$S"1015= "89(6939( !• MQ,/-,0-$1BGN 2B>0-GN]API !• RAPI>?[IK;7'&,1"&6$X,8.179( !• VE48:ZUO=d !• WJ169*'+59$<TH@= !bc48$)2"Y`D716%]_C"Durable Func4ons$^F#\Ca"P
))B Func%ons31.,52H$6:@8F)(C#%= "& %w)!A+ wwwPreview E<57*GA;?('-450/>D+ G9
MoT M mlM D vCB t a g rG vbifh b MF F wp g cea nus M C
Durable FunctionsDurable Functions"*1%8/7A<7959+9 F> =D:(0739)H>;E@ VSTSC?TaskhubName(Durable Functions,$49IJ).6*IJLB :.6*-&!$9;Azure FunctionsSlot (Preview)(07%8&0.6*#%'2GK
Durable Func,ons• Application Insights!4:• EventGrid+0Orchestrator)$684:• <9#'(running68Orchestrator &%!,1Instance "Orchestrator)$68*; " "4:7 Instance "$-. FunctionApp35 4:$2/=
Durable Func,ons• ( 'E6@ KH93• Orchestrator/; 1@%!")'#*=• 27:")'$• PrecompileFunctions& (ASingletonAttributeAOLE6+0,I-5M D8
Durable Func,ons• !/• Durable Func-ons),Orchestrator7,!*5 #%7,!3• Ac-vityDI(Func-ons"& &0. !( • EndToEnd!%$host+' func-ons-(2(Durable Func-ons!416)
Durable Functions• :E@;#*/LAHJMK;=7I• )/>C3 F;5R863 B<• Durable FunctionsLA1'+"%D• Durable FunctionsAzure Storage@;PAzure Storage49O2NG?()-0!,$.&" • V1(.NET Framework)QGAV2Preview
Durable Func,onsAppService or • E>B>• MLK485IO 9;6?%$1 "(!2%&2% <7C• AppService+/2%$1 '+ %$1 "( : )*#,2% JNA• @H-.03LFG=MLK4+/2JD
Durable Func,ons• 2?6"&%(• #'%:@4/• 7;=:@4/• 6. !"$)8*• 39=>9=,<"' 15*0-+A
Github