简体   繁体   English

禁用的Azure功能仍将消息从Azure存储队列中拉出

[英]Disabled Azure Function Still Pulls Messages off of Azure Storage Queue

I have a basic QueueTrigger Azure function. 我有一个基本的QueueTrigger Azure函数。 When I disable the function in the azure portal it's still pulling messages off the storage queue (because when I look at the queue in the Azure Queue Storage Explorer the queue is empty and if i add a message it is immediately pulled off). 当我在azure门户中禁用该功能时,它仍将消息从存储队列中拉出(因为当我在Azure队列存储资源管理器中查看队列时,该队列为空,如果我添加一条消息,则会立即将其拉出)。

Here is the code: 这是代码:

[FunctionName("ProcessMessage")]
public static void Run([QueueTrigger("queue-name", Connection = "queue-connection")] Models.Message message, TraceWriter log)
{
    log.Info($"C# Queue trigger function processed: {message}");
}

I noticed that when I stop the whole functions app it stops processing messages off the queue, but I was hoping that I could disable queue processing temporarily without stopping the whole function app. 我注意到,当我停止整个功能应用程序时,它将停止处理队列外的消息,但是我希望我可以暂时禁用队列处理而无需停止整个功能应用程序。 How does one do that? 怎么做到的?

Thanks! 谢谢!

Disabling the V1 function created in Visual Studio does not work in the azure portal. 禁用在Visual Studio中创建的V1功能在Azure门户中不起作用。 You should use the attribute: 您应该使用以下属性:

https://docs.microsoft.com/en-us/azure/azure-functions/disable-function#functions-1x---c-class-libraries (see important section) https://docs.microsoft.com/zh-cn/azure/azure-functions/disable-function#functions-1x---c-class-libraries (请参阅重要部分)

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM