SlideShare a Scribd company logo
1 of 13
Download to read offline
Azure SignalR Service
使ってみた
Japan Azure User Group 12周年イベント
2022/09/24(土)
御成門プログラマー(Tomotaka Suzuki)
自己紹介
• 御成門プログラマー(Tomotaka Suzuki)
• Microsoft Azure、Angular を使った Webアプリ開発者
• Twitter:@onarimonprogram
• 技術ブログ:onarimon.jp
趣味のグルメブログです。
よかったらこっちも見てくださ
い!!(food.onarimon.jp)
こっちが
技術ブログ
Azure SignalR Service とは
• リアルタイムに通信できる機能を提供
• 通常の通信では少しめんどくさいサーバーからクラ
イアントに向けての通信を簡単に実装できる
• ASP.NET にもあった ASP.NET SignalR 機能の
Azureマネージドサービス版
• すべてのクライアントにブロードキャスト、個別の
ユーザーに送信、グループに送信など使い分け可能
Azure SignalR サービスとは | Microsoft Learn
Azure SignalR Service
の利用用途の例
利用用途:データのリアルタイム更新
• データをリアルタイムで更新して表示する
• 時間ごとに情報を取得する方式だと余計な通信が発生してしまう。
• 例) スポーツのスコア速報を変更があったタイミングで更新する
• 例) ダッシュボードのチャートデータなどを最新の状態で更新して表示する。
• 例) 在庫情報一覧のなどのデータに変更があったら更新する
Azure SignalR Service
情報の更新があったタイミングで接続し
ているユーザーにブロードキャスト
ダッシュボードや表データなど
利用用途:キュー処理の結果を受け取る
• 処理をキューに投げた後に処理が完了したタイミングで結果を
受け取る。
• Azure のデプロイ完了通知とかがイメージ近いかもしれない(Azure が
使っているかは不明)
Azure SignalR Service
Azure Queue Storage Azure Functions
クライアント
キューに投げる。
(そのタイミングでリクエスト自
体は終了してしまう)
Azure Functions
202 Accepted
202 Accepted
デキュー
何かしらの処理
処理終了後、メッ
セージを Post
処理が完了したメッセージを
個別のクライアントに送信
処理を API に投げる
利用用途:リアルタイムチャット機能
• 後ほどデモ予定
フロントエンド
Azure Web Apps
バックエンド
Azure Functions
Azure SignalR
Service
メッセージ送信:
こんにちわ!!
メッセージ受信:
こんにちわ!!
クライアント
(送信者)
クライアント
(受信者)
他にもたくさん
Azure SignalR Service の使い道
• Microsoft公式ドキュメントでチェック
https://learn.microsoft.com/ja-jp/azure/azure-signalr/signalr-overview
色々な使い道があるのでできることの幅が
広がりそうです!!
Azure SignalR Service の利用の流れ
Azure SignalR Service
クライアント
④メッセージ送信
②接続情報
③接続
①Negotiate
別のクライアント
←同様の手順で接続済
⑤メッセージ受信
⑥クライアントアプリ側で受信
したメッセージを処理
・
・
・
Azure SignalR Service
の Demo
Azure Functions の
SignalR Service バインドが便利
• Azure Functions の SignalR バインド機能を使うと簡単に実装
できることが分かった
• Azure SignalR Service へのクライアントの認証やメッセージ送
信の処理を行ってくれる
Azure Functions における SignalR Service のバインド | Microsoft Learn
Azure SignalR Local Emulator
https://github.com/Azure/azure-signalr
• ローカルでの開発でわざわざAzure上の SignalR Service を使う
ことなくSignalrをローカルで実行できるエミュレーター。
初回設定後はstartコマンドを実行して出てく
るローカル用の接続文字列をアプリケーショ
ンで設定するだけ。ローカルと意識すること
なく使えます。
Azure SignalR Service 使ってみた感想
• SignalR 導入により、アプリケーションでできることの幅が広
がりそう。いろいろ試してみたくなった。
• マネージドサービスとしてとても簡単に実装できる
• Azure Functions の SignalR Service バインドが便利
• Azure SignalR Local Emulator の使用

More Related Content

Featured

