我在Azure中安排了一个每晚运行的WebJob。 偶尔,我发现我需要在白天任意时间运行这项工作。
我希望能够在我喜欢的时候手动重新运行这份工作。 这可能吗? 我可以在门户网站上看到调度程序设置为点击URL:
https://XXX.scm.azurewebsites.net/api/triggeredjobs/YYY/run
使用POST 。 我试过自己点击这个URL。 如果我这样做是GET ,我会得到404,如果我尝试POST那么我会收到授权失败:
401 - 未授权:由于凭据无效,访问被拒绝
我可以构建必要的标题或任何做auth的东西,但这感觉就像牦牛剃须。
这似乎(对我而言)就像一个简单的用例,并且肯定在Azure门户或Kudo的某个地方有一个按钮?
I have a scheduled WebJob in Azure that runs nightly. Occasionally, I find that I need to run this job during the day at arbitrary times.
I would like to be able to manually re-run the job when I feel like it. Is this possible? I can see in the portal that the scheduler is set to hit the URL:
https://XXX.scm.azurewebsites.net/api/triggeredjobs/YYY/run
using a POST. I have tried to hit this URL myself. If I do it as a GET, I get a 404, and if I try a POST then I get an authorisation failure:
401 - Unauthorized: Access is denied due to invalid credentials
I could probably construct the necessary headers or whatever to do the auth, but this feels like yak shaving.
This seems (to me) like a trivial use case, and one that surely there's a button for somewhere in the Azure portal or Kudo?
最满意答案
请求需要身份验证(你应该对此感到高兴:)) 这篇文章展示了如何形成正确的基本身份验证URL以调用你的工作,并解释了你可能感兴趣的幕后工作方式。
但是, 您也可以从门户网站运行您的作业 。 如果右键单击要运行的作业的门户,您将看到“运行”上下文菜单项。 我知道不是很难发现:(
There is authentication required on the request (you should be happy about that :)) This post shows how to form the correct basic auth URL to invoke your job, and also explains how things work behind the scenes which may interest you.
However, you can also run your job from the portal. If you right click in the portal on the job you want to run, you'll see a "Run" context menu item. Not very discoverable I know :(
更多推荐
发布评论