I want to deploy a easy function to Azure. When i deploy with this code it's ok :
import azure.functions as func
@app = func.FunctionApp()
@app.function_name(name="echo")
@app.route(route="echo")
def echo_function(req: func.HttpRequest) -> func.HttpResponse:
return func.HttpResponse("Echo OK")
I see in Azure Portal my function echo.
But when i add a new function to my function_app.py i don't see any function :
import azure.functions as func
from azure.storage.blob import ContainerClient
from azure.identity import ManagedIdentityCredential
@app.function_name(name="Logging")
@app.route(route="Logging")
def logging_function(req: func.HttpRequest) -> func.HttpResponse:
credential = ManagedIdentityCredential()
container_client = ContainerClient(account_url="https://sae2sbxfchpv00002.blob.core.windows.net",
container_name="f03temp",
credential=credential)
container_client.delete_container()
return func.HttpResponse(f"Blob", status_code=200)
My function app have a managed Identity enabled. I have a container name "f03temp" in my storage account. My fonction app have the "Data Storage contributor" acess for the storage account. In vs code i have all the librairies neccesary.
I can't test in local, because i don't have blob acess with my account.
Anyone can help me for understand? Thanks in advance
I want to see my function in Azure Portail after the deployment.