1

When I am deploying my Azure Function (timer trigger) through VS Code, I get the following internal server error message after the deployment was succesfull and the 6 syncing trigger attempts are over:

16:15:04 maintenance-tanku-beta01: Deployment successful. deployer = ms-azuretools-vscode deploymentPath = Functions App ZipDeploy. Extract zip. Remote build.
16:15:20 maintenance-tanku-beta01: Syncing triggers...
16:15:30 maintenance-tanku-beta01: Syncing triggers (Attempt 2/6)...
16:15:41 maintenance-tanku-beta01: Syncing triggers (Attempt 3/6)...
16:16:02 maintenance-tanku-beta01: Syncing triggers (Attempt 4/6)...
16:16:44 maintenance-tanku-beta01: Syncing triggers (Attempt 5/6)...
16:18:05 maintenance-tanku-beta01: Syncing triggers (Attempt 6/6)...
16:18:10: Error: Encountered an error (InternalServerError) from host runtime.

I am not using python azure functions v2.

The code seems to be running and is updating my database frequently. However, I cannot see the function in the Azure Portal under Functions in the Function App.

I have already tried redeploying several times, checked that the AzureWebJobsStorage is correct and this seems to be the case.

Any ideas what else I can try?

jonsdope
  • 51
  • 1
  • 3

1 Answers1

2

Source Code from the given MS Doc.

import datetime
import logging
import azure.functions as func

def main(mytimer: func.TimerRequest) -> None:
    utc_timestamp = datetime.datetime.utcnow().replace(
        tzinfo=datetime.timezone.utc).isoformat()
        
if mytimer.past_due:
logging.info('The timer is past due!')
logging.info('Python timer trigger function ran at %s', utc_timestamp)

The timer trigger function is successfully deployed to functionapp, enter image description here

The timer trigger function is successfully deployed to functionapp in Azure portal as below, enter image description here

Check this link for your error.

Steps to create Timer trigger function in VS code:

Create a new Function trigger with Azure Timer Trigger like below in your VS Code, Make sure you have Azure Function extension installed:-

I opened one Folder in my Vs Code and creates a new Function trigger like below:- enter image description here

enter image description here

enter image description here

enter image description here

enter image description here

enter image description here

It will create a project for Timer trigger function like below, enter image description here

Run your Timer trigger function like below:-

Click fn + f5 or Click on run > Debug > It will prompt you to connect to a storage account like below:- enter image description here

Select the storage account from the list or you can create a new storage account: enter image description here

Timer trigger Function ran successfully like below:- enter image description here

Then I delpoyed the Timere trigger function to functionapp as below, enter image description here

Select the functionapp from the list that you want to deploy, enter image description here

Click on Delpoy option,

enter image description here

The Timer trigger function deployed successfully, Click on View output,enter image description here

The output shows that the Timer trigger function is successfully deployed to functionapp as below, enter image description here

The Timer trigger function is successfully deployed to functionapp in Azure portal as below, enter image description here

Dasari Kamali
  • 811
  • 2
  • 2
  • 6