简体   繁体   English

web.config转换不转换

[英]web.config transform not transforming

I am publishing a website app to an Azure App Service. 我正在将网站应用发布到Azure应用服务。 I've created a QA configuration profile and added a matching Web.QA.config file. 我创建了一个质量检查配置配置文件,并添加了一个匹配的Web.QA.config文件。 Here's the entire contents (with some redacted) of that file: 这是该文件的全部内容(已删节):

<?xml version="1.0"?>
<!-- For more information on using app.config transformation visit http://go.microsoft.com/fwlink/?LinkId=125889 -->
<!-- In case configuration is not the root element, replace it with root element in source configuration file -->
<configuration xmlns:xdt="http://schemas.microsoft.com/XML-Document-Transform">
  <appSettings>
    <add key="ida:ClientId" value="9a...54e" xdt:Transform="SetAttributes" xdt:Locator="Match(value)" />
    <add key="ida:ClientSecret" value="vuW...z3kY=" xdt:Transform="SetAttributes" xdt:Locator="Match(value)" />
    <add key="ida:PostLogoutRedirectUri" value="https://....azurewebsites.net/" xdt:Transform="SetAttributes" xdt:Locator="Match(value)" />
  </appSettings>
</configuration>

When I publish the site to the Azure App Service using the QA profile, these values are not being transformed. 当我使用QA配置文件将网站发布到Azure App Service时,这些值没有被转换。

What am I doing wrong? 我究竟做错了什么?

You're matching on value instead of key . 您正在匹配value而不是key

Use xdt:Locator="Match(key)" 使用xdt:Locator="Match(key)"

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM