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
GitHub Copilot CLI で Azure Portal to Bicep
Search
Yuta Matsumura
March 23, 2026
Technology
0
36
GitHub Copilot CLI で Azure Portal to Bicep
第59回 Tokyo Jazug Night
https://jazug.connpass.com/event/384470/
Yuta Matsumura
March 23, 2026
Tweet
Share
More Decks by Yuta Matsumura
See All by Yuta Matsumura
使って学ぼう MCP (と GitHub Codespaces)
tsubakimoto_s
1
250
GitHub Copilot CLI を使いやすくしよう
tsubakimoto_s
0
280
AspireとGitHub Modelsで作るお手軽AIアプリ
tsubakimoto_s
0
79
Memories of GitHub Universe & San Francisco
tsubakimoto_s
0
65
私のMCPの使い方
tsubakimoto_s
0
180
これからはじめる Model Context Protocol
tsubakimoto_s
0
82
Cloudflare の MCP サーバーをためしてみた
tsubakimoto_s
1
250
re:Invent の裏でアップデートされていた .NET Aspire で統合するAWS のクラウドリソース
tsubakimoto_s
1
150
.NET AspireでAzure Functionsやクラウドリソースを統合する
tsubakimoto_s
0
360
Other Decks in Technology
See All in Technology
Kiroで見直す開発プロセスとAI-DLC
k_adachi_01
0
100
【社内勉強会】新年度からコーディングエージェントを使いこなす - 構造と制約で引き出すClaude Codeの実践知
nwiizo
1
440
VPCエンドポイント意外とお金かかるなぁ。せや、共有したろ!
tommy0124
1
710
わからなくて良いなら、わからなきゃだめなの?
kotaoue
1
370
A Casual Introduction to RISC-V
omasanori
0
460
会社紹介資料 / Sansan Company Profile
sansan33
PRO
16
410k
僕、S3 シンプルって名前だけど全然シンプルじゃありません よろしくお願いします
yama3133
1
230
Claude Code 2026年 最新アップデート
oikon48
14
11k
Zeal of the Convert: Taming Shai-Hulud with AI
ramimac
0
160
形式手法特論:SMT ソルバで解く認可ポリシの静的解析 #kernelvm / Kernel VM Study Tsukuba No3
ytaka23
1
660
Go 1.26 Genericsにおける再帰的型制約 / Recursive Type Constraints in Go 1.26 Generics
ryokotmng
0
140
Everything Claude Code を眺める
oikon48
13
8.4k
Featured
See All Featured
実際に使うSQLの書き方 徹底解説 / pgcon21j-tutorial
soudai
PRO
199
73k
What Being in a Rock Band Can Teach Us About Real World SEO
427marketing
0
200
Let's Do A Bunch of Simple Stuff to Make Websites Faster
chriscoyier
508
140k
Embracing the Ebb and Flow
colly
88
5k
Dealing with People You Can't Stand - Big Design 2015
cassininazir
367
27k
Navigating the Design Leadership Dip - Product Design Week Design Leaders+ Conference 2024
apolaine
0
240
Lightning talk: Run Django tests with GitHub Actions
sabderemane
0
150
Prompt Engineering for Job Search
mfonobong
0
200
Stewardship and Sustainability of Urban and Community Forests
pwiseman
0
150
Visualizing Your Data: Incorporating Mongo into Loggly Infrastructure
mongodb
49
9.9k
The Straight Up "How To Draw Better" Workshop
denniskardys
239
140k
jQuery: Nuts, Bolts and Bling
dougneiner
65
8.4k
Transcript
GitHub Copilot CLI で Azure Portal to Bicep 2026/03/23 Tokyo
JAZUG Night Yuta Matsumura © 2026 Yuta Matsumura. #jazug 1
松村 優大 (MLBお兄さん) © 2026 Yuta Matsumura. #jazug 株式会社オルターブース (Chief
Technical Architect) Microsoft MVP for Developer Technologies Microsoft Top Partner Engineer Award 2025 GitHub 公認トレーナー C#, PHP, Azure, GitHub #fukuten #devblogradio #fukuoka_mcp https://linktr.ee/tsubakimoto 2
© 2026 Yuta Matsumura. #jazug 3 4/17 Global Azure @福岡を
開催します! 登壇者・参加者を募集中です! https://jazug.connpass.com/event/384711/
明日 Microsoft AI Tour に参加される方 朝は早いけど楽しみましょう! © 2026 Yuta Matsumura.
#jazug 4
コーディングアシスタントを使っていますか? GitHub Copilot などのコーディングアシスタントを使った開発の敷居が 下がると、色んな個人アプリや社内アプリを作ってみたくなるものです。 私は最近どうしているかというと・・・ アプリ:AI を使って開発 インフラ:IaC も用意しようと思いつつ、とりあえずポータルで作る
© 2026 Yuta Matsumura. #jazug 5
Bicep テンプレートを書く 1. ゼロから書く 2. ポータルで作ったリソースの テンプレートをエクスポート © 2026 Yuta
Matsumura. #jazug 6
Bicep テンプレートを書く 1. ゼロから書く 2. ポータルで作ったリソースの テンプレートをエクスポート 3. GitHub Copilot
で 真似る © 2026 Yuta Matsumura. #jazug 7
使うもの • GitHub Copilot • GitHub Copilot CLI • Azure
CLI • Microsoft Learn MCP Server • (Azure MCP Server) © 2026 Yuta Matsumura. #jazug 8
GitHub Copilot CLI • GitHub Copilot のコマンドラインツール `copilot` • Visual
Studio Code の Copilot でできることは大抵できる • おすすめの使い方は • Markdown 文章の生成 (素の Markdown が生成) • 他のコマンドライン結果を Copilot に渡す copilot -p "1行コミットメッセージを生成して: $(git diff --cached)" © 2026 Yuta Matsumura. #jazug 10
// All platforms npm install -g @github/copilot // Windows winget
install GitHub.Copilot // macOS and Linux brew install copilot-cli // Install script (macOS and Linux) curl -fsSL https://gh.io/copilot-install | bash © 2026 Yuta Matsumura. #jazug 11 インストール方法
© 2026 Yuta Matsumura. #jazug 12 MCP サーバー登録
デモ 右のような構成の リソースグループを 例とします © 2026 Yuta Matsumura. #jazug 13
以下の内容でBicepに関するタスクを実施してください。 1. 指定のリソースのBicepテンプレートを取得して作業フォルダに保存して - 対象のリソースグループ: `rg-jazug` - 作業フォルダ: `rg-jazug-bicep` 2.
別リソースグループにデプロイできるように作業フォルダ内のテンプレートをパラメーター化して 3. リソースプレフィックスは推奨される省略形を使用すること - 参照: https://learn.microsoft.com/... 4. テンプレートの構成とAzure CLI(PowerShell)でのデプロイ手順を作業フォルダの `README.md` に 記載して 5. Bicepテンプレートのエラーを修正して、正常にデプロイできるようにして © 2026 Yuta Matsumura. #jazug 14
以下の内容でBicepに関するタスクを実施してください。 1. 指定のリソースのBicepテンプレートを取得して作業フォルダに保存して - 対象のリソースグループ: `rg-jazug` - 作業フォルダ: `rg-jazug-bicep` 2.
別リソースグループにデプロイできるように作業フォルダ内のテンプレートをパラメーター化して 3. リソースプレフィックスは推奨される省略形を使用すること - 参照: https://learn.microsoft.com/... 4. テンプレートの構成とAzure CLI(PowerShell)でのデプロイ手順を作業フォルダの `README.md` に 記載して 5. Bicepテンプレートのエラーを修正して、正常にデプロイできるようにして © 2026 Yuta Matsumura. #jazug 15 Azure CLI Microsoft Learn MCP Server
Microsoft Learn MCP Server • learn.microsoft.com に対して検索ができる • 3つのツールが利用可能 ©
2026 Yuta Matsumura. #jazug 16 ツール名 用途 microsoft_docs_search ページ検索 microsoft_docs_fetch ページを Markdown 形式に変換 microsoft_code_sample_search コードサンプル検索 (言語指定可)
◐ Let me analyze the task: 1. Get Bicep templates
from resource group `rg-jazug` … 2. Parameterize the templates for deployment … 3. Use recommended resource prefixes/abbreviations 4. Create README.md with template structure and Azure CLI … 5. Fix any Bicep template errors Let me start by: 1. Checking Azure subscription and resource group 2. Getting the resource group contents 3. Exporting Bicep templates 4. Creating the working folder structure © 2026 Yuta Matsumura. #jazug 17 タスクの計画
• List Azure Subscriptions └ {"status":200,"message":"Success","results ... } • Check
rg-jazug resource group $ az group show --name rg-jazug ... 2>&1 └ 5 lines... • List resources in rg-jazug $ az resource list --resource-group rg-jazug ... └ 10 lines... © 2026 Yuta Matsumura. #jazug 18 Azure CLI でリソース取得
◐ I can see the resources in `rg-jazug`: 1. `plan-yuta-jazug`
- App Service Plan 2. `vnet-yuta-jazug` - Virtual Network 3. `privatelink.postgres.database.azure.com` - Privat 4. `appi-yuta-jazug` - Application Insights 5. `app-yuta-jazug` - App Service (Web App) 6. `psql-yuta-jazug` - PostgreSQL Flexible Server 7. `privatelink.postgres.database.azure.com/link-2sww - Private DNS Zone VNet Link © 2026 Yuta Matsumura. #jazug 19 出力対象リソースの確認
• Create working folder and export ARM template $ New-Item
-ItemType Directory -Path "..." -Force | Out-Null az group export --name rg-jazug ... 2>&1 | Out-File "...¥template.json" -Encoding utf8 Write-Host "Done" └ 1 line... © 2026 Yuta Matsumura. #jazug 20 テンプレートの出力
• Decompile ARM template to Bicep $ az bicep decompile
--file "...¥template.json" 2>&1 └ 4 lines... • Check exported template content $ Get-Content "...¥template.json" -First 5 └ 6 lines... ◐ The export added warnings/errors to the beginning of the JSON file. I need to re-export and redirect only the actual JSON output (not stderr). Let me do this differently. © 2026 Yuta Matsumura. #jazug 21 Bicep の作成や検証
• デコンパイルにエラーがあるため、各リソースの設定を取得して手動でクリーンなBicep テンプレートを作成します。 • Get VNet details $ az network
vnet show -g rg-jazug -n vnet-yuta-jazug -o json 2>&1 └ 72 lines... • Get App Service Plan details $ az appservice plan show -g rg-jazug -n plan-yuta-jazug -o json 2>&1 └ 77 lines... © 2026 Yuta Matsumura. #jazug 22 Bicep のエラー修正
© 2026 Yuta Matsumura. #jazug 23
© 2026 Yuta Matsumura. #jazug 24 オリジナル (ポータルで作成) オリジナル (ポータルで作成)
Bicep をデプロイして構築 Bicep をデプロイして構築
2つのリソースグループを比較し、構成や設定の違いを表形式でまとめてください。 - Resource Group: rg-jazug - Resource Group: rg-jazug-dev ©
2026 Yuta Matsumura. #jazug 25
© 2026 Yuta Matsumura. #jazug 26
© 2026 Yuta Matsumura. #jazug 27
© 2026 Yuta Matsumura. #jazug 28
なぜ Copilot CLI でやるのか VS Code の GitHub Copilot Chat
でも同様の作業は可能です。 しかし出力内容のコピーがしづらく、 Markdown がレンダリングされ、プ レーンテキストで扱えないことが 煩わしいこともたまにあります・・・ © 2026 Yuta Matsumura. #jazug 29
個人的な工夫 >リソースプレフィックスは推奨される省略形を使用すること 1. 該当のドキュメントを指定し、Web 検索で情報取得 2. 目的の処理を実行する Agent Skills を利用する
3. 目的の処理を実行する Agent Skills を自作する © 2026 Yuta Matsumura. #jazug 30
Agent Skills Agent Skills とは、エージェントに能力と専門知識を与えるため仕組み。 SKILL.md やスクリプトファイルを用意し、タスクの実行を支援する。 https://agentskills.io skill-creator (anthropics/skills)
を使い、 リソースの推奨プレフィックスのスキルを自作しました。 azure-resource-abbreviations (tsubakimoto/skills) © 2026 Yuta Matsumura. #jazug 31
後日談 (未検証) Azure のスキル (microsoft/azure-skills) が最近公開されましたが、 別の Azure スキルにリソースの推奨プレフィックスがありました。 azure-cloud-adoption-framework
(MicrosoftDocs/Agent-Skills) © 2026 Yuta Matsumura. #jazug 32 ※公開するなら1箇所にまとめてほしい・・・
まとめ • CLI のほうが向いている作業・環境もあります • IaC も AI パワーで作っていくことができます •
Azure ポータル (GUI) で作ったリソースから、ベースとなる Bicep を 生成できますが、完全コピーではないため確認必須です © 2026 Yuta Matsumura. #jazug 33
ご清聴ありがとうございました © 2026 Yuta Matsumura. #jazug 34