振动函数可见性

问题描述 投票:0回答:1
I创建了一个HTTP触发功能,该功能将消息发送到Azure的服务总线队列。下面,我将附加功能代码以及绑定文件。

问题是,即使没有进行配置更改,有时该功能在Azure功能中不再可见。

您认为可能是什么问题?

function_app.py代码:

@app.route(route="http_trigger") @app.service_bus_queue_output(arg_name="msgout", queue_name="ftdx", connection="AzureWebJobsServiceBus") def http_trigger(req: func.HttpRequest, msgout: func.Out[str]) -> func.HttpResponse: """Azure Function HTTP trigger that sends messages to Service Bus.""" logging.info('Python HTTP trigger function processed a request.') try: req_body = req.get_json() message_body = req_body.get("message") if not message_body: return func.HttpResponse("Invalid request: 'message' field is required", status_code=400) # Send message to Service Bus msgout.set(message_body) return func.HttpResponse("Message sent to Service Bus.", status_code=200) except ValueError: return func.HttpResponse("Invalid JSON payload", status_code=400)

功能:json:
{
  "bindings": [
    {
      "type": "httpTrigger",
      "direction": "in",
      "authLevel": "function",
      "methods": ["post"]
    },
    {
      "type": "http",
      "direction": "out"
    },
    {
      "type": "serviceBus",
      "direction": "out",
      "name": "msgout",
      "queueName": "ftdx",
      "connection": "AzureWebJobsServiceBus"
    }
  ],
  "scriptFile": "function_app.py"
}

-host.json:
  "version": "2.0",
  "logging": {
    "applicationInsights": {
      "samplingSettings": {
        "isEnabled": true,
        "excludedTypes": "Request"
      }
    }
  },
  "extensionBundle": {
    "id": "Microsoft.Azure.Functions.ExtensionBundle",
    "version": "[4.*, 5.0.0)"
  }
}

-local.setting.json:
{
  "IsEncrypted": false,
  "Values": {
    "AzureWebJobsStorage": "UseDevelopmentStorage=true",
    "FUNCTIONS_WORKER_RUNTIME": "python",
    "AzureWebJobsServiceBus": "myKey"
  }
}

问题是,即使没有进行配置更改,有时该功能在Azure功能中不再可见。
您认为可能是什么问题?

每次您部署时都会发生这种情况?另外,如果不可见功能,它们仍在工作吗?就像您的HTTP触发是否可以工作?

我在应用程序服务之前遇到了这个问题;但是,我缺少这两个环境变量
python azure-functions message-queue azureservicebus azure-http-trigger
1个回答
0
投票
SCM_DO_BUILD_DURING_DEPLOYMENT : true ENABLE_ORYX_BUILD : true

there是全部设置列表,并提供说明:

https://learn.microsoft.com/en-us/azure/azure-functions/functions-app-settings

	

最新问题
© www.soinside.com 2019 - 2025. All rights reserved.