!Docker Pulls !Docker Stars
请注意:Azure App Configuration模拟器是非***的,且未获得微软认可。
shelldocker pull tnc1997/azure-app-configuration-emulator docker run -p 8080:8080 tnc1997/azure-app-configuration-emulator
模拟器支持HMAC认证和Microsoft Entra ID认证。
可通过环境变量Authentication__Schemes__Hmac__Credential和Authentication__Schemes__Hmac__Secret分别覆盖凭证和密钥。
yamlservices: azure-app-configuration-emulator: environment: - Authentication__Schemes__Hmac__Credential=xyz - Authentication__Schemes__Hmac__Secret=c2VjcmV0 image: tnc1997/azure-app-configuration-emulator
客户端可使用模拟器的连接字符串进行请求认证。
csharpusing Azure.Data.AppConfiguration; var connectionString = Environment.GetEnvironmentVariable("ConnectionStrings__AzureAppConfiguration"); var client = new ConfigurationClient(connectionString); var setting = new ConfigurationSetting("AzureAppConfigurationEmulator", "Hello World"); await client.SetConfigurationSettingAsync(setting);
yamlservices: azure-app-configuration-emulator: image: tnc1997/azure-app-configuration-emulator console-application: build: context: . dockerfile: ./ConsoleApplication/Dockerfile depends_on: - azure-app-configuration-emulator environment: - ConnectionStrings__AzureAppConfiguration=Endpoint=[***]
可使用以下脚本生成认证相关头信息:
javascriptconst credential = "abcd"; const secret = "c2VjcmV0"; const date = new Date().toUTCString(); const contentHash = ***JS.SHA256(***JS.enc.Utf8.parse(pm.request.body.toString())).toString(***JS.enc.Base64); const signedHeaders = "x-ms-date;Host;x-ms-content-sha256"; const stringToSign = `${pm.reques***thod}\n${pm.request.url.getPathWithQuery()}\n${date};${pm.request.url.getRemote()};${contentHash}`; const signature = ***JS.HmacSHA256(***JS.enc.Utf8.parse(stringToSign), ***JS.enc.Base64.parse(secret)).toString(***JS.enc.Base64); pm.request.headers.upsert(`x-ms-date: ${date}`); pm.request.headers.upsert(`x-ms-content-sha256: ${contentHash}`); pm.request.headers.upsert(`Authorization: HMAC-SHA256 Credential=${credential}&SignedHeaders=${signedHeaders}&Signature=${signature}`);
Microsoft Entra ID认证允许使用托管标识模拟基于Azure的生产环境。
Assumed Identity是一个简单的测试替身,模拟Azure实例元数据服务(IMDS)处理托管标识令牌的方式。
必须通过环境变量Authentication__Schemes__MicrosoftEntraId__MetadataAddress设置元数据地址。
yamlservices: assumed-identity: image: nagyesta/assumed-identity azure-app-configuration-emulator: depends_on: - assumed-identity environment: - ASPNETCORE_HTTP_PORTS=8080 - ASPNETCORE_HTTPS_PORTS=8081 - Authentication__Schemes__MicrosoftEntraId__MetadataAddress=[***] - Authentication__Schemes__MicrosoftEntraId__RequireHttpsMetadata=false - Kestrel__Certificates__Default__Path=/usr/local/share/azureappconfigurationemulator/emulator.crt - Kestrel__Certificates__Default__KeyPath=/usr/local/share/azureappconfigurationemulator/emulator.key image: tnc1997/azure-app-configuration-emulator volumes: - ./emulator.crt:/usr/local/share/azureappconfigurationemulator/emulator.crt:ro - ./emulator.key:/usr/local/share/azureappconfigurationemulator/emulator.key:ro
客户端可使用托管标识进行请求认证。
csharpusing Azure.Data.AppConfiguration; using Azure.Identity; var endpoint = Environment.GetEnvironmentVariable("Endpoints__AzureAppConfiguration"); var credential = new ManagedIdentityCredential(); var client = new ConfigurationClient(new Uri(endpoint), credential); var setting = new ConfigurationSetting("AzureAppConfigurationEmulator", "Hello World"); await client.SetConfigurationSettingAsync(setting);
yamlservices: assumed-identity: image: nagyesta/assumed-identity azure-app-configuration-emulator: depends_on: - assumed-identity environment: - ASPNETCORE_HTTP_PORTS=8080 - ASPNETCORE_HTTPS_PORTS=8081 - Authentication__Schemes__MicrosoftEntraId__MetadataAddress=[***] - Authentication__Schemes__MicrosoftEntraId__RequireHttpsMetadata=false - Kestrel__Certificates__Default__Path=/usr/local/share/azureappconfigurationemulator/emulator.crt - Kestrel__Certificates__Default__KeyPath=/usr/local/share/azureappconfigurationemulator/emulator.key image: tnc1997/azure-app-configuration-emulator volumes: - ./emulator.crt:/usr/local/share/azureappconfigurationemulator/emulator.crt:ro - ./emulator.key:/usr/local/share/azureappconfigurationemulator/emulator.key:ro console-application: build: context: . dockerfile: ./ConsoleApplication/Dockerfile depends_on: - assumed-identity - azure-app-configuration-emulator entrypoint: /bin/sh -c "update-ca-certificates && dotnet ConsoleApplication.dll" environment: - Endpoints__AzureAppConfiguration=[***] volumes: - ./emulator.crt:/usr/local/share/ca-certificates/emulator.crt:ro
模拟器兼容以下操作:
| 操作 | |
|---|---|
| 获取 | ✔️ |
| 条件获取 | ✔️ |
| 选择字段获取 | ✔️ |
| 基于时间访问获取 | ✔️ |
| 列出 | ✔️ |
| 分页列出 | ❌ |
| 筛选列出 | ✔️ |
| 选择字段列出 | ✔️ |
| 基于时间访问列出 | ✔️ |
| 设置 | ✔️ |
| 条件设置 | ✔️ |
| 删除 | ✔️ |
| 条件删除 | ✔️ |
| 操作 | |
|---|---|
| 列出 | ✔️ |
| 分页列出 | ❌ |
| 筛选列出 | ✔️ |
| 选择字段列出 | ✔️ |
| 基于时间访问列出 | ✔️ |
| 操作 | |
|---|---|
| 列出 | ✔️ |
| 分页列出 | ❌ |
| 筛选列出 | ✔️ |
| 选择字段列出 | ✔️ |
| 基于时间访问列出 | ✔️ |
| 操作 | |
|---|---|
| 锁定 | ✔️ |
| 条件锁定 | ✔️ |
| 解锁 | ✔️ |
| 条件解锁 | ✔️ |
| 操作 | |
|---|---|
| 列出 | ❌ |
| 分页列出 | ❌ |
| 范围列出 | ❌ |
| 筛选列出 | ❌ |
| 选择字段列出 | ❌ |
| 基于时间访问列出 | ❌ |
模拟器使用SQLite数据库存储配置设置。
可通过卷实现会话间数据持久化:
yamlservices: azure-app-configuration-emulator: image: tnc1997/azure-app-configuration-emulator volumes: - azure-app-configuration-emulator:/var/lib/azureappconfigurationemulator volumes: azure-app-configuration-emulator:
可通过环境变量ConnectionStrings__DefaultConnection覆盖数据库连接字符串:
yamlservices: azure-app-configuration-emulator: environment: - ConnectionStrings__DefaultConnection=Data Source=/var/lib/azureappconfigurationemulator/emulator.db image: tnc1997/azure-app-configuration-emulator
可将预填充数据的数据库挂载到容器,但需确保数据库具有所需架构:
yamlservices: azure-app-configuration-emulator: image: tnc1997/azure-app-configuration-emulator volumes: - ./emulator.db:/var/lib/azureappconfigurationemulator/emulator.db
模拟器与Azure Event Grid集成,当配置设置被删除或修改时,使用Event Grid事件架构发布事件。
可通过环境变量Messaging__EventGridTopics__xyz__Endpoint和Messaging__EventGridTopics__xyz__Credential__Key分别设置Event Grid主题的端点和密钥,其中xyz为任意名称。
yamlservices: azure-app-configuration-emulator: environment: - Messaging__EventGridTopics__Contoso__Credential__Key=a2V5 - Messaging__EventGridTopics__Contoso__Endpoint=[***] image: tnc1997/azure-app-configuration-emulator
模拟器集成OpenTelemetry以提供指标和跟踪。
可通过环境变量OTEL_EXPORTER_OTLP_ENDPOINT覆盖OpenTelemetry协议(OTLP)导出器的端点:
yamlservices: azure-app-configuration-emulator: depends_on: - opentelemetry-collector environment: - OTEL_EXPORTER_OTLP_ENDPOINT=[***] image: tnc1997/azure-app-configuration-emulator opentelemetry-collector: image: otel/opentelemetry-collector-contrib
模拟器可配置为使用自签名证书通过HTTPS提供请求服务。
shellopenssl req -x509 -out ./emulator.crt -keyout ./emulator.key -newkey rsa:2048 -nodes -sha256 -subj '/CN=azure-app-configuration-emulator' -addext 'subjectAltName=DNS:azure-app-configuration-emulator'
必须通过环境变量ASPNETCORE_HTTPS_PORTS设置HTTPS端口。
必须通过环境变量Kestrel__Certificates__Default__Path和Kestrel__Certificates__Default__KeyPath分别设置证书和密钥的路径。
证书和密钥必须挂载到容器中上述设置的路径。
yamlservices: azure-app-configuration-emulator: environment: - ASPNETCORE_HTTP_PORTS=8080 - ASPNETCORE_HTTPS_PORTS=8081 - Kestrel__Certificates__Default__Path=/usr/local/share/azureappconfigurationemulator/emulator.crt - Kestrel__Certificates__Default__KeyPath=/usr/local/share/azureappconfigurationemulator/emulator.key image: tnc1997/azure-app-configuration-emulator volumes: - ./emulator.crt:/usr/local/share/azureappconfigurationemulator/emulator.crt:ro - ./emulator.key:/usr/local/share/azureappconfigurationemulator/emulator.key:ro
模拟器与Testcontainers集成,便于对使用Azure App Configuration的应用进行集成测试。
csharpvar container = new ContainerBuilder() .WithImage("tnc1997/azure-app-configuration-emulator:1.0") .WithPortBinding(8080, true) .WithWaitStrategy(Wait.ForUnixContainer().UntilMessageIsLogged("Now listening on")) .Build(); await container.StartAsync(); var client = new ConfigurationClient($"Endpoint={new UriBuilder(Uri.UriSchemeHttp, container.Hostname, container.GetMappedPublicPort(8080))};Id=abcd;Secret=c2VjcmV0"); await client.SetConfigurationSettingAsync(nameof(ConfigurationSetting.Key), nameof(ConfigurationSetting.Value)); var response = await client.GetConfigurationSettingAsync(nameof(ConfigurationSetting.Key));
即将推出 testcontainers/testcontainers-dotnet#1198
csharpvar container = new AzureAppConfigurationBuilder().Build(); await container.StartAsync(); var client = new ConfigurationClient(container.GetConnectionString()); await client.SetConfigurationSettingAsync(nameof(ConfigurationSetting.Key), nameof(ConfigurationSetting.Value)); var response = await client.GetConfigurationSettingAsync(nameof(ConfigurationSetting.Key));

