Support & Documentation
Follow

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.

    <ConfigurationSettings>
      <Setting name="DeployStackify" />
   </ConfigurationSettings>

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

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

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

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

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

Comments

  • Avatar
    Oleg Semenchuk

    One of articles is out-of-date, this or http://support.stackify.com/hc/en-us/articles/204719869-Installing-for-Azure

    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