[英]How can I retrieve the queue name for a service bus queue from my remote Azure App Configuration using the Java SDK?
The function app I'm working on works perfectly when setting my config using a local.settings.json file.当使用 local.settings.json 文件设置我的配置时,我正在开发的 function 应用程序完美运行。 I have set up a new App Configuration in Azure to manage the properties remotely but I have been getting the following error on startup:
我已经在 Azure 中设置了一个新的 App Configuration 来远程管理属性,但是我在启动时遇到了以下错误:
[2022-04-01T14:34:07.209Z] The 'QueueTrigger' function is in error: Microsoft.Azure.WebJobs.Host: Error indexing method 'Functions.QueueTrigger'. Microsoft.Azure.WebJobs.Host: '%QueueName%' does not resolve to a value.
I'm picking up the correct connection string value without any issues but it appears that the queueName property of the @ServiceBusQueueTrigger is not detecting the queue name variable I have set in the azure config.我正在毫无问题地获取正确的连接字符串值,但似乎 @ServiceBusQueueTrigger 的 queueName 属性没有检测到我在 azure 配置中设置的队列名称变量。
@FunctionName("QueueTrigger")
public void serviceBusProcess(
@ServiceBusQueueTrigger(
name = "message",
queueName = "%QueueName%",
connection = "QueueConnectionString"
) String message, final ExecutionContext context) {
// process message
}
Is there a way to insert this variable without having to hard-code the value?有没有办法插入这个变量而不必对值进行硬编码?
Speaking from a .NET perspective, I haven't found a solution until today than hardcoding the value.从 .NET 的角度来看,直到今天我还没有找到比硬编码值更好的解决方案。 I guess it is required by the runtime to bind to the queue to the trigger.
我想运行时需要将队列绑定到触发器。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.