Product Design Trends in 2024 | Teenage Engineerings
Product Design Trends in 2024 | Teenage EngineeringsProduct Design Trends in 2024 | Teenage Engineerings
Product Design Trends in 2024 | Teenage EngineeringsPixeldarts
 
How Race, Age and Gender Shape Attitudes Towards Mental Health
How Race, Age and Gender Shape Attitudes Towards Mental HealthHow Race, Age and Gender Shape Attitudes Towards Mental Health
How Race, Age and Gender Shape Attitudes Towards Mental HealthThinkNow
 
AI Trends in Creative Operations 2024 by Artwork Flow.pdf
AI Trends in Creative Operations 2024 by Artwork Flow.pdfAI Trends in Creative Operations 2024 by Artwork Flow.pdf
AI Trends in Creative Operations 2024 by Artwork Flow.pdfmarketingartwork
 
PEPSICO Presentation to CAGNY Conference Feb 2024
PEPSICO Presentation to CAGNY Conference Feb 2024PEPSICO Presentation to CAGNY Conference Feb 2024
PEPSICO Presentation to CAGNY Conference Feb 2024Neil Kimberley
 
Content Methodology: A Best Practices Report (Webinar)
Content Methodology: A Best Practices Report (Webinar)Content Methodology: A Best Practices Report (Webinar)
Content Methodology: A Best Practices Report (Webinar)contently
 
How to Prepare For a Successful Job Search for 2024
How to Prepare For a Successful Job Search for 2024How to Prepare For a Successful Job Search for 2024
How to Prepare For a Successful Job Search for 2024Albert Qian
 
Social Media Marketing Trends 2024 // The Global Indie Insights
Social Media Marketing Trends 2024 // The Global Indie InsightsSocial Media Marketing Trends 2024 // The Global Indie Insights
Social Media Marketing Trends 2024 // The Global Indie InsightsKurio // The Social Media Age(ncy)
 
Trends In Paid Search: Navigating The Digital Landscape In 2024
Trends In Paid Search: Navigating The Digital Landscape In 2024Trends In Paid Search: Navigating The Digital Landscape In 2024
Trends In Paid Search: Navigating The Digital Landscape In 2024Search Engine Journal
 
5 Public speaking tips from TED - Visualized summary
5 Public speaking tips from TED - Visualized summary5 Public speaking tips from TED - Visualized summary
5 Public speaking tips from TED - Visualized summarySpeakerHub
 
ChatGPT and the Future of Work - Clark Boyd
ChatGPT and the Future of Work - Clark Boyd ChatGPT and the Future of Work - Clark Boyd
ChatGPT and the Future of Work - Clark Boyd Clark Boyd
 
Getting into the tech field. what next
Getting into the tech field. what next Getting into the tech field. what next
Getting into the tech field. what next Tessa Mero
 
Google's Just Not That Into You: Understanding Core Updates & Search Intent
Google's Just Not That Into You: Understanding Core Updates & Search IntentGoogle's Just Not That Into You: Understanding Core Updates & Search Intent
Google's Just Not That Into You: Understanding Core Updates & Search IntentLily Ray
 
Time Management & Productivity - Best Practices
Time Management & Productivity -  Best PracticesTime Management & Productivity -  Best Practices
Time Management & Productivity - Best PracticesVit Horky
 
The six step guide to practical project management
The six step guide to practical project managementThe six step guide to practical project management
The six step guide to practical project managementMindGenius
 
Beginners Guide to TikTok for Search - Rachel Pearson - We are Tilt __ Bright...
Beginners Guide to TikTok for Search - Rachel Pearson - We are Tilt __ Bright...Beginners Guide to TikTok for Search - Rachel Pearson - We are Tilt __ Bright...
Beginners Guide to TikTok for Search - Rachel Pearson - We are Tilt __ Bright...RachelPearson36
 
Unlocking the Power of ChatGPT and AI in Testing - A Real-World Look, present...
Unlocking the Power of ChatGPT and AI in Testing - A Real-World Look, present...Unlocking the Power of ChatGPT and AI in Testing - A Real-World Look, present...
Unlocking the Power of ChatGPT and AI in Testing - A Real-World Look, present...Applitools
 
12 Ways to Increase Your Influence at Work
12 Ways to Increase Your Influence at Work12 Ways to Increase Your Influence at Work
12 Ways to Increase Your Influence at WorkGetSmarter
 

