You need to enable JavaScript to run this app.
优惠活动
大模型
产品
解决方案
定价
更多

.NET Aspire中Azure Blob Storage报错:缺少订阅配置

解决.NET Aspire运行Azure Blob Storage时「Missing subscription configuration」错误及Azurite未启动问题

问题根源

Aspire的Azure Storage组件默认优先尝试连接真实Azure云服务,不会自动启动本地Azurite模拟器,因此触发订阅配置缺失错误,且无Azurite容器创建。

修复步骤

修改AppHost项目中Program.cs代码,显式指定使用Azurite模拟器:

var builder = DistributedApplication.CreateBuilder(args);

var blobs = builder.AddAzureStorage("storage")
    .UseEmulator() // 强制启用本地Azurite模拟器
    .AddBlobs("blobs");

builder.Build().Run();

额外验证项

  • 确认Docker处于运行状态,Azurite依赖Docker启动本地容器
  • 检查项目已安装Aspire.Azure.Storage.Blobs NuGet包,若未安装可执行命令:dotnet add package Aspire.Azure.Storage.Blobs
  • 若仍有异常,可手动启动Azurite验证:执行docker run -p 10000:10000 -p 10001:10001 -p 10002:10002 mcr.microsoft.com/azure-storage/azurite,查看容器是否正常运行

内容的提问来源于stack exchange,提问作者Regestea

相关产品推荐
方舟 Agent Plan

超全模态模型 × Harness 升级,最新支持 Deepseek-V4.1-Flash、GLM-5.3 系列、Doubao-Seedream-5.0-pro、Kimi-K3 (部分), 限时 9.9 元起

最近更新时间:2026.06.22 06:54:51