Azure PaaS サービス視点で見る .NET Aspire 統合マップ(2025-05-01 時点)
ポイント
- PaaS = “プラットフォームとしてのサービス” なので OS/クラスタ管理はすべて Azure 側。
- .NET Aspire は
builder.AddAzure*()
1 行で (1) ローカル用コンテナ/エミュレータ起動 → (2) IaC/Bicep 出力 → (3) クラウド配置 (azd / GitHub Actions) までカバーする “配線レイヤー” を担います。- 以下では サービスそのものの特性 と Aspire 側の提供範囲 (GA / Preview) をセットで整理します。
カテゴリ | Azure PaaS サービス (正式名称) | 代表的なプラン/スケール | サービス概要・主要ユースケース | .NET Aspire サポート状況 |
---|---|---|---|---|
Compute / Serverless | Azure Container Apps | Consumption / Dedicated Workload Profiles – KEDA によるイベント & CPU/メモリ自動スケール | 100% コンテナ指向のマネージド実行基盤。マルチレプリカ+ゼロスケール。マイクロサービスやバックエンド API を“クラスタ意識ゼロ”で実行 | PublishAsAzureContainerApp() で GA。AppHost/Project/Executable いずれも対応 (Deploy .NET Aspire projects to Azure Container Apps – Learn Microsoft, Configure Azure Container Apps environments – .NET Aspire) |
Azure Functions | Consumption / Premium / App Service – HTTP・キュー・Timer 等イベントで起動、課金は実行時間単位 | イベント駆動のサーバーレス関数。スケールアウトとゼロスケールが自動 | AddAzureFunctionsProject() で Preview(.NET 8/9 Isolated 必須、現状 ACA デプロイのみ) (NET Aspire Azure Functions integration (Preview) – Learn Microsoft, Aspire.Hosting.Azure.Functions 9.2.1-preview.1.25222.1 – NuGet) | |
Data (ストレージ & DB) | Azure Storage (Blobs / Queues / Tables) | LRS / GRS / RA-GRS、アクセス階層 Hot–Cool–Archive | 汎用オブジェクトストレージ。静的サイト/メッセージキュー/簡易 NoSQL 等に | AddAzureStorage() GA(Blobs/Queues/Tables 各リソースを子として生成可) (NET Aspire Azure Blob Storage integration – Learn Microsoft, Aspire.Hosting.Azure.Storage 9.2.1 – NuGet) |
Azure Cosmos DB (SQL API) | Serverless / Provisioned Throughput – グローバル分散・マルチマスター | 低レイテンシ地理分散 NoSQL。IoT/リアルタイム分析 | AddAzureCosmosDB() GA(エミュレータ対応、子コンテナ自動起動可) (NET Aspire Azure Cosmos DB integration – Learn Microsoft) | |
Azure SQL Database | DTU / vCore / Serverless – 99.995 % SLA、自動バックアップ | フルマネージド RDBMS。既存オンプレ SQL Server 資産のクラウド移行 | AddAzureSqlServer() → .AddDatabase() GA(SQL Server Container or PaaS DB を選択してデプロイ) (NET Aspire SQL Server integration – Learn Microsoft) | |
Azure Database for PostgreSQL – Flexible Server | Burstable / General Purpose / Memory Optimized – 99.99 % SLA、ゾーン冗長 | OSS PostgreSQL 互換のマネージド DB。エンタープライズ ERP など | AddAzurePostgresFlexibleServer() GA(Postgres コンテナ or PaaS DB) (NET Aspire Azure PostgreSQL integration – Learn Microsoft) | |
Azure Cache for Redis | Basic / Standard / Premium / Enterprise – sub-ms レイテンシ | 分散キャッシュ・セッションストア。AI RAG のベクトルキャッシュ用途にも | AddAzureRedis() GA(ローカルは Redis / Valkey / Garnet コンテナ選択可) (NET Aspire Azure Cache for Redis integration – Learn Microsoft) | |
Messaging / Streaming / Realtime | Azure Service Bus | Basic / Standard / Premium – キュー & トピック、トランザクション | エンタープライズメッセージング (注文処理、イベント駆動) | AddAzureServiceBus() GA(名前空間 & キュー/トピック子リソース) (NET Aspire Azure Service Bus integration – Learn Microsoft) |
Azure Event Hubs | Standard / Dedicated / Premium – 最大 20 MB/s Ingress | ビッグデータストリーミング/テレメトリ集約 | AddAzureEventHubs() GA(子ハブ生成) (NET Aspire Azure integrations overview – Learn Microsoft) | |
Azure SignalR Service | Free / Standard / Premium – WebSocket ≒ >100K 同時接続 | リアルタイム Push (チャット・ダッシュボード) | AddAzureSignalR() GA(サーバーレス/クラシック両モード) (AzureSignalRExtensions.AddAzureSignalR Method (Aspire.Hosting)) | |
Secrets / ID | Azure Key Vault | Standard / Premium – HSM/ソフトウェア キー、RBAC & MS Entra 連携 | シークレット・証明書・キーの安全保管。CI/CD 連携も容易 | AddAzureKeyVault() GA(Managed Identity 付与を自動化) (NET Aspire Azure Key Vault integration – Learn Microsoft) |
AI | Azure OpenAI Service | Provisioned Throughput / PAYG Tokens – GPT-4o, GPT-4-32K 等 | LLM 推論 API。チャット/RAG/Agent 実装 | AddAzureOpenAI() Preview (Client Only) – DI で OpenAIClient を注入。ホスティングリソース作成は不要 (NET Aspire Azure OpenAI integration (Preview) – Learn Microsoft) |
サービス階層をどう使い分けるか
シナリオ | 推奨 PaaS (+ Aspire 呼び出し) | 補足 |
---|---|---|
スケーラブル Web API | Azure Container Apps PublishAsAzureContainerApp() | Functions より長時間・接続維持が必要な場合 |
イベント駆動タスク | Azure Functions AddAzureFunctionsProject() | Consumption でゼロスケール課金/DLQ は Service Bus へ |
グローバル NoSQL | Cosmos DB AddAzureCosmosDB() | マルチリージョン自動リプリケーション |
低レイテンシ キャッシュ | Azure Cache for Redis AddAzureRedis() | Db レイヤの負荷削減/RAG ベクトルストア |
トランザクションメッセージ | Service Bus AddAzureServiceBus() | Transactional API で Exactly-Once 保証 |
大規模テレメトリ | Event Hubs AddAzureEventHubs() | AKS/IoT デバイス→ ADLS Gen-2 経由で分析 |
シークレット管理 | Key Vault AddAzureKeyVault() | Aspire が環境変数注入を自動化・ローテーション対応 |
現状 Preview 機能の注意点
- Azure Functions 統合 は 2025 Q1 GA 予定(公式ロードマップ)で、
- デプロイターゲットは Azure Container Apps 限定。App Service への直接発行は CLI/SWA テンプレートで補完する想定です。
- トリガー全種はサポート済だが、Durable Functions は次期リリース対象。 (NET Aspire Azure Functions integration (Preview) – Learn Microsoft)
- Azure OpenAI は ホスティング不要 な API クライアント統合のみ。リソース自動プロビジョンは行われないため、先に Portal/az CLI で作成したリソースの Endpoint / Deployment 名 を設定してください。 (NET Aspire Azure OpenAI integration (Preview) – Learn Microsoft)
まとめ
- PaaS サービスの強み (自動スケール・SLA・マネージド保守) と .NET Aspire の自動配線 が合わさることで、従来の “インフラを構築してからコードを書く” 作業はほぼ不要になります。
- Compute 層は Container Apps と Functions の 2 本柱。ステートフル or 長時間接続が要る場合は前者、純イベント処理なら後者。
- Data / Messaging / Secrets は Aspire が Managed Identity を暗黙設定 → ソース管理に接続文字列が残らない構成がデフォルト。
- Preview の機能は将来 API 変更の可能性があるため、本番導入時は ターゲットバージョンを固定し、リリースノートを確認してください。
これで PaaS レイヤーの鳥瞰図と .NET Aspire が提供する統合範囲を俯瞰できます。今後の設計・検証の際にお役立てください。
コメントを残す