Skip to content
New issue

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

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

Already on GitHub? # to your account

listFunctions ARM api fails for linux consumption function app #3502

Closed
ejizba opened this issue Sep 21, 2018 · 2 comments
Closed

listFunctions ARM api fails for linux consumption function app #3502

ejizba opened this issue Sep 21, 2018 · 2 comments
Assignees

Comments

@ejizba
Copy link
Contributor

ejizba commented Sep 21, 2018

I'm calling the listFunctions ARM api: https://docs.microsoft.com/en-us/rest/api/appservice/webapps/listfunctions

It works for a windows function app, but the azure-arm-website module fails to parse the linux structure, resulting in an empty object.

On a windows function app, the result has this structure:

{
    "value": [
        {
            "id": "/subscriptions//resourceGroups//providers/Microsoft.Web/sites//functions/HttpTriggerAdmin",
            "name": "/HttpTriggerAdmin",
            "type": "Microsoft.Web/sites/functions",
            "location": "West US",
            "properties": {
                "name": "HttpTriggerAdmin",
                "function_app_id": "/subscriptions//resourceGroups//providers/Microsoft.Web/sites/",
                "script_root_path_href": "https://.scm.azurewebsites.net/api/vfs/site/wwwroot/HttpTriggerAdmin/",
                "script_href": "https://.scm.azurewebsites.net/api/vfs/site/wwwroot/HttpTriggerAdmin/index.js",
                "config_href": "https://.scm.azurewebsites.net/api/vfs/site/wwwroot/HttpTriggerAdmin/function.json",
                "secrets_file_href": "https://.scm.azurewebsites.net/api/vfs/data/functions/secrets/HttpTriggerAdmin.json",
                "href": "https://.scm.azurewebsites.net/api/functions/HttpTriggerAdmin",
                "config": {
                    "disabled": false,
                    "bindings": [
                        {
                            "authLevel": "admin",
                            "type": "httpTrigger",
                            "direction": "in",
                            "name": "req",
                            "methods": [
                                "get",
                                "post"
                            ]
                        },
                        {
                            "type": "http",
                            "direction": "out",
                            "name": "res"
                        }
                    ]
                },
                "files": null,
                "test_data": ""
            }
        }
    ]
}

But on linux it has this structure:

[
    {
        "name": "HttpTriggerPython",
        "script_root_path_href": "https://.azurewebsites.net/admin/vfs/home/site/wwwroot/HttpTriggerPython/",
        "script_href": "https://.azurewebsites.net/admin/vfs/home/site/wwwroot/HttpTriggerPython/__init__.py",
        "config_href": "https://.azurewebsites.net/admin/vfs/home/site/wwwroot/HttpTriggerPython/function.json",
        "test_data_href": "https://.azurewebsites.net/admin/vfs/tmp/FunctionsData/HttpTriggerPython.dat",
        "href": "https://.azurewebsites.net/admin/functions/HttpTriggerPython",
        "invoke_url_template": "https://.azurewebsites.net/api/httptriggerpython",
        "language": "python",
        "config": {
            "scriptFile": "__init__.py",
            "bindings": [
                {
                    "authLevel": "anonymous",
                    "type": "httpTrigger",
                    "direction": "in",
                    "name": "req",
                    "methods": [
                        "get",
                        "post"
                    ]
                },
                {
                    "type": "http",
                    "direction": "out",
                    "name": "$return"
                }
            ]
        },
        "files": null,
        "test_data": "",
        "isDisabled": false,
        "isDirect": false,
        "isProxy": false
    }
]
@ahmelsayed
Copy link
Contributor

@bala16 recently updated that API to go after the runtime's /admin/functions api rather than Kudu's /api/functions. Kudu wraps ARM responses in an ARM envelope, but the runtime doesn't

@ahmelsayed ahmelsayed self-assigned this Sep 21, 2018
@ejizba
Copy link
Contributor Author

ejizba commented Oct 18, 2018

Per an offline email this was already fixed by @bala16. It has been working for me for a while now so I'll go ahead and close the issue.

@ejizba ejizba closed this as completed Oct 18, 2018
@ghost ghost locked as resolved and limited conversation to collaborators Jan 1, 2020
# for free to subscribe to this conversation on GitHub. Already have an account? #.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants