Python Functions do not get detected by azure function app when deployed to azure
- Dominant language
- PowerShell
- Stars
- 1.1k
- Forks
- 215
- Avg merge
- 4h 2m
- Merged PRs (30d)
- 1
Description
- create new function in empty dir using ``` func init ```
- add a simple endpoint such as /hello to it
```
@app.route(route="hello", methods=["GET"], auth_level=func.AuthLevel.ANONYMOUS)
def hello(req: func.HttpRequest) -> func.HttpResponse:
name = req.params.get("name")
if not name:
return func.HttpResponse(
json.dumps({"error": "Name parameter is required"}),
status_code=400,
mimetype="application/json"
)
response = {
"message": f"Hello, {name}!",
"timestamp": datetime.datetime.now(datetime.UTC).isoformat()
}
return func.HttpResponse(
json.dumps(response),
status_code=200,
mimetype="application/json"
)
```
- run ``` func azure functionapp publish $functionAppName // var set before in env/script ```
- functions show up in the deployment logs as well as in the portal like this
```
[2025-05-15T11:06:13.714Z] The deployment was successful!
Functions in MyFunctionAppName:
healthcheck - [httpTrigger]
Invoke url: https://MyFunctionAppName.azurewebsites.net/api/hello
```
but, in another function app, this does not happen, the functions never show up
logs would be:
```
Getting site publishing info...
[2025-05-15T10:44:52.557Z] Starting the function app deployment...
[2025-05-15T10:44:52.568Z] Creating archive for current directory...
Performing remote build for functions project.
Deleting the old .python_packages directory
Uploading 81.74 KB [##############################################################################]
Deployment in progress, please wait...
Starting deployment pipeline.
[Kudu-SourcePackageUriDownloadStep] Skipping download. Zip package is present at /tmp/zipdeploy/.zip
[Kudu-ValidationStep] starting.
[Kudu-ValidationStep] completed.
[Kudu-ExtractZipStep] starting.
[Kudu-ExtractZipStep] completed.
[Kudu-ContentValidationStep] starting.
[Kudu-ContentValidationStep] completed.
[Kudu-PreBuildValidationStep] starting.
[Kudu-PreBuildValidationStep] completed.
[Kudu-OryxBuildStep] starting.
[Kudu-OryxBuildStep] completed.
[Kudu-PostBuildValidationStep] starting.
[Kudu-PostBuildValidationStep] completed.
[Kudu-PackageZipStep] starting.
[Kudu-PackageZipStep] completed.
[Kudu-UploadPackageStep] starting.
[Kudu-UploadPackageStep] completed. Uploaded package to storage successfully.
[Kudu-RemoveWorkersStep] starting.
[Kudu-RemoveWorkersStep] completed.
[Kudu-SyncTriggerStep] starting.
[Kudu-CleanUpStep] starting.
[Kudu-CleanUpStep] completed.
Finished deployment pipeline.
Checking the app health.... done
[2025-05-15T10:47:35.888Z] The deployment was successful!
Functions in :
```
```func start ``` works and shows the functions to be present
how do we debug this ?
if it is some requirements issue ?
Or if it is misconfiguration ?
or if this is some function runtime bug ?
Contributor guide
No contributing guide indexed for this repository
Assessment
This issue has not been assessed yet.