Upgrade to Pro
— share decks privately, control downloads, hide ads and more …
Speaker Deck
Sign up for free
Menu
Search
Features
All features
Private URLs
Password Protection
Custom URLS
Scheduled publishing
Remove Branding
Restrict embedding
Deck Collections
Notes
Features
All features
Private URLs
Password Protection
Custom URLS
Scheduled publishing
Remove Branding
Restrict embedding
Deck Collections
Notes
Explore
Featured decks
Featured speakers
Programming
Technology
Storyboards
Explore
Featured decks
Featured speakers
Programming
Technology
Storyboards
Pricing
Search
Sign in
Sign up for free
Azure App Configuration と Key Vault の連携
Search
Hajime
June 19, 2022
Programming
820
0
Share
Embed
Copy iframe code
Copy JS code
Copy link
Start on current slide
Azure App Configuration と Key Vault の連携
Hajime
June 19, 2022
More Decks by Hajime
See All by Hajime
Azure API Management の使い方
hajimes
0
4k
Static Web App の使い方
hajimes
0
2.8k
Azure Functions で SQL Database のデータを操作する API を作成する手順
hajimes
0
1k
Other Decks in Programming
See All in Programming
【DroidKaigi 2026】「アクセシビリティを利用するとき、 アクセシビリティもまたこちらを利用している」 〜マルウェアによる攻撃と防衛について〜
halunoyo
0
420
AIを上手に使っていこうとしたら越境せざるを得なくなった話 〜実践1年で見えた境界を越えなければならない理由と進め方〜 / Crossing borders with AI
tomoyakitaura
4
1.1k
RSSとCodexを使ってX投稿自動化してみた
ochtum
0
110
世界の中心で、AI(App Intents)をさけぶ ー App Intents中心設計の実践ガイド
touyou
0
190
変化を抱擁するドキュメントの作り方 - ビジネスルール駆動開発がもたらす、コードとの新しい関係
ioki
2
130
コンパウンドプロダクト開発のためのローカルプロセスマネージャー再発明 #layerxgo
izumin5210
0
660
Hello, Hiroshima Geospatial Data! — Exploring DoboX with Python
ra0kley
0
180
フロントエンドUIフレームワークのこれまでとこれから
ssssota
2
1.3k
Claude Codeを組織的に動かして月400PRを実現した話
happy_ryo
0
260
Vibes Containers 〜AIで変わるコンテナ設計と運用〜
tkikuc
3
510
ハーネス設計入門 〜プロンプト、コンテキストの次〜
kinopeee
55
36k
Hono + Inertia + React で LP を構築した話
oukayuka
2
220
Featured
See All Featured
職位にかかわらず全員がリーダーシップを発揮するチーム作り / Building a team where everyone can demonstrate leadership regardless of position
madoxten
69
65k
State of Search Keynote: SEO is Dead Long Live SEO
ryanjones
0
260
Google's AI Overviews - The New Search
badams
0
1.6k
Building an army of robots
kneath
306
46k
Site-Speed That Sticks
csswizardry
13
1.5k
KATA
mclloyd
PRO
35
15k
ラッコキーワード サービス紹介資料
rakko
1
4.8M
Max Prin - Stacking Signals: How International SEO Comes Together (And Falls Apart)
techseoconnect
PRO
0
450
What does AI have to do with Human Rights?
axbom
PRO
1
2.4k
We Analyzed 250 Million AI Search Results: Here's What I Found
joshbly
1
1.9k
SEOcharity - Dark patterns in SEO and UX: How to avoid them and build a more ethical web
sarafernandez
0
270
Intergalactic Javascript Robots from Outer Space
tanoku
273
27k
Transcript
Azure App Configuration と Key Vault の連携 (Node.JS 編) (c)
2022 hajimes.life
1. 前提条件と構成 • 実現したいこと • アプリで App Configuration に関連 づけられた
Key Vault のシークレッ ト情報を取得すること • Azure サービス • App Configuration: アプリケーショ ンの設定情報などを⼀元的に管理 • Key Vault: アプリケーションのシー クレット情報などを暗号化して管理 • 実⾏環境 • 処理の流れ 1. Key Vault に値を保存 2. App Configuration に Key Vault への参照情報を登録 3. App Configuration から参照先の Key Vault 情報を取得 4. Key Vault から値を取得 (c) 2022 hajimes.life 環境名 バージョン MacOS 12.4 (Intel) Node.JS v16.15.1 App Configuration Key Vault クライアント 3. 参照先 Key Vault 情報を取得 4. 値を取得 1. Key Vault に値を保存 2. Key Vault への参照情報を登録
2. 今回利⽤する Azure サービスについて App Configuration • 概要︓アプリの設定情報や機能フラ グを⼀元的に管理するサービス。開 発と本番など同じアプリを複数設置
した際の設定ミスを防ぐ • 料⾦︓Free 今回の構成では機能的に Free プラ ンでも実現可能 実運⽤に向けては SLA の定義がなく 1 ⽇のアクセス頻度が 1,000 回なた め Standard プランにした⽅が無難 Key Vault • 概要︓サービスのシークレットや サーバ証明書などの秘匿情報を暗号 化してセキュアに管理するサービス • 料⾦︓Standard 今回の構成では「秘密情報の操作」 のみが課⾦対象となり、 1 万回操作 して $0.03 のコストが発⽣ Standard プランでも SLA が 99.99% で提供されているため、実 運⽤でもプランの変更は不要 (c) 2022 hajimes.life App Configuration の価格 https://azure.microsoft.com/ja-jp/pricing/details/app-configuration/ Key Vault の価格 https://azure.microsoft.com/ja-jp/pricing/details/key-vault/
Key Vault / App Configuration の設定⼿順 1. Key Vault の設定
1. Key Vault の作成 2. 「Secrets」メニューを選択して 「Generate/Import」ボタンを押 す 3. 表⽰された「Create a secret」画 ⾯で必要な項⽬を⼊⼒し作成 2. App Configuration の設定 1. App Configuration の作成 2. 「Configuration Explorer」メ ニューを選択して「Create」ボタ ンを押し「Key Vault reference」 を選択 3. 表⽰された「Create」画⾯で参照 先となる Key Vault のシークレッ トを選択して「Apply」ボタンを 押す (c) 2022 hajimes.life
クライアント側での値の取得⼿順 1. App Configuration から Key Vault の格納先情報を取得 • 事前に
App Configuration の接続⽂ 字列と構成名を取得しておく • 上記のコードで retrievedSetting の value に Key Vault の URI が格納 されている 2. URI から Key Vault に格納さ れているシークレットを取得 • 事前に Key Vault のシークレット名 を取得しておく • 上記コードで secret に値が格納さ れている (c) 2022 hajimes.life const appConfig = require('@azure/app-configurationʼ); const appConfClient = new appConfig.AppConfigurationClient(AC_CONN_STR); const retrievedSetting = await appConfClient.getConfigurationSetting({ key: AC_KEY_NAME }); AC_CONN_STR: App Configuration 接続⽂字列 AC_KEY_NAME: 構成名 const kvUri = new URL(JSON.parse(retrievedSetting.value).uri); const credential = new DefaultAzureCredential(); const kvClient = new SecretClient(kvUri.protocol + '//' + kvUri.hostname, credential); const secret = await kvClient.getSecret(KEY_VAULT_SECRET_NAME); KEY_VAULT_SECRET_NAME: シークレット名
(c) 2022 hajimes.life