Reputation: 6862
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"?
Upvotes: 6
Views: 1670
Reputation: 41
There is a problem whit the xmlns value. Try this:
<parameterEntry kind="XmlFile" scope="ApplicationInsights\.config$"match="/*/*[local-name() = 'InstrumentationKey']/text()"/>
Upvotes: 4