我正在研究 Azure DevOps,并使用 Azure CD 管道将我的 Web 应用程序部署到 Azure Web 应用程序服务中,我正在使用 Azure 组变量将我的应用程序设置值替换为组变量中提到的我定义的值。
下面是我的 appsetting.json 文件
"ConnectionStrings": { "AllegationDBConnectionString": "Server=sqlserver;Database=database;User ID=username; pwd =password;" },
我的组变量是 Image .
我尝试添加:
- AllegationDBConnectionString
- ConnectionStrings:AllegationDBConnectionString
- 连接字符串
在组变量的名称部分,但不起作用。
如何替换 Azure 组变量中 AllegationDBConnectionString 的值
最佳答案
因此,如果 ConnectionStrings
是 json 的顶级元素 - 您的变量名称必须是:
ConnectionStrings.AllegationDBConnectionString
关于Azure 组变量未选择我的 appsetting.json 文件变量,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/60167985/