Support & Documentation

How do I avoid deploying the Stackify Monitoring Agent in Azure on roles that I don't want to monitor?

If you followed our instructions for deploying to Azure roles but want to make sure that you don't install the agent on certain roles (roles used for Dev or QA for example), you can do something like the following to perform a selective deployment.

Selective Deployment Instructions

1. Add a config setting to ServiceDefinition.csdef called "DeployStackify", ie.

      <Setting name="DeployStackify" />

2. Also add another variable to the startup task that reads from this setting, ie.

      <Task commandLine="Install.cmd" executionContext="elevated" taskType="background">
          <Variable name="ACTIVATIONKEY">
            <RoleInstanceValue xpath="/RoleEnvironment/CurrentInstance/ConfigurationSettings/ConfigurationSetting
            [@name='SelfMonitorAgentActivationKey']/@value" />
          <Variable name="DOWNLOADURL">
            <RoleInstanceValue xpath="/RoleEnvironment/CurrentInstance/ConfigurationSettings/ConfigurationSetting
            [@name='SelfMonitorAgentDownloadPath']/@value" />
          <Variable name="DEPLOY">
            <RoleInstanceValue xpath="/RoleEnvironment/CurrentInstance/ConfigurationSettings/ConfigurationSetting
            [@name='DeployStackify']/@value" />

3. In each transform of the service config, provide the value for this setting, ie.

      <Setting name="DeployStackify" value="true"/>

4. In the Install.cmd file, read this variable and decide whether or not to install, ie.

if "%EMULATED%"=="true" goto :EOF
if "%DEPLOY%"=="false" goto :EOF
md "%~dp0appdata"
reg add "hku\.default\software\microsoft\windows\currentversion\explorer\user shell folders" /v "Local AppData" /t REG_EXPAND_SZ /d "%~dp0appdata" /f
powershell -ExecutionPolicy Unrestricted .\Install.ps1 %DOWNLOADURL% %ACTIVATIONKEY%
Was this article helpful?
0 out of 0 found this helpful
Have more questions? Submit a request


  • Avatar
    Oleg Semenchuk

    One of articles is out-of-date, this or

    As powershell install.ps1 expect another set of arguments, in current case first argument "downloadUrl" and in mentioned article - activationKey.

    Please fix.

  • Avatar
    Mikhail Belov

    My Install.cmd file is different. I got it from the onboarding page. Looks like the article is still out-of-date.

    Edited by Mikhail Belov
  • Avatar
    Mikhail Belov

    After applying theese changes and building the projects VS says the following error exists:
    The '/RoleEnvironment/CurrentInstance/ConfigurationSettings/ConfigurationSetting [@name='DeployStackify']/@value' is an invalid xpath expression.

    Could you please actualize steps?

Powered by Zendesk