Featured (20)

Product Design Trends in 2024 | Teenage Engineerings
Product Design Trends in 2024 | Teenage EngineeringsProduct Design Trends in 2024 | Teenage Engineerings
Product Design Trends in 2024 | Teenage Engineerings
 
How Race, Age and Gender Shape Attitudes Towards Mental Health
How Race, Age and Gender Shape Attitudes Towards Mental HealthHow Race, Age and Gender Shape Attitudes Towards Mental Health
How Race, Age and Gender Shape Attitudes Towards Mental Health
 
AI Trends in Creative Operations 2024 by Artwork Flow.pdf
AI Trends in Creative Operations 2024 by Artwork Flow.pdfAI Trends in Creative Operations 2024 by Artwork Flow.pdf
AI Trends in Creative Operations 2024 by Artwork Flow.pdf
 
Skeleton Culture Code
Skeleton Culture CodeSkeleton Culture Code
Skeleton Culture Code
 
PEPSICO Presentation to CAGNY Conference Feb 2024
PEPSICO Presentation to CAGNY Conference Feb 2024PEPSICO Presentation to CAGNY Conference Feb 2024
PEPSICO Presentation to CAGNY Conference Feb 2024
 
Content Methodology: A Best Practices Report (Webinar)
Content Methodology: A Best Practices Report (Webinar)Content Methodology: A Best Practices Report (Webinar)
Content Methodology: A Best Practices Report (Webinar)
 
How to Prepare For a Successful Job Search for 2024
How to Prepare For a Successful Job Search for 2024How to Prepare For a Successful Job Search for 2024
How to Prepare For a Successful Job Search for 2024
 
Social Media Marketing Trends 2024 // The Global Indie Insights
Social Media Marketing Trends 2024 // The Global Indie InsightsSocial Media Marketing Trends 2024 // The Global Indie Insights
Social Media Marketing Trends 2024 // The Global Indie Insights
 
Trends In Paid Search: Navigating The Digital Landscape In 2024
Trends In Paid Search: Navigating The Digital Landscape In 2024Trends In Paid Search: Navigating The Digital Landscape In 2024
Trends In Paid Search: Navigating The Digital Landscape In 2024
 
5 Public speaking tips from TED - Visualized summary
5 Public speaking tips from TED - Visualized summary5 Public speaking tips from TED - Visualized summary
5 Public speaking tips from TED - Visualized summary
 
ChatGPT and the Future of Work - Clark Boyd
ChatGPT and the Future of Work - Clark Boyd ChatGPT and the Future of Work - Clark Boyd
ChatGPT and the Future of Work - Clark Boyd
 
Getting into the tech field. what next
Getting into the tech field. what next Getting into the tech field. what next
Getting into the tech field. what next
 
Google's Just Not That Into You: Understanding Core Updates & Search Intent
Google's Just Not That Into You: Understanding Core Updates & Search IntentGoogle's Just Not That Into You: Understanding Core Updates & Search Intent
Google's Just Not That Into You: Understanding Core Updates & Search Intent
 
How to have difficult conversations
How to have difficult conversations How to have difficult conversations
How to have difficult conversations
 
Introduction to Data Science
Introduction to Data ScienceIntroduction to Data Science
Introduction to Data Science
 
Time Management & Productivity - Best Practices
Time Management & Productivity -  Best PracticesTime Management & Productivity -  Best Practices
Time Management & Productivity - Best Practices
 
The six step guide to practical project management
The six step guide to practical project managementThe six step guide to practical project management
The six step guide to practical project management
 
Beginners Guide to TikTok for Search - Rachel Pearson - We are Tilt __ Bright...
Beginners Guide to TikTok for Search - Rachel Pearson - We are Tilt __ Bright...Beginners Guide to TikTok for Search - Rachel Pearson - We are Tilt __ Bright...
Beginners Guide to TikTok for Search - Rachel Pearson - We are Tilt __ Bright...
 
Unlocking the Power of ChatGPT and AI in Testing - A Real-World Look, present...
Unlocking the Power of ChatGPT and AI in Testing - A Real-World Look, present...Unlocking the Power of ChatGPT and AI in Testing - A Real-World Look, present...
Unlocking the Power of ChatGPT and AI in Testing - A Real-World Look, present...
 
