Azure的网站调用的Azure

Azure的网站调用的Azure

本文介绍了我可以从Azure的网站调用的Azure webjob并把它传递参数?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有我想从一个Azure的网站调用的Azure webjob。我想从网站到webjob传递字符串参数。

I have an Azure webjob that I want to invoke from an Azure website. I want to pass string parameters from the website to the webjob.

我知道我可以调用webjob作为一个REST API(https://github.com/projectkudu/kudu/wiki/Web-jobs).


因此,我可以调用webjob不带任何参数:发布招聘/触发/ myjobname /运行

I know I can invoke the webjob as a REST API (https://github.com/projectkudu/kudu/wiki/Web-jobs).
So I can invoke the webjob without any parameters: POST jobs/triggered/myjobname/run

但在结尾添加参数,没有出现一起工作,即工作/触发/ myjobname /运行?myparam1 =值

But adding parameters at the end doesn't appear to be working, i.e. jobs/triggered/myjobname/run?myparam1=value1

我在Microsoft.WindowsAzure.Jobs使用属性绑定并没有提到我的情况下,只需绑定到Azure存储物品看到的信息(http://blogs.msdn.com/b/jmstall/archive/2014/01/28/trigger-bindings-and-route-parameters-in-azurejobs.aspx).

The information I see on using attributes in Microsoft.WindowsAzure.Jobs for binding doesn't mention my case, just binding to Azure storage items (http://blogs.msdn.com/b/jmstall/archive/2014/01/28/trigger-bindings-and-route-parameters-in-azurejobs.aspx).

就是我想做的事情是可行的?我需要做的是这样在Azure存储队列创建一个新的项目,以触发我webjob?

Is what I want to do doable? Do I need to do something like create a new item in an Azure storage queue to trigger my webjob?

感谢。

推荐答案

如果你想从你的网站调用WebJob,你能做的最好的事情简直是有你的网站里面的WebJob code和简单的调用code,你仍然可以轻松地从你的网站里使用WebJob SDK。 (用于调用SDK WebJobs样品的方法:http://thenextdoorgeek.com/post/WAWS-WebJob-to-upload-FREB-files-to-Azure-Storage-using-the-WebJobs-SDK).

If you want to invoke a WebJob from your Website, the best thing you can do is simply have the WebJob code inside your Website and simply call that code, you can still easily use the WebJob SDK from inside your Website. (for calling a WebJobs SDK method sample: http://thenextdoorgeek.com/post/WAWS-WebJob-to-upload-FREB-files-to-Azure-Storage-using-the-WebJobs-SDK).

您不想从你的网站调用WebJob的原因是,调用包含对你的网站,你不想存储的秘密(部署凭据)。

The reason you wouldn't want to invoke the WebJob from your Website is that the invocation contains a secret you rather not store on your Website (deployment credentials).

如果你愿意单独WebJob和网站code,做最好的办法是使用队列通信,WebJob监听的队列和网站推请求队列中。

If you rather separate WebJob and Website code, the best thing to do is to communicate using a queue, the WebJob listens on the queue and the Website pushes the request to the queue.

至于原来的问题,目前还没有办法参数传递给WebJob invoke调用。

Regarding the original question, currently there is no way to pass parameters to the WebJob invoke call.

这篇关于我可以从Azure的网站调用的Azure webjob并把它传递参数?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!

08-28 19:28