如何将字符串数组作为环境变量传递给azure web app(linux)容器中的容器?

问题描述 投票:0回答:1

我在 azure 中部署了一个 Web 应用程序,其中包含 .Net core Webapi 容器映像。所有事情都按预期工作,但现在我陷入将字符串数组作为环境变量传递给容器的困境。

我的设置是

Appsettings__EmailRecipients: "[email protected], [email protected]"

在后端,使用传统的 IConfiguration 方法将其映射为字符串数组。

所有其他应用程序设置均按预期工作,但字符串环境变量数组除外。

那么,有人可以帮忙吗?从 azure web 应用程序将字符串数组作为环境变量传递的正确方法是什么?

我尝试按以下方式注入环境变量,但仍然不起作用

Appsettings__EmailRecipients0:[电子邮件受保护] 应用程序设置__EmailRecipients1:[电子邮件受保护]

azure containers azure-web-app-for-containers
1个回答
0
投票

我可以通过传递环境变量来解决它,如下所示

Appsettings__EmailRecipients__0: [email protected]
Appsettings__EmailRecipients__1: [email protected]
© www.soinside.com 2019 - 2024. All rights reserved.