12 Ways to Increase Your Influence at Work
12 Ways to Increase Your Influence at Work12 Ways to Increase Your Influence at Work
12 Ways to Increase Your Influence at Work
 

Azure SignalR Service 使ってみた

  • 1. Azure SignalR Service 使ってみた Japan Azure User Group 12周年イベント 2022/09/24(土) 御成門プログラマー(Tomotaka Suzuki)
  • 2. 自己紹介 • 御成門プログラマー(Tomotaka Suzuki) • Microsoft Azure、Angular を使った Webアプリ開発者 • Twitter:@onarimonprogram • 技術ブログ:onarimon.jp 趣味のグルメブログです。 よかったらこっちも見てくださ い!!(food.onarimon.jp) こっちが 技術ブログ
  • 3. Azure SignalR Service とは • リアルタイムに通信できる機能を提供 • 通常の通信では少しめんどくさいサーバーからクラ イアントに向けての通信を簡単に実装できる • ASP.NET にもあった ASP.NET SignalR 機能の Azureマネージドサービス版 • すべてのクライアントにブロードキャスト、個別の ユーザーに送信、グループに送信など使い分け可能 Azure SignalR サービスとは | Microsoft Learn
  • 5. 利用用途:データのリアルタイム更新 • データをリアルタイムで更新して表示する • 時間ごとに情報を取得する方式だと余計な通信が発生してしまう。 • 例) スポーツのスコア速報を変更があったタイミングで更新する • 例) ダッシュボードのチャートデータなどを最新の状態で更新して表示する。 • 例) 在庫情報一覧のなどのデータに変更があったら更新する Azure SignalR Service 情報の更新があったタイミングで接続し ているユーザーにブロードキャスト ダッシュボードや表データなど
  • 6. 利用用途:キュー処理の結果を受け取る • 処理をキューに投げた後に処理が完了したタイミングで結果を 受け取る。 • Azure のデプロイ完了通知とかがイメージ近いかもしれない(Azure が 使っているかは不明) Azure SignalR Service Azure Queue Storage Azure Functions クライアント キューに投げる。 (そのタイミングでリクエスト自 体は終了してしまう) Azure Functions 202 Accepted 202 Accepted デキュー 何かしらの処理 処理終了後、メッ セージを Post 処理が完了したメッセージを 個別のクライアントに送信 処理を API に投げる
  • 7. 利用用途:リアルタイムチャット機能 • 後ほどデモ予定 フロントエンド Azure Web Apps バックエンド Azure Functions Azure SignalR Service メッセージ送信: こんにちわ!! メッセージ受信: こんにちわ!! クライアント (送信者) クライアント (受信者)
  • 8. 他にもたくさん Azure SignalR Service の使い道 • Microsoft公式ドキュメントでチェック https://learn.microsoft.com/ja-jp/azure/azure-signalr/signalr-overview 色々な使い道があるのでできることの幅が 広がりそうです!!
  • 9. Azure SignalR Service の利用の流れ Azure SignalR Service クライアント ④メッセージ送信 ②接続情報 ③接続 ①Negotiate 別のクライアント ←同様の手順で接続済 ⑤メッセージ受信 ⑥クライアントアプリ側で受信 したメッセージを処理 ・ ・ ・
  • 11. Azure Functions の SignalR Service バインドが便利 • Azure Functions の SignalR バインド機能を使うと簡単に実装 できることが分かった • Azure SignalR Service へのクライアントの認証やメッセージ送 信の処理を行ってくれる Azure Functions における SignalR Service のバインド | Microsoft Learn
  • 12. Azure SignalR Local Emulator https://github.com/Azure/azure-signalr • ローカルでの開発でわざわざAzure上の SignalR Service を使う ことなくSignalrをローカルで実行できるエミュレーター。 初回設定後はstartコマンドを実行して出てく るローカル用の接続文字列をアプリケーショ ンで設定するだけ。ローカルと意識すること なく使えます。
  • 13. Azure SignalR Service 使ってみた感想 • SignalR 導入により、アプリケーションでできることの幅が広 がりそう。いろいろ試してみたくなった。 • マネージドサービスとしてとても簡単に実装できる • Azure Functions の SignalR Service バインドが便利 • Azure SignalR Local Emulator の使用