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
Azure portal から Azure REST API を理解する
Search
Sponsored
·
SiteGround - Reliable hosting with speed, security, and support you can count on.
→
skmkzyk
October 23, 2024
Technology
190
0
Share
Embed
Copy iframe code
Copy JS code
Copy link
Start on current slide
Azure portal から Azure REST API を理解する
skmkzyk
October 23, 2024
More Decks by skmkzyk
See All by skmkzyk
Microsoft Agent 365 についてゆっくりじっくり理解する!
skmkzyk
0
930
Microsoft Agent 365 を 30 分でなんとなく理解する
skmkzyk
1
1.4k
FinOps について (ちょっと) 本気出して考えてみた
skmkzyk
0
370
西日本リージョンで可用性ゾーン解禁!
skmkzyk
2
120
Azure の知識地図の執筆にあたって
skmkzyk
1
300
Azure VM を作成するときのいろいろ
skmkzyk
1
460
Microsoft の ZTNA をちょっと紐解いていく
skmkzyk
1
1.3k
Microsoft の SSE の現在地
skmkzyk
0
520
ネットワークの Microsoft MVP だけど、SASE が万能すぎてもう俺いらなくね?
skmkzyk
0
640
Other Decks in Technology
See All in Technology
OTel × Datadog で 「AI活用」を計測し、改善に繋げる
shihochan
2
630
iOS アプリの「これって不具合ですか?」を AI に調べてもらう
miichan
0
140
MUSUBI 田中裕一『AIと共に行う「しごとのリデザイン」- スモールバックオフィス編』AI Ops Lab #4
musubi
0
310
AIをフル活用してオンコール機能のプロトタイプを2日で作った話 / Building an AI-Powered On-Call Prototype in Just Two Days
nari_ex
0
110
データレイクの「見えない問題」を可視化する
sansantech
PRO
1
200
LayerX コーポレートエンジニアリング室におけるサプライチェーンセキュリティへの取り組み / Supply Chain Security at LayerX Corporate Engineering
yuyatakeyama
3
830
GitHub Copilot 最新アップデート – 「一歩先」の実践活用術
moulongzhang
5
1.7k
水を運ぶ人としてのリーダーシップ
izumii19
4
990
本当の”仕事”を手放せる未来が見えた
mu7889yoon
0
110
【Snowflake Summit 2026 Recap!!】Snowflake Summit Deep Dive: Security & Governance
civitaspo
1
310
IaC コードを資産へ:AWS CDK 社内ライブラリと横断展開 / aws-summit-japan-2026
gotok365
10
1.6k
BPaaSで進むAIオペレーションの現在地 AI実装が効く領域とスケーラビリティの選定と実装
kentarofujii
0
150
Featured
See All Featured
RailsConf & Balkan Ruby 2019: The Past, Present, and Future of Rails at GitHub
eileencodes
141
35k
4 Signs Your Business is Dying
shpigford
187
22k
30 Presentation Tips
portentint
PRO
1
330
Performance Is Good for Brains [We Love Speed 2024]
tammyeverts
12
1.7k
Building Flexible Design Systems
yeseniaperezcruz
330
40k
10 Git Anti Patterns You Should be Aware of
lemiorhan
PRO
659
62k
Templates, Plugins, & Blocks: Oh My! Creating the theme that thinks of everything
marktimemedia
31
2.8k
SEO for Brand Visibility & Recognition
aleyda
0
4.6k
Dealing with People You Can't Stand - Big Design 2015
cassininazir
367
27k
Tips & Tricks on How to Get Your First Job In Tech
honzajavorek
1
540
The Impact of AI in SEO - AI Overviews June 2024 Edition
aleyda
5
1.1k
Navigating the moral maze — ethical principles for Al-driven product design
skipperchong
2
400
Transcript
Copyright (C) ProGrive Consulting Co.,Ltd. All rights reserved. https://www.progrive.co.jp https://www.progrive.co.jp
株式会社プログライブ コンサルティング Kazuyuki Sakemi (酒見 一幸) Azure portal から Azure REST API を理解する 2024/10/26 1
Copyright (C) ProGrive Consulting Co.,Ltd. All rights reserved. Summary Azure
を中心とした開発や運用自動化のスペシャリストとして、 日系・外資系 SIer や日本マイクロソフトを経験し、現職にて活躍中。 独法や文教業界を中心に、要件定義から設計構築、NW/SV/アプリ 運用までの幅広いプロジェクトに従事。日本マイクロソフトでは、顧客の コスト最適化や人材育成に向けたコンサルティングを中心に、ビジネスの 加速に貢献。2024年08月、Microsoft MVP for Azure に選出。 自己紹介 https://twitter.com/_skmkzyk https://zenn.dev/skmkzyk https://atbex.attokyo.co.jp/blog/001013001/ 酒見 一幸 (Kazuyuki Sakemi) from 株式会社プログライブ コンサルティング https://speakerdeck.com/skmkzyk
Copyright (C) ProGrive Consulting Co.,Ltd. All rights reserved. 会社概要 3
会社名 株式会社プログライブ コンサルティング [ProGrive Consulting Co., Ltd.] 設立 2023年10月20日 資本金 1,000万円 従業員数 8名 代表者名 代表取締役社長 中川 暢也 所在地 〒101-0062 東京都千代田区神田駿河台2-5-1 御茶ノ水ファーストビル PROGRIVEとは、 進歩[Progress]+繁栄[Thrive] の造語です。 変化を恐れず新しいことへ積極的にチャレンジし「進歩」を 続ける事業体を目指し、 革新的なアプローチにより新たな価値を創造することにより、 顧客および社員を豊かな生活へ導く( 「繁栄」 )企業で ありたいという想いを込めてこの社名が誕生しました。
Copyright (C) ProGrive Consulting Co.,Ltd. All rights reserved. 会社概要 4
会社名 株式会社プログデンス [Progdence Co., Ltd.] 設立 2006年10月20日 資本金 1,000万円 従業員数 約220名 代表者名 代表取締役社長 山田 大輔 東京本社 〒101-0062 東京都千代田区神田駿河台2-5-1 御茶ノ水ファーストビル 関西事業所 〒541-0056 大阪府大阪市中央区久太郎町3丁目1-6 伊藤佑ビル大阪本町 7F Progdenceとは、 進歩[Progress]+信頼[Confidence] の造語です。 一歩一歩、堅実で 健全なビジネス(経営)を心がけ、そ の結果、お客様からの信頼を得られるような企業でありた いという想いを込めてこの社名が誕生しました。 Progdenceという社名そのものが、私達社員一人ひとりが 常に心に留めている会社の“マインド(精神)”です。
Copyright (C) ProGrive Consulting Co.,Ltd. All rights reserved. 5 プログデンスグループの取組
プログデンスグループとして、お客様の課題に関する戦略立案から、解決方法のソリューション導入におけるインテグレーションまで、グループ全体でサポートいたします。 プログライブ コンサルティング 提案力 管理計画力 ITの専門知識力 問題解決力 プログデンス 多くの案件 遂行実績 提案力 設計力 幅広いプロダクトへ の知見 コンサルティング力 インテグレーション力 プログデンスグループの強み
Copyright (C) ProGrive Consulting Co.,Ltd. All rights reserved. 提供サービス紹介 TOKYO
MX ええじゃない課Bizに出演!! 【School Shuttle】教育現場のユーザーアカウント管理ツール!#46-1 After GIGA、生徒/教員の「簡単」アカウント管理はスクールシャトル! School Shuttle とは、 株式会社プログデンスが提供する、 Microsoft Excel で手軽に大量のユーザアカウント を管理できるツールです。 お客様環境に応じて Azure Active Directory用 /Google Workspace用の2種類 をラインナップしています。 6
Copyright (C) ProGrive Consulting Co.,Ltd. All rights reserved. 7
Copyright (C) ProGrive Consulting Co.,Ltd. All rights reserved. 企業 IT
戦略から運用までの一貫サポート:プログライブコンサルティングの強み 8 戦略 Strategy 戦術 Tactics 実行 Execution 運用 Operations 組織のビジョンや目的の明確化し、中長期的 な戦略を立案 戦略を具体的なアーキテクトやアクションに落と し込み、実行的な戦術を策定 戦術を実行、進捗をモニタリング。必要に応じ て戦術や戦略を調整 実行された戦術を日常的に管理・維持し、安 定した成果を継続的に提供 企業 IT の戦略フェーズから運用フェーズまで、プログライブ コンサルティングが一貫してサポートします。情報システム部の役職経験者が豊富な経 験と専門知識を活かし、初期段階から関与することで、リスクを最小限に抑え、システムの品質を高め、最適なソリューションを提供します。 熟練したリーダーシップにより、問題発生時にも迅速かつ的確な対応が可能です 戦略の階層(上位の階層が下位の階層を決定する) 情報システム部 役職経験者 常 駐 マネージャクラス PM/PMO 常 駐 エンジニア アーキテクト 常 駐 オペレータ 1人月 シェアード 情報システムサービス IT組織/ 情報システム部門 CIO/役職者 プロジェクト責任者/ エンジニア ヘルプデスク/ オペレータ 伴 走 型 サ ポ ー ト 業 務 プ ロ セ ス 実 行
Copyright (C) ProGrive Consulting Co.,Ltd. All rights reserved. FYI: 伴奏もできます
9 9 月に歌の発表会に参加してきました
Copyright (C) ProGrive Consulting Co.,Ltd. All rights reserved. Azure portal
とは何か
Copyright (C) ProGrive Consulting Co.,Ltd. All rights reserved. Azure portal
使ってますか Azure portal を使ってリソース作成 リソースの状況を Azure Monitor を使って監視 Microsoft Cost Management でコストを確認 Azure AI Studio でモデルの動作を確認 JSON こねこねくん
Copyright (C) ProGrive Consulting Co.,Ltd. All rights reserved. Azure portal
がやり取りしている JSON とはなにか 12 Azure portal での通信状況を開発者ツールで確認してみる なんかいろいろやってる
Copyright (C) ProGrive Consulting Co.,Ltd. All rights reserved. 要求の一例 (パースしたもの)
13
Copyright (C) ProGrive Consulting Co.,Ltd. All rights reserved. 応答の一例 (パースしたもの)
14
Copyright (C) ProGrive Consulting Co.,Ltd. All rights reserved. (たぶん) 非公開
API のひとつ、batch 15 複数の REST API を同時実行できる API がある
Copyright (C) ProGrive Consulting Co.,Ltd. All rights reserved. batch API
16 https://management.azure.com/subscriptions/xxxxxxxx-xxxx-xxxx-xxxx- xxxxxxxxxxxx/resourceGroups/azshci/providers/Microsoft.KeyVault/vaults/azhci96y5ge- hcikv/providers/microsoft.Insights/metrics?timespan=2024-10-22T06:15:00.000Z/2024-10- 23T06:15:00.000Z&interval=FULL&metricnames=ServiceApiHit&aggregation=count&top=10&orderby=count desc&$filter=ActivityType eq '*'&validatedimensions=false&api-version=2019-07-01 https://management.azure.com/subscriptions/xxxxxxxx-xxxx-xxxx-xxxx- xxxxxxxxxxxx/resourceGroups/azshci/providers/Microsoft.KeyVault/vaults/azhci96y5ge- hcikv/providers/microsoft.Insights/metrics?timespan=2024-10-22T06:00:00.000Z/2024-10- 23T06:15:00.000Z&interval=PT15M&metricnames=ServiceApiHit&aggregation=count&top=10&orderby=count desc&$filter=ActivityType eq '*'&autoadjusttimegrain=true&validatedimensions=false&api-version=2019-07-01 https://management.azure.com/subscriptions/xxxxxxxx-xxxx-xxxx-xxxx- xxxxxxxxxxxx/resourceGroups/azshci/providers/Microsoft.KeyVault/vaults/azhci96y5ge- hcikv/providers/microsoft.Insights/metrics?timespan=2024-10-22T06:15:00.000Z/2024-10- 23T06:15:00.000Z&interval=FULL&metricnames=ServiceApiLatency&aggregation=average&top=10&orderby=average desc&$filter=ActivityType eq '*'&validatedimensions=false&api-version=2019-07-01 … 5 つの REST API をまとめて投げている
Copyright (C) ProGrive Consulting Co.,Ltd. All rights reserved. Azure REST
API とは
Copyright (C) ProGrive Consulting Co.,Ltd. All rights reserved. Azure REST
API の概要 18 Azure REST API はドキュメント化されている 大体は以下のようなフォーマットになっている https://management.azure.com /subscriptions/xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx /resourceGroups/azshci /providers/Microsoft.KeyVault /vaults/xxxxxxxx ?api-version=2023-07-01 https://github.com/Azure/azure-rest-api-specs https://learn.microsoft.com/en-us/rest/api/
Copyright (C) ProGrive Consulting Co.,Ltd. All rights reserved. (念のため) パス部分のそれぞれの説明
19 /subscriptions/xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx /resourceGroups/azshci /providers/Microsoft.KeyVault /vaults/xxxxxxxx ?api-version=2023-07-01 サブスクリプション ID リソース グループ名 リソース プロバイダー名 リソース名 API のバージョン
Copyright (C) ProGrive Consulting Co.,Ltd. All rights reserved. Microsoft Learn
では 20 GET/POST など エンドポイント パス
Copyright (C) ProGrive Consulting Co.,Ltd. All rights reserved. Azure Resource
Manager の意味 21 https://learn.microsoft.com/ja-jp/azure/azure-resource-manager/management/overview 結局はひとつのエンドポイント management.azure.com
Copyright (C) ProGrive Consulting Co.,Ltd. All rights reserved. Azure REST
API を使う
Copyright (C) ProGrive Consulting Co.,Ltd. All rights reserved. Azure REST
API を叩くためには 23 もちろん 認証 (authentication) が必要 なんかいろいろ用意して token endpoint に投げて、JWT もらってきて、、、 めんどい。。。 Azure で、かつ自分の RBAC での操作であれば簡単なコマンドがある Service principal とは別
Copyright (C) ProGrive Consulting Co.,Ltd. All rights reserved. Invoke-AzRestMethod 24
https://learn.microsoft.com/en-us/powershell/module/microsoft.powershell.utility/invoke-restmethod PS C:\Users\ikko> Invoke-AzRestMethod -Method GET -Path "/subscriptions/${subscriptionId}/resourceGroups/azshci/providers/Microsoft.KeyVault/vaults/${resourceName}?ap i-version=2023-07-01" StatusCode : 200 Content : { "id": "/subscriptions/xxxxxxxx-xxxx-xxxx-xxxx- xxxxxxxxxxxx/resourceGroups/azshci/providers/Microsoft.Key Vault/vaults/xxxxxxxx", "name": “xxxxxxxx", "type": "Microsoft.KeyVault/vaults", "location": "japaneast", "tags": {}, ... "properties": { "sku": { "family": "A", "name": "standard" }, "tenantId": “xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx",
Copyright (C) ProGrive Consulting Co.,Ltd. All rights reserved. Resource explorer
25 新旧ふたつの Resource explorer がある https://resources.azure.com/ (個別のページ) https://portal.azure.com/#view/HubsExtension/ArmExplorerBlade (Azure portal に統合されている) 古いほうであれば REST 要求を直接送れる (preview) と書いてあるのでちゃんとしたサポートは得られないかもしれない Azure portal ではできない操作ができる (NSG のルール名の変更とか)
Copyright (C) ProGrive Consulting Co.,Ltd. All rights reserved. property を直接変更することも可能
26 $Resource = Get-AzResource -ResourceType Microsoft.Web/sites -ResourceGroupName <group-name> ` -ResourceName <app-name> $Resource.Properties.publicNetworkAccess = 'Enabled' $Resource | Set-AzResource -Force az resource update --resource-group <group-name> --name <app-name> \ --set properties.publicNetworkAccess='Enabled' --resource-type 'Microsoft.Web/sites' https://zenn.dev/skmkzyk/articles/update-resource-property
Copyright (C) ProGrive Consulting Co.,Ltd. All rights reserved. Azure Resource
Graph
Copyright (C) ProGrive Consulting Co.,Ltd. All rights reserved. Azure portal
から REST API 以外にめっちゃ使ってる API がある 28 Azure Resource Graph いわゆる Graph query が叩けるもの Azure portal 上では、一覧系、N+1 問題になりそうなところに使われている Azure の概要ページの少し深いところで検索した一覧を出すときにも便利
Copyright (C) ProGrive Consulting Co.,Ltd. All rights reserved. Azure Key
Vault の一覧で Azure Resource Graph が使われている 29
Copyright (C) ProGrive Consulting Co.,Ltd. All rights reserved. 自分でたたく場合は Resource
Graph Explorer もしくは PowerShell から 30
Copyright (C) ProGrive Consulting Co.,Ltd. All rights reserved. もしくは PowerShell
から 31 Search-AzGraph -Query "resources|where type =~ 'Microsoft.KeyVault/vaults'" https://learn.microsoft.com/en-us/powershell/module/az.resourcegraph/search-azgraph
Copyright (C) ProGrive Consulting Co.,Ltd. All rights reserved. この query
は何でしょう 32 resources | where type =~ 'Microsoft.compute/virtualmachines' | extend bootDiagnostics = properties.diagnosticsProfile.bootDiagnostics.enabled | where bootDiagnostics == true Azure VM の診断設定が有効化されているものの一覧
Copyright (C) ProGrive Consulting Co.,Ltd. All rights reserved. まとめ
Copyright (C) ProGrive Consulting Co.,Ltd. All rights reserved. Azure REST
API を制する者は Azure を制する 34 該当する操作に対応する Azure PowerShell のコマンドがない 該当する操作に対応する Azure CLI のコマンドがない 該当する操作に対応する Azure portal のメニューがない 該当する操作に対応する Terraform の内容がない Invoke-AzRestMethod を使う az rest を使う Azure REST API を叩く AzAPI を使う https://speakerdeck.com/torumakabe/an-toazuretoterraform-2024xin-chun-baziyon
Copyright (C) ProGrive Consulting Co.,Ltd. All rights reserved. 勉強会とかイベントとか 35
◼ 技術書典 ⁻ オフライン開催:2024/11/03 (日) 11:00~17:00 ⁻ 現・元 Microsoft の有志でまた #AzureMixBook 出します!
Copyright (C) ProGrive Consulting Co.,Ltd. All rights reserved. おしながき 36
Copyright (C) ProGrive Consulting Co.,Ltd. All rights reserved. 37 会社名
株式会社プログライブコンサルティング [ProGrive Consulting Co., Ltd.] お問い合わせ
[email protected]
~ Expand Your Business ~ ~ビジネスの成長、新たな機会の追求、そして未来を切り開く~