anchor.diff:  )
   
   IF NOT DEFINED DEPLOYMENT_TARGET (
  -  SET DEPLOYMENT_TARGET=%ARTIFACTS%\wwwroot\iothubpingfunction
  +  SET DEPLOYMENT_TARGET=%ARTIFACTS%\wwwroot
   )
   
   IF NOT DEFINED NEXT_MANIFEST_PATH (
  
positive.code:   :: Locally just running "kuduSync" would also work
    SET KUDU_SYNC_CMD=%appdata%\npm\kuduSync.cmd
  )
  goto Deployment
  
  :: Utility Functions
  :: -----------------
  
  :SelectNodeVersion
  
  IF DEFINED KUDU_SELECT_NODE_VERSION_CMD (
    :: The following are done only on Windows Azure Websites environment
    call %KUDU_SELECT_NODE_VERSION_CMD% "%DEPLOYMENT_SOURCE%" "%DEPLOYMENT_TARGET%" "%DEPLOYMENT_TEMP%"
    IF !ERRORLEVEL! NEQ 0 goto error
  
    IF EXIST "%DEPLOYMENT_TEMP%\__nodeVersion.tmp" (
      SET /p NODE_EXE=<"%DEPLOYMENT_TEMP%\__nodeVersion.tmp"
      IF !ERRORLEVEL! NEQ 0 goto error
    )
    
    IF EXIST "%DEPLOYMENT_TEMP%\__npmVersion.tmp" (
      SET /p NPM_JS_PATH=<"%DEPLOYMENT_TEMP%\__npmVersion.tmp"
      IF !ERRORLEVEL! NEQ 0 goto error
    )
  
    IF NOT DEFINED NODE_EXE (
      SET NODE_EXE=node
    )
  
    SET NPM_CMD="!NODE_EXE!" "!NPM_JS_PATH!"
  ) ELSE (
    SET NPM_CMD=npm
    SET NODE_EXE=node
  )
  
  goto :EOF
  
  ::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::
  :: Deployment
  :: ----------
  
  :Deployment
  echo Handling node.js deployment.
  
  :: 1. KuduSync
  IF /I "%IN_PLACE_DEPLOYMENT%" NEQ "1" (
    call :ExecuteCmd "%KUDU_SYNC_CMD%" -v 50 -f "%DEPLOYMENT_SOURCE%" -t "%DEPLOYMENT_TARGET%" -n "%NEXT_MANIFEST_PATH%" -p "%PREVIOUS_MANIFEST_PATH%" -i ".git;.hg;.deployment;deploy.cmd; devicesample"
    IF !ERRORLEVEL! NEQ 0 goto error
  )
  
  :: 2. Select node version
  call :SelectNodeVersion
  
  :: 3. Install npm packages
  FOR /F %%d in ('DIR /a:%DEPLOYMENT_TARGET% /B') DO ( 
      cd %%d
  
      IF EXIST "package.json" (
        call :ExecuteCmd !NPM_CMD! install --production
        IF !ERRORLEVEL! NEQ 0 goto error
      )
  )
  
  ::IF EXIST "%DEPLOYMENT_TARGET%\package.json" (
  ::  pushd "%DEPLOYMENT_TARGET%"
  ::  call :ExecuteCmd !NPM_CMD! install --production
  ::  IF !ERRORLEVEL! NEQ 0 goto error
  ::  popd
  ::)
  
  ::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::
  
  :: Post deployment stub
  IF DEFINED POST_DEPLOYMENT_ACTION call "%POST_DEPLOYMENT_ACTION%"
  IF !ERRORLEVEL! NEQ 0 goto error
  
  goto end
  
  :: Execute command routine that will echo out when error
  
negative.code: @if "%SCM_TRACE_LEVEL%" NEQ "4" @echo off
  
  :: ----------------------
  :: KUDU Deployment Script with Functions Package restore
  :: Version: 1.0.6
  :: ----------------------
  
  :: Prerequisites
  