title: Azure Function App: TimerTrigger not Firing when Deployed
body: <p>I have an Azure Function App (v2) that is run through a TimerTrigger (every day at midnight - EST). It works fine when I run it locally in Visual Studio. However, when I use the built in Visual Studio Publishing Tool to publish it to my Function App directly (Zip Deploy), it doesn't trigger at midnight nor any time for that matter. </p>
  
  <p>I have also tried to run the function directly through the Azure portal and that doesn't work either. Here is my code. All it is doing is pulling a file from Azure Storage, updating the ranked game JSON, and then replacing the file back in Azure Storage. I have a mobile app that pulls the <code>ranked_settings.json</code> and generates the ranked game.</p>
  
  <pre><code>[FunctionName("RankedSettingsIntervalFunction")]
  public static void Run([TimerTrigger("0 0 0 */1 * *")]TimerInfo myTimer, ILogger log, ExecutionContext context)
  {
      Console.WriteLine("App started running at " + DateTimeOffset.UtcNow.ToString());
  
      const string fileName = "ranked_settings.json";
  
      var config = new ConfigurationBuilder()
                  .SetBasePath(context.FunctionAppDirectory)
                  .AddJsonFile("local.settings.json", optional: true, reloadOnChange: true)
                  .AddEnvironmentVariables()
                  .Build();
  
      var conn1 = config["FileStorage:ConnectionStringOne"];
      var conn2 = config["FileStorage:ConnectionStringTwo"];
  
      StorageService service = new StorageService(conn1, conn2);
      Settings settings = RankedSettingsGenerator.Generate();
      var json = JsonConvert.SerializeObject(settings);
  
      Console.WriteLine("App original JSON created at " + DateTimeOffset.UtcNow.ToString());
      Console.WriteLine(json);
  
      byte[] byteArray = Encoding.ASCII.GetBytes(json);
      MemoryStream stream = new MemoryStream(byteArray);
  
      service.AddFile(fileName, stream);
  
      Console.WriteLine("App finished running at " + DateTimeOffset.UtcNow.ToString());
  }
  </code></pre>
  
  <p>My function.json file has the following bindings:</p>
  
  <pre><code>"bindings": [
      {
        "type": "timerTrigger",
        "schedule": "0 0 0 */1 * *",
        "useMonitor": true,
        "runOnStartup": false,
        "name": "myTimer"
      }
    ],
  </code></pre>
  
  <p>I was thinking the issue was that the <code>runOnStartup</code> property is false, but that doesn't explain why it doesn't work when I press the <code>Run</code> button in the portal.</p>