We are trying to push a ApplicationInsights key in ApplicationInsights.config
via parameters.xml.
The parameter does not do his way to the said file.
We build a webdeploy package that is then published to different environnements. All the other parameters are for the web.config and works as expected.
The entry in parameters.xml:
<parameter name="InsightInstrumentationKey" description="InsightInstrumentationKey">
<parameterValidation kind="AllowEmpty" />
<parameterEntry kind="XmlFile"
scope="\\ApplicationInsights.config$"
match="/ApplicationInsights/InstrumentationKey/text()" />
</parameter>
The ApplicationInsights.config file:
<?xml version="1.0" encoding="utf-8"?>
<ApplicationInsights xmlns="http://schemas.microsoft.com/ApplicationInsights/2013/Settings" schemaVersion="2014-05-30">
<TelemetryChannel>
<DeveloperMode>false</DeveloperMode>
</TelemetryChannel>
<TelemetryModules>
[...]
</TelemetryModules>
<AccountId></AccountId>
<InstrumentationKey>HERE GOES THE PARAMETER</InstrumentationKey>
<ContextInitializers>
[...]
</ContextInitializers>
<TelemetryInitializers>
[...]
</TelemetryInitializers>
</ApplicationInsights>
I am now wondering if it is possible at all to have a scrope differente from "web.config"?
There is a problem whit the xmlns value. Try this:
<parameterEntry kind="XmlFile" scope="ApplicationInsights\.config$"match="/*/*[local-name() = 'InstrumentationKey']/text()"/>
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With