Azure Transform web.config

Fasilitas transform web.config waktu publish sangat bermanfaat, misalnya untuk mengubah <appSettings> atau menambahkan customErrors=”off”.

Buka xxx.config. Contoh isinya:

[code language=”xml”]

<system.web>
<compilation xdt:Transform="RemoveAttributes(debug)" />
<!–
In the example below, the "Replace" transform will replace the entire
<customErrors> section of your web.config file.
Note that because there is only one customErrors section under the
<system.web> node, there is no need to use the "xdt:Locator" attribute.

<customErrors defaultRedirect="GenericError.htm"
mode="RemoteOnly" xdt:Transform="Replace">
<error statusCode="500" redirect="InternalError.htm"/>
</customErrors>
–>
<authentication mode="Forms" xdt:Transform="Replace">
<forms loginUrl="http://mobidig.azurewebsites.net/SGAccount/login" timeout="2880" />
</authentication>
</system.web>
<appSettings>
<add key="MobidigUrl" value="http://mobidig.azurewebsites.net" xdt:Transform="SetAttributes" xdt:Locator="Match(key)" />
</appSettings>

[/code]

Untuk melihat hasil transform klik kanan di xxx.config, pilih Preview Transform.

untitled

Chandra Oemaryadi has written 244 articles

Leave a Reply

Your email address will not be published. Required fields are marked *

You may use these HTML tags and attributes: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <s> <strike> <strong>