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
370
0
Share
GitHub Copilot CLI で Azure Portal to Bicep
第59回 Tokyo Jazug Night
https://jazug.connpass.com/event/384470/
Yuta Matsumura
March 23, 2026
More Decks by Yuta Matsumura
See All by Yuta Matsumura
エージェントスキルを作って自分のインプットに役立てよう
tsubakimoto_s
0
450
やさしいとこから始めるGitHubリポジトリのセキュリティ
tsubakimoto_s
3
2.3k
使って学ぼう MCP (と GitHub Codespaces)
tsubakimoto_s
1
280
GitHub Copilot CLI を使いやすくしよう
tsubakimoto_s
1
360
AspireとGitHub Modelsで作るお手軽AIアプリ
tsubakimoto_s
0
96
Memories of GitHub Universe & San Francisco
tsubakimoto_s
0
73
私のMCPの使い方
tsubakimoto_s
0
190
これからはじめる Model Context Protocol
tsubakimoto_s
0
94
Cloudflare の MCP サーバーをためしてみた
tsubakimoto_s
1
360
Other Decks in Technology
See All in Technology
Scovilleモバイルエンジニア募集中.pdf
julienrudin
0
110
Choose your own adventure in agentic design patterns
glaforge
0
150
AWS Agent Registry の基礎・概要を理解する/aws-agent-registry-intro
ren8k
3
410
Anthropic「Long-running a gents」をGeminiで再現してみた
tkikuchi
0
500
20260423_執筆の工夫と裏側 技術書の企画から刊行まで / From the planning to the publication of technical book
nash_efp
3
560
国内外の生成AIセキュリティの最新動向 & AIガードレール製品「chakoshi」のご紹介 / Latest Trends in Generative AI Security (Domestic & International) & Introduction to AI Guardrail Product "chakoshi"
nttcom
4
1.5k
独断と偏見で試してみる、 シングル or マルチエージェント どっちがいいの?
shichijoyuhi
1
160
[OpsJAWS 40]リリースしたら終わり、じゃなかった。セキュリティ空白期間をAWS Security Agentで埋める
sh_fk2
3
250
Arcana: Production-Ready RAG in Elixir @ ElixirConf EU 2026
georgeguimaraes
0
110
Pure Intonation on Browser: Building a Sequencer with Ruby
nagachika
0
160
The Journey of Box Building
tagomoris
4
3.6k
弁護士ドットコム株式会社 エンジニア職向け 会社紹介資料
bengo4com
1
180
Featured
See All Featured
The browser strikes back
jonoalderson
0
990
SEO in 2025: How to Prepare for the Future of Search
ipullrank
3
3.4k
How Software Deployment tools have changed in the past 20 years
geshan
0
33k
Digital Projects Gone Horribly Wrong (And the UX Pros Who Still Save the Day) - Dean Schuster
uxyall
0
1.2k
The untapped power of vector embeddings
frankvandijk
2
1.7k
Joys of Absence: A Defence of Solitary Play
codingconduct
1
350
SERP Conf. Vienna - Web Accessibility: Optimizing for Inclusivity and SEO
sarafernandez
2
1.4k
Designing for Performance
lara
611
70k
Digital Ethics as a Driver of Design Innovation
axbom
PRO
1
270
Visualization
eitanlees
150
17k
WENDY [Excerpt]
tessaabrams
10
37k
Breaking role norms: Why Content Design is so much more than writing copy - Taylor Woolridge
uxyall
0
260
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