Python Azure Time Trigger Function not showing in Azure Portal after successful deployment from VS code

Aidan Goldie 0 Reputation points
2024-05-07T11:50:12.6366667+00:00

Hi,

I have a Time Trigger Function written in Python 3.11.9 in Visual Studio code. The function runs successfully locally (using F5). When I deploy the function to the Azure portal from Visual Studio Code, it shows as "Deployment successful." in both the Output and Azure tabUser's imageUser's image

However, when I go to my Function App on Azure Portal, the App files show in the function sectionUser's image

but my time trigger function does not shows in the overview section of the function app in the Azure Portal
User's image

When deploying from VS Code, I tried deploying from;

  1. the Local Workspace section on the Azure tab
    User's image
  2. The Resource section on Azure tab
    User's image
  3. Through terminal

User's image (which gives a slightly different output, see below)User's image

But none of these methods were able to fix the problem of the Azure Function not showing up on my Azure Portal Function App.

But none of these methods were able to fix the problem of the Azure Function not showing up on my Azure Portal Function App.

here is the function code with imports(function_app.py)

import
import logging
import azure.functions as func
import requests
import json
from simple_salesforce import Salesforce
import pandas as pd
import csv
from flatten_json import flatten
#for extending csv file for 1 day at a time holidays
import datetime as dt
from datetime import timedelta
from urllib.parse import urlparse, urljoin
#used to save to specific folder 
import os
from dotenv import load_dotenv
from shareplum import Site
from shareplum import Office365
from shareplum.site import Version
from io import BytesIO
from io import StringIO
import pandas as pd
from office365.runtime.auth.authentication_context import AuthenticationContext
from io import BytesIO 
from office365.runtime.auth.client_credential import ClientCredential 
from office365.sharepoint.client_context import ClientContext
#sharepoint
# import necessary modules
from shareplum import Site
import pandas as pd
from shareplum import Office365
from shareplum import Site
from shareplum.site import Version
import pandas as pd
import numpy as np
from sklearn.datasets import load_iris
from IPython.display import display
from tabulate import tabulate
from pandas import json_normalize
from office365.sharepoint.files.file import File
import pandas as pd
import io
import errno
from datetime import datetime, timedelta
from pathlib import Path
from azure.identity import DefaultAzureCredential
from azure.keyvault.secrets import SecretClient
from azure.core.exceptions import ResourceNotFoundError
from azure.storage.blob import BlobServiceClient
from azure.identity import DefaultAzureCredential
from azure.keyvault.keys import KeyClient

app = func.FunctionApp()

@app.schedule(schedule="0 */5 * * * *", arg_name="myTimer", run_on_startup=True,
              use_monitor=False) 
def timer_trigger(myTimer: func.TimerRequest) -> None:
    if myTimer.past_due:
        logging.info('The timer is past due!')

    logging.info('Python timer trigger function executed.')


    #full script below this, inline with function so it runs when the function runs 
import

The modules used (requirements.txt file)

flatten-json==0.1.14 
ipython==8.12.3 
numpy==1.26.4 
Office365-REST-Python-Client==2.5.7 
pandas==2.2.0 
python-dotenv==1.0.1 
requests==2.31.0 
scikit-learn==1.4.2 
SharePlum==0.5.1 
simple-salesforce==1.12.5 
tabulate==0.9.0
flatten-json==

local.settings.json file ( I have tried using "UseDevelopmentStorage=true" and not using this, both gave the same result of no function being present on Azure Portal)

{
  "IsEncrypted": false,
  "Values": {
    "AzureWebJobsStorage": "",
    "FUNCTIONS_WORKER_RUNTIME": "python",
    "AzureWebJobsFeatureFlags": "EnableWorkerIndexing"
  }
}
  

Any guidance or previous experience with this type of error would be greatly appreciated

Azure Functions
Azure Functions
An Azure service that provides an event-driven serverless compute platform.
4,679 questions
{count} votes

1 answer

Sort by: Most helpful
  1. MayankBargali-MSFT 70,016 Reputation points
    2024-05-08T04:53:39.1733333+00:00

    @Aidan Goldie Thanks for reaching out.

    There are multiple runtime exceptions on your function app. To review any issue on your function app you Diagnose and solve problems blade on your function app to get more insights on the error/exception. You can also review the same from your application inisghts logs.As per your requirement I don't see azure.identity module added which should resolve the below error on your function app. Further I don't see the version for flatten-json== and it may be copy paste issue or missed.

    Error: No module named 'azure.identity'

    Another error which I see as below, and you can refer to python v2 guide here.

    No job functions found. Try making your job classes and methods

    0 comments No comments