[Python] Azure Portal function app not showing functions after deploy from VS Code

Discussão em 'Python' iniciado por Stack, Janeiro 16, 2025.

  1. Stack

    Stack Membro Participativo

    I have, for example, this function

    [​IMG]

    I deployed it with VS Code using the following F1 option in VS Code [​IMG]

    Nonetheless, when I go to the function app portal, it shows nothing under the functions submenu: [​IMG]

    I don't know why I am not being able to see my functions in my function app, what am I missing?

    Here is the dummy code of the function:

    import azure.functions as func
    import logging
    import pymssql
    from azure.identity import DefaultAzureCredential
    from azure.keyvault.secrets import SecretClient
    from datetime import datetime, timedelta
    import json
    import jwt

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

    @app.route(
    route="actualizar_contrasena", methods=["POST"], auth_level=func.AuthLevel.ANONYMOUS
    )
    def actualizar_contrasena(req: func.HttpRequest) -> func.HttpResponse:

    try:
    # Establece la conexión
    conn = pymssql.connect(X, XX, XXX, XXXX)
    cursor = conn.cursor()
    email = auth_token.get("email")

    if email and password:
    # do things
    else:
    return func.HttpResponse(f"Error", status_code=500)

    except Exception as e:
    logging.error(f"Error: {e}")
    return func.HttpResponse(f"Error: {e}", status_code=500)
    finally:
    if "conn" in locals() and conn:
    conn.close()

    return func.HttpResponse(
    "Elemento eliminado correctamente",
    status_code=200,
    )

    Continue reading...

Compartilhe esta Página