(ChatGPT生成)

·

.NET Aspire で公式に提供されている Azure サービス統合一覧 (2025-05-01 時点)

カテゴリホスティング統合 API (builder.AddAzure*)主なサブリソース/特徴ステータス
データAddAzureStorageBlobs / Queues / Tables。Azurite エミュレータ & コンテナ対応GA (NET Aspire Azure Blob Storage integration – Learn Microsoft)
AddAzureCosmosDBSQL API データベース & Containers。Cosmos DB Emulator 対応GA (NET Aspire Azure Cosmos DB integration – Learn Microsoft)
AddAzureSqlServerAzure SQL Database。AddDatabase() が 9.2 で DB 自動生成に対応GA ([What’s new in .NET Aspire 9.2 – .NET Aspire
AddAzurePostgresFlexibleServerAzure Database for PostgreSQL – Flexible Server。AddDatabase() 対応GA ([What’s new in .NET Aspire 9.2 – .NET Aspire
AddAzureRedisAzure Cache for Redis。RunAsContainer() でローカル RedisGA (Aspire.Hosting.Azure.Redis 9.2.1 – NuGet)
AddAzureKeyVaultKey Vault をリソースとして追加。Secrets User 権限を既定で付与GA ([What’s new in .NET Aspire 9.2 – .NET Aspire
メッセージング/リアルタイムAddAzureServiceBusNamespaces, Queues, Topics, Subscriptions。エミュレータ対応GA (NET Aspire Azure Service Bus integration – Learn Microsoft)
AddAzureEventHubsEvent Hubs Namespace & Hubs。エミュレータ対応GA (ドキュメント API 一覧) ([DistributedApplicationBuilder Class (Aspire.Hosting)
AddAzureSignalRAzure SignalR Service。Serverless モード+エミュレータGA (What’s new in .NET Aspire 9.1 – Learn Microsoft)
AIAddAzureOpenAI (クライアント統合)Azure OpenAI Service への安全な接続 & 管理 ID 既定GA (9.1 で GA) (Aspire.Azure.AI.OpenAI 9.1.0-preview.1.25121.10 – NuGet)
Secrets / アイデンティティAddAzureKeyVaultKey Vault リソース & 最小権限ロール割当て APIGA ([What’s new in .NET Aspire 9.2 – .NET Aspire
コンピュート/インフラAddAzureContainerAppEnvironmentACA 環境を C# DSL で宣言 (9.2 新機能)GA ([What’s new in .NET Aspire 9.2 – .NET Aspire
サーバーレス (NEW)AddAzureFunctionsProjectAzure Functions プロジェクトを AppHost に組み込みPreview (初サポート) ([.NET Aspire Azure Functions integration (Preview) – .NET Aspire

注意: NuGet パッケージ名は Aspire.Hosting.Azure.<Service>、クライアント統合は Aspire.Azure.<Service> という命名規則が採用されています。


Azure Functions 統合 (Preview) のポイント

項目内容
パッケージAspire.Hosting.Azure.Functions (preview) ([.NET Aspire Azure Functions integration (Preview) – .NET Aspire
SDK 要件プロジェクトは .NET 8 / .NET 9 SDKIsolated Worker モデル 必須 ([.NET Aspire Azure Functions integration (Preview) – .NET Aspire
追加されるリソース型AzureFunctionsProjectResource – 他サービスから WithReference() で接続 ([.NET Aspire Azure Functions integration (Preview) – .NET Aspire
サポートされるトリガーHTTP、Timer、Blob、Queue、Service Bus、Event Hubs、Cosmos DB (一覧参照) ([.NET Aspire Azure Functions integration (Preview) – .NET Aspire
デバッグ / 実行dotnet run もしくは AppHost 起動で Functions・他サービス・ダッシュボードが一括起動
デプロイ現状 Azure Container Apps へのコンテナ発行のみ (KEDA スケールは未対応) ([.NET Aspire Azure Functions integration (Preview) – .NET Aspire
HTTP エンドポイント公開WithExternalHttpEndpoints() を呼ぶと外部アクセスを許可 ([.NET Aspire Azure Functions integration (Preview) – .NET Aspire
ホストストレージ既定で Functions 用 Storage を自動生成。変更する場合は WithHostStorage(storage) ([.NET Aspire Azure Functions integration (Preview) – .NET Aspire

最小サンプル

var builder = DistributedApplication.CreateBuilder(args);

// ストレージをエミュレータで
var storage = builder.AddAzureStorage("storage").RunAsEmulator();

// Functions プロジェクトを追加し Blob 参照を渡す
builder.AddAzureFunctionsProject<Projects.MyFunctions>("funcs")
       .WithHostStorage(storage)
       .WithReference(storage.AddBlobs("blobs"))
       .WithExternalHttpEndpoints();

builder.Build().Run();

従来バージョンとの違い・移行メモ

  1. .NET Aspire 8.x までは Functions を直接ホストできず、AppHost とは独立して開発・デプロイする必要がありました。
  2. 9.0 RC1 以降で **Functions が“プレビュー統合”**に追加され、VS/CLI のテンプレートに 「.NET Aspire Orchestrator Support」 チェックが出現します。これを有効にすると、Functions と ServiceDefaults / AppHost が自動生成され、ローカル‐クラウド移行がシームレスになります。 (.NET Aspire and Azure Functions integration preview – Visual Studio …)
  3. 現段階では トリガー種別・デプロイ先に制限 があるため、本番利用時は要検証。正式版リリース時に API 名や挙動が変わる可能性があります (ドキュメントに “subject to change” と明記)。 (.NET Aspire Azure Functions integration (Preview) – .NET Aspire | Microsoft Learn)

まとめ

  • .NET Aspire 9.2 までに 15 以上の Azure サービスが公式統合され、AddAzure* 1 行でリソース作成・ローカル実行・IaC 出力・Managed Identity 付与まで自動化できます。
  • Azure Functions は 2024-11 から Preview でサポート入り。クラウドネイティブな イベントドリブン / サーバーレス を Aspire のワークフローに統合できるようになりました。
  • 移行時は ステートレス設計最小権限ロール を意識しつつ、Preview 制約 (supported triggers, ACA コンテナ公開のみ 等) を確認してください。

ご参考になれば幸いです。

コメントを残す

メールアドレスが公開されることはありません。 が付いている欄は必須項目です