Upgrade to Pro
— share decks privately, control downloads, hide ads and more …
Speaker Deck
Features
Speaker Deck
PRO
Sign in
Sign up for free
Search
Search
Application insightsを用いてAzure AD B2Cをより使いこなす
Search
Mitsuzono Hiroto
June 18, 2020
Technology
0
510
Application insightsを用いてAzure AD B2Cをより使いこなす
Alternative Architecture DOJO #4
Mitsuzono Hiroto
June 18, 2020
Tweet
Share
More Decks by Mitsuzono Hiroto
See All by Mitsuzono Hiroto
ここらでGPSマルチユニットが如何に使いやすいか本気で説明するから聞きなさい
mitsuzono
0
1.1k
Application Insights と KQL
mitsuzono
0
490
LINE Messaging API メッセージ送受信とアカウント連携まわり
mitsuzono
0
81
Application Insights と Cosmos DB ―たかがTips、そう思ってないですか?―
mitsuzono
0
49
近頃若者のサーバー離れが深刻化しています
mitsuzono
0
860
新卒、ヘルキャンプとデスマーチへの挑戦
mitsuzono
0
360
Other Decks in Technology
See All in Technology
エンタープライズ環境下での Active Directory の運用 TIPS
tamaiyutaro
1
1.5k
検証を通して見えてきたTiDBの性能特性
lycorptech_jp
PRO
5
2.6k
【SORACOM UG】SIM Deep Dive セキュアエレメント編
soracom
PRO
0
250
強みを伸ばすキャリアデザイン
yug1224
0
200
PHP"オレ"カンファレンスの告知
ysknsid25
0
330
「ふりかえりのふりかえり」をふりかえり、実のあるふりかえりにする
naitosatoshi
0
220
社内勉強会運営のコツ
senoo
6
1.1k
「共通基盤」を超えよ! 今、Platform Engineeringに取り組むべき理由
jacopen
25
5.8k
長期運用プロジェクトでのMySQLからTiDB移行の検証
colopl
1
610
コンパウンドスタートアップのためのスケーラブルでセキュアなInfrastructure as Codeパイプラインを考える / Scalable and Secure Infrastructure as Code Pipeline for a Compound Startup
yuyatakeyama
3
1.9k
Signals Unleashed: The Full Guide
rainerhahnekamp
0
360
株式会社EventHub・エンジニア採用資料
eventhub
0
1.9k
Featured
See All Featured
Visualization
eitanlees
135
14k
Web Components: a chance to create the future
zenorocha
304
41k
Teambox: Starting and Learning
jrom
128
8.4k
Atom: Resistance is Futile
akmur
258
25k
Why You Should Never Use an ORM
jnunemaker
PRO
50
8.6k
ParisWeb 2013: Learning to Love: Crash Course in Emotional UX Design
dotmariusz
103
6.6k
Art, The Web, and Tiny UX
lynnandtonic
288
19k
Code Review Best Practice
trishagee
54
15k
Typedesign – Prime Four
hannesfritz
36
2k
Building Better People: How to give real-time feedback that sticks.
wjessup
353
18k
I Don’t Have Time: Getting Over the Fear to Launch Your Podcast
jcasabona
20
1.6k
Debugging Ruby Performance
tmm1
69
11k
Transcript
Azure Application insightsを用いて Azure AD B2Cをより使いこなす 株式会社オルターブース 満園 裕人
• 満園裕人 • 株式会社オルターブース エンジニア • 業務では主にC#(.NET Core)で Webアプリケーション開発を行う 自己紹介
Copyright © Alterbooth Inc. All Rights Reserved. 2
• Application Insights • 概要 • クエリ • Azure AD
B2Cとの組み合わせ • 前準備(カスタムポリシーの構成) • 開発環境での設定、活用方法 • 運用環境での設定、活用方法 目次 Copyright © Alterbooth Inc. All Rights Reserved. 3
Application Insights Copyright © Alterbooth Inc. All Rights Reserved. 4
• アプリケーションパフォーマンス管理サービス • Azure Monitorに統合されている • オートスケールやアラートの条件として利用可能 • Azureポータルからリソース作るとよく勝手についてくる •
が、論理アプリケーション単位でまとめるのがオススメ • アプリ側の設定についてはVisualStudioで行うと楽 • 手動でやるとNugetの設定やら何やらで面倒 Application Insights Copyright © Alterbooth Inc. All Rights Reserved. 5
• Azure Data Explorerで使われる読み取り専用クエリ • Application Insightsの「ログ」ボタンから見れる KQL (Kusto Query
Language)
Azure AD B2C + Application Insights Copyright © Alterbooth Inc.
All Rights Reserved. 7
• Azure AD B2Cでカスタムポリシーを構成する必要がある • 「カスタムポリシーの概要」ページの手順に沿って作成 • https://docs.microsoft.com/ja-jp/azure/active-directory- b2c/custom-policy-get-started •
主に↑のカスタムポリシーを書き換えていく前提の内容になって います Application Insightsを追加する前作業 Copyright © Alterbooth Inc. All Rights Reserved. 8
Application Insightsの活用 ―開発環境編― Copyright © Alterbooth Inc. All Rights Reserved.
9
• Azure AD B2CはApplication Insightsへのデータ送信機能をもつ • https://docs.microsoft.com/ja-jp/azure/active-directory- b2c/troubleshoot-with-application-insights • IDプロバイダーとの間で送受信されるすべての要求を収集
• 開発者モードで配置されている場合にのみ収集される • 手順 • Application Insightsのリソースを作成、キーを取得 • カスタムポリシーを構成(今回はSignUpOrSignin.xmlを編集) カスタムポリシーの問題を診断(開発環境のみ) Copyright © Alterbooth Inc. All Rights Reserved. 10
カスタムポリシーの問題を診断(開発環境のみ) Copyright © Alterbooth Inc. All Rights Reserved. 11
• トレースログとして出力される • ログの活用例 • 細かい情報が見れる • エラーが起きたときの原因調査 • 取れる情報の把握
• 運用環境でのログ出力(後述)で使う プロパティ名の確認など カスタムポリシーの問題を診断(開発環境のみ) Copyright © Alterbooth Inc. All Rights Reserved. 12
Application Insightsの活用 ―運用環境編― Copyright © Alterbooth Inc. All Rights Reserved.
13
• 前述のものより細かい設定が必要 • https://docs.microsoft.com/ja-jp/azure/active-directory- b2c/analytics-with-application-insights • 今回はTrustFrameworkBase.xmlと TrustFrameworkBaseExtensions.xmlを編集します(割愛) • カスタムイベントとして出力される
• ユーザー動作の追跡が可能 ユーザー体験のイベントログ収集(運用環境含む) Copyright © Alterbooth Inc. All Rights Reserved. 14
• 「(省略可)さらにデータを収集する」項目の補足 • Object IDや外部アカウントのIDを取りたい場合もここに追記 ユーザー体験のイベントログ収集(運用環境含む) Copyright © Alterbooth Inc.
All Rights Reserved. 15
• LINE ユーザーIDも取れる! ユーザー体験のイベントログ収集(運用環境含む) Copyright © Alterbooth Inc. All Rights
Reserved. 16
• LINE ユーザーIDでフィルタリングもできる! ユーザー体験のイベントログ収集(運用環境含む) Copyright © Alterbooth Inc. All Rights
Reserved. 17
まとめ Copyright © Alterbooth Inc. All Rights Reserved. 18
• Application Insightsを組み合わせることによって… • 開発時のカスタムポリシーのデバッグを効率化できる • エラー詳細 • ログとして取れる情報の確認 •
運用時もエラーの検知や原因特定が行いやすくなる • 必要な情報のみに絞るための設定が必要 • アラートルールの追加&Webhookの設定が可能に まとめ Copyright © Alterbooth Inc. All Rights Reserved. 19
• カスタムポリシーの概要 • https://docs.microsoft.com/ja-jp/azure/active-directory- b2c/custom-policy-get-started • カスタムポリシーのトラブルシューティング • https://docs.microsoft.com/ja-jp/azure/active-directory- b2c/troubleshoot-with-application-insights
• ユーザー動作の追跡 • https://docs.microsoft.com/ja-jp/azure/active-directory- b2c/analytics-with-application-insights 参考ドキュメント Copyright © Alterbooth Inc. All Rights Reserved. 20
ご清聴ありがとうございました! Copyright © Alterbooth Inc. All Rights Reserved. 21