azure-ml-foundry-workspace について
Azure Machine Learning Workspace と Azure AI Foundry を扱うエンジニアや管理者向けの詳細なリファレンスです。ワークスペース構成、ネットワーク、コンピューティング、デプロイ、ID、CLI と PowerShell、Terraform、トラブルシューティングを扱います。
主な機能
- 01ワークスペース構成とネットワーク
- 02コンピューティングとエンドポイントのデプロイ
- 03ID、ストレージ、レジストリのガイド
- 04az ml CLI と PowerShell のリファレンス
- 05Terraform による構成ガイド
- 06ログ確認とトラブルシューティング
活用シーン
- 01ワークスペースのプライベートネットワークを計画
- 02トレーニングや推論向けのコンピューティングを選択
- 03オンラインまたはバッチのモデルエンドポイントをデプロイ
- 04Terraform でワークスペースのインフラを自動構成
インストール
コマンドをコピーしてターミナルで実行します。
npx skills add https:/ / github.com/ josiahsiegel/ claude-plugin-marketplace --skill azure-ml-foundry-workspaceインストール後、Claude Code で/azure-ml-foundry-workspaceを入力して読み込まれたか確認します。
同梱ファイル
SKILL.md と一緒にインストールされる参考資料やスクリプト。
references/cli-powershell.mdcompute.mdendpoints.mdidentities-acr-storage.mdnetworking.mdterraform.mdtroubleshooting.md詳細
Azure Machine Learning Workspace / Azure AI Foundry - 詳細な総合リファレンス
Azure Machine Learning Workspace(Azure AI Foundry)のあらゆる側面を網羅する包括的なリファレンスです。アーキテクチャ、ネットワーク、プライベートエンドポイント、コンピューティングクラスター、エンドポイントのデプロイ、マネージド ID、ACR の統合、ストレージアカウント、すべての CLI コマンドと PowerShell コマンド、ログの読み取り、デバッグ、Terraform との統合を扱います。
1. アーキテクチャと基本概念
ワークスペースのリソース階層
Azure Subscription
└── Resource Group
├── Azure ML Workspace (Microsoft.MachineLearningServices/workspaces)
│ ├── Dependent Resources (auto-created or BYO)
│ │ ├── Azure Storage Account (default datastore)
│ │ ├── Azure Key Vault (secrets, connection strings)
│ │ ├── Azure Application Insights (telemetry)
│ │ └── Azure Container Registry (Docker images for environments)
│ ├── Compute Targets
│ │ ├── Compute Instances (dev/test VMs)
│ │ ├── Compute Clusters (AmlCompute - training)
│ │ ├── Serverless Compute (on-demand)
│ │ ├── Kubernetes Compute (AKS / Arc-enabled)
│ │ └── Attached Compute (Databricks, HDInsight, VMs)
│ ├── Data Assets (versioned references to data)
│ ├── Datastores (connections to storage)
│ ├── Environments (Docker + conda specs)
│ ├── Models (registered trained models)
│ ├── Endpoints
│ │ ├── Managed Online Endpoints (real-time)
│ │ ├── Kubernetes Online Endpoints (BYO infra)
│ │ ├── Batch Endpoints (large-scale scoring)
│ │ └── Serverless Endpoints (MaaS - pay-per-token)
│ ├── Jobs (training runs, pipelines, sweeps)
│ ├── Components (reusable pipeline steps)
│ ├── Schedules (recurring job triggers)
│ └── Registries (cross-workspace sharing)
└── AI Foundry Hub (kind=hub) + Projects (kind=project)
AI Foundry Hub/プロジェクトとクラシックワークスペースの比較
| 機能 | クラシックワークスペース(kind=Default) | AI Foundry Hub + プロジェクト |
|---|---|---|
| ポータル | ml.azure.com | ai.azure.com |
| スコープ | 単一のワークスペース | Hub で複数のプロジェクト間でインフラを共有 |
| ネットワーク | ワークスペース単位 | Hub レベル(複数のプロジェクト間で共有) |
| ID | ワークスペース単位 | Hub レベルの ID をプロジェクトが継承 |
| モデルカタログ | あり | あり。さらに Foundry モデルを利用可能 |
| プロンプトフロー | あり | あり |
| AI エージェント | 限定的 | AI Agent Service のすべての機能 |
| ユースケース | 従来の ML、カスタムトレーニング | 生成 AI、LLM アプリ、AI エージェント |
ワークスペースの作成 — すべての方法
CLI:
# Install/upgrade ML extension
az extension add --name ml --upgrade
# Create resource group
az group create --name ml-rg --location eastus
# Create workspace with all dependencies auto-created
az ml workspace create \
--name my-ml-workspace \
--resource-group ml-rg \
--location eastus
# Create workspace with explicit dependencies
az ml workspace create \
--name my-ml-workspace \
--resource-group ml-rg \
--location eastus \
--storage-account /subscriptions/<sub>/resourceGroups/ml-rg/providers/Microsoft.Storage/storageAccounts/mlstorage \
--key-vault /subscriptions/<sub>/resourceGroups/ml-rg/providers/Microsoft.KeyVault/vaults/mlkeyvault \
--app-insights /subscriptions/<sub>/resourceGroups/ml-rg/providers/Microsoft.Insights/components/mlinsights \
--container-registry /subscriptions/<sub>/resourceGroups/ml-rg/providers/Microsoft.ContainerRegistry/registries/mlacr \
--public-network-access Disabled \
--managed-network AllowInternetOutbound \
--image-build-compute cpu-build-cluster \
--enable-data-isolation true \
--tags Environment=Production Team=DataScience
# Create AI Foundry Hub
az ml workspace create \
--name my-ai-hub \
--resource-group ml-rg \
--location eastus \
--kind hub \
--storage-account aihubstorage \
--key-vault aihubkeyvault
# Create AI Foundry Project within Hub
az ml workspace create \
--name my-ai-project \
--resource-group ml-rg \
--location eastus \
--kind project \
--hub-id /subscriptions/<sub>/resourceGroups/ml-rg/providers/Microsoft.MachineLearningServices/workspaces/my-ai-hub
# Show workspace details
az ml workspace show \
--name my-ml-workspace \
--resource-group ml-rg
# List all workspaces
az ml workspace list \
--resource-group ml-rg \
--output table
# Update workspace
az ml workspace update \
--name my-ml-workspace \
--resource-group ml-rg \
--description "Updated workspace" \
--public-network-access Disabled
# Delete workspace
az ml workspace delete \
--name my-ml-workspace \
--resource-group ml-rg \
--permanently-delete --all-resources
# Diagnose workspace configuration
az ml workspace diagnose \
--name my-ml-workspace \
--resource-group ml-rg
PowerShell(Az.MachineLearningServices):
# Install the module
Install-Module -Name Az.MachineLearningServices -Scope CurrentUser -Repository PSGallery -Force
# Create workspace
New-AzMLWorkspace `
-Name "my-ml-workspace" `
-ResourceGroupName "ml-rg" `
-Location "eastus" `
-StorageAccountId "/subscriptions/<sub>/resourceGroups/ml-rg/providers/Microsoft.Storage/storageAccounts/mlstorage" `
-KeyVaultId "/subscriptions/<sub>/resourceGroups/ml-rg/providers/Microsoft.KeyVault/vaults/mlkeyvault" `
-ApplicationInsightId "/subscriptions/<sub>/resourceGroups/ml-rg/providers/Microsoft.Insights/components/mlinsights" `
-IdentityType "SystemAssigned" `
-PublicNetworkAccess "Disabled"
# Get workspace
Get-AzMLWorkspace -Name "my-ml-workspace" -ResourceGroupName "ml-rg"
# List workspaces
Get-AzMLWorkspace -ResourceGroupName "ml-rg"
# Update workspace
Update-AzMLWorkspace `
-Name "my-ml-workspace" `
-ResourceGroupName "ml-rg" `
-Description "Updated workspace" `
-Tag @{Environment="Production"}
# Remove workspace
Remove-AzMLWorkspace -Name "my-ml-workspace" -ResourceGroupName "ml-rg"
# Diagnose workspace
Invoke-AzMLWorkspaceDiagnose -Name "my-ml-workspace" -ResourceGroupName "ml-rg"
2. ネットワーク
Azure ML は、3 種類のマネージドネットワーク分離モード(Disabled、AllowInternetOutbound、AllowOnlyApprovedOutbound)をサポートしています。本番環境ではマネージド VNet のアプローチが推奨されます。プライベートエンドポイントはインバウンド接続を提供し、アウトバウンドルールはコンピューティングリソースからの送信トラフィックを制御します。
主要な DNS ゾーン
| サービス | プライベート DNS ゾーン |
|---|---|
| ML ワークスペース API | privatelink.api.azureml.ms |
| ML ノートブック | privatelink.notebooks.azure.net |
| Storage Blob | privatelink.blob.core.windows.net |
| Storage File | privatelink.file.core.windows.net |
| Key Vault | privatelink.vaultcore.azure.net |
| Container Registry | privatelink.azurecr.io |
| Application Insights | privatelink.monitor.azure.com |
主要なサービス タグ
| サービス タグ | 用途 |
|---|---|
| AzureMachineLearning | ML ワークスペースの管理(インバウンド 44224、アウトバウンド 443) |
| BatchNodeManagement | コンピューティングクラスターの管理(インバウンド 29876-29877) |
| Storage | Azure Storage へのアクセス(アウトバウンド 443) |
| AzureActiveDirectory | 認証(アウトバウンド 443) |
VNet の設定、プライベートエンドポイントの構成、NSG ルール、アウトバウンドルールの管理について詳しくは、references/networking.md を参照してください。
3. コンピューティング
Azure ML では、複数のコンピューティングターゲットを利用できます。開発/テスト向けの Compute Instances、スケーラブルなトレーニング向けの AmlCompute Clusters、クラスター管理なしでオンデマンドのジョブを実行できる Serverless Compute、BYO インフラストラクチャのシナリオ向けの Kubernetes Compute です。
GPU VM SKU のクイックリファレンス
| VM シリーズ | GPU | GPU メモリ | 用途 |
|---|---|---|---|
| Standard_NC24ads_A100_v4 | 1x A100 | 80 GB | トレーニング、ファインチューニング |
| Standard_ND96amsr_A100_v4 | 8x A100 80GB | 640 GB | 大規模モデルのトレーニング |
| Standard_ND_H100_v5 | 8x H100 | 640 GB | 生成 AI、LLM トレーニング |
| Standard_ND_H200_v5 | 8x H200 | 1120 GB | 最新:H100 の 2 倍の性能 |
| Standard_NCads_H100_v5 | 1x H100 NVL | 94 GB | 推論、ファインチューニング |
| Standard_NC4as_T4_v3 | 1x T4 | 16 GB | 低コストの推論 |
GPU SKU の完全な一覧、コンピューティングインスタンス/クラスターの CLI リファレンス、Serverless Compute、Kubernetes の接続方法、デバッグコマンドについては、references/compute.md を参照してください。
4. エンドポイントのデプロイ
Azure ML は 4 種類のエンドポイントをサポートしています。ブルーグリーンデプロイでリアルタイム推論を行うのに推奨される Managed Online Endpoints、コンピューティングクラスターで大規模なスコアリングを行う Batch Endpoints、BYO AKS/Arc インフラストラクチャを利用する Kubernetes Online Endpoints、従量課金制のトークン単位の Model-as-a-Service を提供する Serverless Endpoints です。
エンドポイントタイプのクイックリファレンス
| タイプ | ユースケース | 認証モード | スケーリング |
|---|---|---|---|
| マネージドオンライン | リアルタイム推論 | key, aml_token | デプロイごとのインスタンス数 |
| バッチ | 大規模なスコアリング | マネージド ID | コンピューティングクラスターの自動スケーリング |
| Kubernetes オンライン | BYO インフラでのリアルタイム処理 | key, aml_token | K8s ポッドのスケーリング |
| サーバーレス(MaaS) | トークン単位の従量課金 LLM | key | 自動 |
エンドポイントの作成、デプロイ、トラフィック分割、ログ取得、バッチ呼び出しの全コマンドについては、references/endpoints.md を参照してください。
5-7. ID、ACR、ストレージ
マネージド ID(システム割り当てまたはユーザー割り当て)によって、ワークスペース、コンピューティング、エンドポイント、および依存リソース間のアクセスを制御します。ACR は環境とモデルサービング用の Docker イメージを保存します。プライベートエンドポイントを使用する場合は Premium SKU が必要であり、VNet 内にある場合はイメージビルド用のコンピューティングクラスターが必要です。ストレージアカウントは、Blob、ファイル共有、ジョブ出力、MLflow アーティファクト用の既定のデータストアとして機能します。
ID の種類
| ID の種類 | ユースケース |
|---|---|
| システム割り当て(ワークスペース) | 既定のワークスペース操作、自動ライフサイクル管理 |
| ユーザー割り当て(ワークスペース) | CMK 暗号化、リソース間での共有 |
| システム割り当て(コンピューティング) | クラスター単位のストレージ/ACR アクセス |
| ユーザー割り当て(コンピューティング) | きめ細かな再利用可能なアクセス制御 |
主な RBAC ロール
| ロール | 説明 |
|---|---|
| AzureML Data Scientist | ジョブの実行、コンピューティングの管理、モデルのデプロイ |
| AzureML Compute Operator | コンピューティングリソースの作成/管理 |
| Azure AI Developer | AI Foundry プロジェクトの開発 |
| Azure AI Inference Deployment Operator | エンドポイントへのモデルのデプロイ |
ID の完全な構成、ロール割り当てコマンド、ACR 統合、プライベート ACR の設定、データストアの登録、ストレージアカウントの詳細については、references/identities-acr-storage.md を参照してください。
8-9. CLI と PowerShell
az ml CLI 拡張機能では、ワークスペース、コンピューティング、ジョブ、モデル、エンドポイント、環境、データ、データストア、コンポーネント、スケジュール、レジストリ、接続を網羅する 20 以上のコマンドグループを通じて、包括的なワークスペース管理を行えます。Az.MachineLearningServices PowerShell モジュールでは、Windows ネイティブの自動化向けに同等の機能を提供します。
主な az ml コマンドグループ
| コマンドグループ | 目的 |
|---|---|
az ml workspace | ワークスペースの管理(作成、診断、ネットワークのプロビジョニング、アウトバウンドルール) |
az ml compute | コンピューティングの管理(作成、開始、停止、SSH 接続、アタッチ) |
az ml job | ジョブの管理(作成、ストリーミング、キャンセル、ダウンロード) |
az ml online-endpoint | オンラインエンドポイントの管理(作成、呼び出し、認証情報の取得) |
az ml online-deployment | デプロイの管理(作成、ログ取得、トラフィック) |
az ml batch-endpoint | バッチエンドポイントの管理(作成、呼び出し、ジョブ一覧表示) |
az ml serverless-endpoint | サーバーレスエンドポイントの管理(作成、認証情報の取得) |
コマンドの完全なリファレンス、ジョブ管理の詳細、スケジュール管理、PowerShell コマンドレットの完全なリファレンスについては、references/cli-powershell.md を参照してください。
10. TERRAFORM 統合
Azure ML ワークスペースは、azurerm プロバイダーを使用して Terraform で完全にプロビジョニングできます。本番環境のセットアップには、ワークスペース、VNet/サブネット、NSG、ストレージアカウント、キーコンテナー、ACR、Application Insights、プライベートエンドポイント、DNS ゾーン、コンピューティングクラスター、RBAC ロールの割り当てが含まれます。
主要な Terraform リソース
| リソース | 用途 |
|---|---|
azurerm_machine_learning_workspace | ML ワークスペース(Default、Hub、Project) |
azurerm_machine_learning_compute_cluster | AmlCompute トレーニングクラスター |
azurerm_machine_learning_compute_instance | 開発/テスト用コンピューティングインスタンス |
azurerm_machine_learning_workspace_network_outbound_rule_* | マネージドネットワークの送信ルール |
本番環境に対応した完全な Terraform 構成(プロバイダー、ネットワーク、ストレージ、キーコンテナー、ACR、ワークスペース、コンピューティング、ロールの割り当て、出力)については、references/terraform.md をご覧ください。
11. トラブルシューティングとデバッグ
Azure ML では、リアルタイムのジョブログのストリーミング、デプロイコンテナーのログ(推論サーバーとストレージ初期化ツール)、システムレベルの診断に使用するコンピューティングインスタンスへの SSH アクセス、履歴分析用の Log Analytics クエリ、構成検証用の az ml workspace diagnose コマンドなど、複数のデバッグ手段が用意されています。
よくあるエラーのカテゴリ
| カテゴリ | よくあるエラー |
|---|---|
| コンピューティング | QuotaExceeded、AllocationFailed、ディスク容量不足、GPU が検出されない |
| エンドポイント | ScoringError、HealthCheckFailure、ImageBuildFailed、429/503 エラー |
| ネットワーク | DNS 解決の失敗、接続タイムアウト、ストレージ/ACR へのアクセス拒否 |
| ジョブ | EnvironmentBuildError、OutOfMemoryError、NCCL タイムアウト、BLOB が見つからない |
エラーの完全な参照表、ログの場所、Log Analytics クエリ、エンドポイントのメトリック監視、ワークスペースの診断、セキュアなワークスペースのセットアップチェックリストについては、references/troubleshooting.md をご覧ください。
その他のリソース
トピックごとの詳細なリファレンスファイル:
- references/networking.md -- VNet、プライベートエンドポイント、DNS ゾーン、NSG ルール、サービスタグ
- references/compute.md -- GPU SKU、コンピューティングインスタンス、クラスター、サーバーレス、Kubernetes
- references/endpoints.md -- マネージドオンライン、バッチ、Kubernetes、サーバーレスのエンドポイント
- references/identities-acr-storage.md -- マネージド ID、ACR 統合、ストレージアカウント
- references/cli-powershell.md -- az ml CLI と PowerShell の完全なコマンドリファレンス
- references/terraform.md -- 本番環境に対応した完全な Terraform 構成
- references/troubleshooting.md -- ログの確認、デバッグ、エラー表、セットアップチェックリスト