来自真实用户的反馈,见证轩辕镜像的优质服务
免费版仅支持 Docker Hub 加速,不承诺可用性和速度;专业版支持更多镜像源,保证可用性和稳定速度,提供优先客服响应。
免费版仅支持 docker.io;专业版支持 docker.io、gcr.io、ghcr.io、registry.k8s.io、nvcr.io、quay.io、mcr.microsoft.com、docker.elastic.co 等。
当返回 402 Payment Required 错误时,表示流量已耗尽,需要充值流量包以恢复服务。
通常由 Docker 版本过低导致,需要升级到 20.x 或更高版本以支持 V2 协议。
先检查 Docker 版本,版本过低则升级;版本正常则验证镜像信息是否正确。
使用 docker tag 命令为镜像打上新标签,去掉域名前缀,使镜像名称更简洁。
探索更多轩辕镜像的使用方法,找到最适合您系统的配置方式
通过 Docker 登录认证访问私有仓库
在 Linux 系统配置镜像加速服务
在 Docker Desktop 配置镜像加速
Docker Compose 项目配置加速
Kubernetes 集群配置 Containerd
在宝塔面板一键配置镜像加速
Synology 群晖 NAS 配置加速
飞牛 fnOS 系统配置镜像加速
极空间 NAS 系统配置加速服务
爱快 iKuai 路由系统配置加速
绿联 NAS 系统配置镜像加速
QNAP 威联通 NAS 配置加速
Podman 容器引擎配置加速
HPC 科学计算容器配置加速
ghcr、Quay、nvcr 等镜像仓库
无需登录使用专属域名加速
需要其他帮助?请查看我们的 常见问题 或 官方QQ群: 13763429