title: Azure function is getting executed in local even RunOnStartup = false
body: <p>As per my understanding Azure function will execute</p>
  <p>In case <strong>RunOnStartup = true</strong></p>
  <pre><code>   1. on startup 
     2. if a host changed 
     3. a new deployment happen
     4. on schedule time
  </code></pre>
  <p>And, In case <strong>RunOnStartup = false or not define</strong></p>
  <pre><code>   1. on schedule time only
  </code></pre>
  <p>but when I am running it locally with <strong>RunOnStartup = false</strong>, it is executing on startup as well and on azure portal it is working fine. Can anyone please suggest why it happen?</p>
  <p>update:-
  Function code:-</p>
  <pre class="lang-csharp prettyprint-override"><code>    public static void Run([TimerTrigger(&quot;0 30 3 * * *&quot;, RunOnStartup = false)]TimerInfo myTimer, TraceWriter log, ExecutionContext executionContext)
      {
          log.Info($&quot;Function1- Timer trigger function executed at: {DateTime.Now}&quot;);
          try
          {
              //main work
          }
          catch (Exception ex)
          {
              log.Error(ex.Message, ex);
          }
          finally
          {
              log.Info($&quot;Function1 - Timer trigger function ENDED at: {DateTime.Now}&quot;);
          }
      }
  </code></pre>
  <p>Console output:-</p>
  <pre><code>   your worker runtime is not set. As of 2.0.1-beta.26 a worker runtime setting is
  </code></pre>
  <p>required.
  Please run <code>func settings add FUNCTIONS_WORKER_RUNTIME &lt;option&gt;</code> or add FUNCTION
  S_WORKER_RUNTIME to your local.settings.json
  Available options: dotnet, node, python</p>
  <pre><code>              %%%%%%
               %%%%%%
          @   %%%%%%    @
        @@   %%%%%%      @@
     @@@    %%%%%%%%%%%    @@@
   @@      %%%%%%%%%%        @@
     @@         %%%%       @@
       @@      %%%       @@
         @@    %%      @@
              %%
              %
  
    Azure Functions Core Tools (2.3.148 Commit hash:     f9b3db04f9833b431f1b001efb3e5783a169ebfc)
    Function Runtime Version: 2.0.12210.0
    [19-Dec-18 8:22:47 AM] Building host: startup suppressed:False, configuration suppressed: False
    [19-Dec-18 8:22:47 AM] Reading host configuration file 'D:\path****\host.json'
    [19-Dec-18 8:22:47 AM] Host configuration file read:
    [19-Dec-18 8:22:47 AM] {
    [19-Dec-18 8:22:47 AM]   &quot;version&quot;: &quot;2.0&quot;
    [19-Dec-18 8:22:47 AM] }
    [19-Dec-18 8:22:47 AM] Initializing Host.
    [19-Dec-18 8:22:47 AM] Host initialization: ConsecutiveErrors=0, StartupCount=1
    [19-Dec-18 8:22:47 AM] Starting JobHost
    [19-Dec-18 8:22:47 AM] Starting Host (HostId=boldsombirk-85417686, InstanceId=4f41b83d-022e-4e75-b75b-528890f62058, Version=2.0.12210.0, ProcessId=7012, AppDomainId=1, InDebugMode=False, InDiagnosticMode=False, FunctionsExtensionVersion=)
    [19-Dec-18 8:22:47 AM] Loading functions metadata
    [19-Dec-18 8:22:48 AM] 1 functions loaded
    [19-Dec-18 8:22:48 AM] Generating 1 job function(s)
    [19-Dec-18 8:22:48 AM] Found the following functions:
    [19-Dec-18 8:22:48 AM] Function1.Run
    [19-Dec-18 8:22:48 AM]
    [19-Dec-18 8:22:48 AM] Host initialized (673ms)
    [19-Dec-18 8:22:49 AM] Executing 'Function1' (Reason='Timer fired at 2018-12-19T13:52:49.5718606+05:30', Id=e1603f8f-41d0-492e-8674-d5771813422d)
    [19-Dec-18 8:23:41 AM] Function1 - Timer trigger function executed at: 19-Dec-18 1:53:41 PM
  </code></pre>