Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Functions are not created in Azure Functions when deploying a file with functions or variables other than instance creation and HTTP triggers. #3809

Open
Shotaro-Yoshinaga-sti opened this issue Sep 4, 2024 · 0 comments

Comments

@Shotaro-Yoshinaga-sti
Copy link

Shotaro-Yoshinaga-sti commented Sep 4, 2024

Version

Python: 3.11
Core tools: 4.0.5907

Description

Functions are not created in Azure Functions when deploying a file with functions or variables other than instance creation and HTTP triggers.

$ func azure functionapp publish func-sample
...
Copying files to destination directory '/home/site/wwwroot'...
Done in 0 sec(s).

Removing existing manifest file
Creating a manifest file...
Manifest file created.
Copying .ostype to manifest output directory.

Done in 26 sec(s).
Running post deployment command(s)...

Generating summary of Oryx build
Deployment Log file does not exist in /tmp/oryx-build.log
The logfile at /tmp/oryx-build.log is empty. Unable to fetch the summary of build
Triggering recycle (preview mode disabled).
Linux Consumption plan has a 1.5 GB memory limit on a remote build container.
To check our service limit, please visit https://docs.microsoft.com/en-us/azure/azure-functions/functions-scale#service-limits
Writing the artifacts to a squashfs file
Parallel mksquashfs: Using 1 processor
Creating 4.0 filesystem on /home/site/artifacts/functionappartifact.squashfs, block size 131072.

[=============================================================\] 2653/2653 100%

Exportable Squashfs 4.0 filesystem, gzip compressed, data block size 131072
        compressed data, compressed metadata, compressed fragments,
        compressed xattrs, compressed ids
        duplicates are removed
Filesystem size 15314.37 Kbytes (14.96 Mbytes)
        30.76% of uncompressed filesystem size (49784.88 Kbytes)
Inode table size 26564 bytes (25.94 Kbytes)
        29.15% of uncompressed inode table size (91124 bytes)
Directory table size 26417 bytes (25.80 Kbytes)
        33.77% of uncompressed directory table size (78225 bytes)
Number of duplicate files found 117
Number of inodes 2818
Number of files 2490
Number of fragments 202
Number of symbolic links  0
Number of device nodes 0
Number of fifo nodes 0
Number of socket nodes 0
Number of directories 328
Number of ids (unique uids + gids) 1
Number of uids 1
        root (0)
Number of gids 1
        root (0)
Creating placeholder blob for linux consumption function app...
SCM_RUN_FROM_PACKAGE placeholder blob scm-latest-func-sample.zip located
Uploading built content /home/site/artifacts/functionappartifact.squashfs for linux consumption function app...
Resetting all workers for func-sample.azurewebsites.net
Deployment successful. deployer = Push-Deployer deploymentPath = Functions App ZipDeploy. Extract zip. Remote build.
Remote build succeeded!
[2024-09-04T01:28:08.373Z] Syncing triggers...
Functions in func-sample:

Steps to reproduce

Deploy the following code from local.

Variables: aoai_endpoint
Function: test_func()

# function_app.py
import os
import azure.functions as func
import logging

aoai_endpoint = os.environ["AOAI_ENDPOINT"]

app = func.FunctionApp(http_auth_level=func.AuthLevel.ANONYMOUS)

@app.route(route="Test", auth_level=func.AuthLevel.ANONYMOUS)
def Test(req: func.HttpRequest) -> func.HttpResponse:
    logging.info('Python HTTP trigger function processed a request.')

    test_func(aoai_endpoint)

    name = req.params.get('name')
    if not name:
        try:
            req_body = req.get_json()
        except ValueError:
            pass
        else:
            name = req_body.get('name')

    if name:
        msg.set(name)
        return func.HttpResponse(f"Hello, {name}. This HTTP triggered function executed successfully.")
    else:
        return func.HttpResponse(
             "This HTTP triggered function executed successfully. Pass a name in the query string or in the request body for a personalized response.",
             status_code=200
        )

def test_func(aoai_endpoint);
    ...
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

1 participant