azure-powershell icon indicating copy to clipboard operation
azure-powershell copied to clipboard

ARM :: WebApp Web Job Cmdlets

Open pcgeek86 opened this issue 11 years ago • 58 comments

Symptom

Azure Web App Web Job cmdlets are unavailable in Azure Resource Manager (ARM) PowerShell module.

Root Cause

Azure Web App Web Job cmdlets have not been implemented in the Azure Resource Manager (ARM) PowerShell module.

Action Items

  • Implement Azure Web App Web Job cmdlets in Azure Resource Manager (ARM) PowerShell module.

Cheers, Trevor Sullivan Microsoft MVP: PowerShell https://trevorsullivan.net https://twitter.com/pcgeek86

pcgeek86 avatar Jul 28 '15 18:07 pcgeek86

I was looking for this as well and I was surprised to not find it.

rajinders avatar Aug 04 '15 15:08 rajinders

Is there any deadline when this might be available?

vdangwal avatar Aug 26 '16 15:08 vdangwal

Is there a way to deploy Azure Web Job using Resource Manger (RM) PowerShell?

SergeyRudakov avatar Dec 01 '16 18:12 SergeyRudakov

Almost 2 years later, any suggestions to manage webjobs via powershell?

Zenuka avatar Apr 07 '17 09:04 Zenuka

Sigh....

CtrlDot avatar May 31 '17 18:05 CtrlDot

Would be appreciated indeed...

madmox avatar Jun 02 '17 13:06 madmox

Please ....

deekob avatar Jun 29 '17 06:06 deekob

Until proper cmdlets are implemented, you can perform some tasks through the raw AzureRmResource* cmdlets

#Get a continuous job
Get-AzureRmResource `
    -ResourceGroup $resourceGroup `
    -ResourceType microsoft.web/sites/continuouswebjobs `
    -ResourceName $siteName/$jobName `
    -ApiVersion 2016-08-01

#Stop a job
Invoke-AzureRmResourceAction `
    -ResourceGroup $resourceGroup `
    -ResourceType microsoft.web/sites/continuouswebjobs `
    -ResourceName $siteName/$jobName `
    -Action stop `
    -ApiVersion 2016-08-01 `
    -Force

If you want more details on the available resource actions for webjobs use

Get-AzureRmProviderOperation 'microsoft.web/sites/*' |? Operation -like *job*

afscrome avatar Jul 05 '17 16:07 afscrome

@Nking92 Hey Nicholas, do you know if this functionality is on the radar for your team? It seems to be a heavily requested feature.

cormacpayne avatar Nov 16 '17 16:11 cormacpayne

@Nking92 @cormacpayne If it's not on the radar, then could you offer some examples using Invoke-AzureRmResourceAction for creating a WebJob, including the artifact upload?

mrichman avatar Nov 16 '17 16:11 mrichman

Just to add more context to my previous question, I'm trying to deploy a web job into an App Service from TFS. I can FTP upload the bits to Azure from TFS, but I can't create or configure a web job programmatically.

mrichman avatar Nov 17 '17 13:11 mrichman

I just tried using New-AzureRmResource to create a web job, and got this error:

New-AzureRmResource -ResourceName $siteName/$jobName -ResourceGroupName $resourceGroup -ResourceType microsoft.web/sites/continuouswebjobs -ApiVersion $Apiversion -Verbose

New-AzureRmResource : {"Code":"InternalServerError","Message":"{\"Message\":\"An error has occurred.\",\"ExceptionMessage\":\"Object reference not set to an instance of an 
object.\",\"ExceptionType\":\"System.NullReferenceException\",\"StackTrace\":\"   at Kudu.Services.Jobs.JobsController.CreateContinuousJobArm(String jobName, ArmEntry`1 armContinuousJob)\\r\\n   at 
lambda_method(Closure , Object , Object[] )\\r\\n   at System.Web.Http.Controllers.ReflectedHttpActionDescriptor.ActionExecutor.<>c__DisplayClass10.<GetExecutor>b__9(Object instance, Object[] 
methodParameters)\\r\\n   at System.Web.Http.Controllers.ReflectedHttpActionDescriptor.ExecuteAsync(HttpControllerContext controllerContext, IDictionary`2 arguments, CancellationToken 
cancellationToken)\\r\\n--- End of stack trace from previous location where exception was thrown ---\\r\\n   at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw()\\r\\n   at 
System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)\\r\\n   at 
System.Web.Http.Controllers.ApiControllerActionInvoker.<InvokeActionAsyncCore>d__0.MoveNext()\\r\\n--- End of stack trace from previous location where exception was thrown ---\\r\\n   at 
System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw()\\r\\n   at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)\\r\\n   at 
System.Web.Http.Filters.ActionFilterAttribute.<CallOnActionExecutedAsync>d__5.MoveNext()\\r\\n--- End of stack trace from previous location where exception was thrown ---\\r\\n   at 
System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw()\\r\\n   at System.Web.Http.Filters.ActionFilterAttribute.<CallOnActionExecutedAsync>d__5.MoveNext()\\r\\n--- End of stack trace from previous 
location where exception was thrown ---\\r\\n   at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw()\\r\\n   at 
System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)\\r\\n   at 
System.Web.Http.Filters.ActionFilterAttribute.<ExecuteActionFilterAsyncCore>d__0.MoveNext()\\r\\n--- End of stack trace from previous location where exception was thrown ---\\r\\n   at 
System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw()\\r\\n   at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)\\r\\n   at 
System.Web.Http.Filters.ActionFilterAttribute.<CallOnActionExecutedAsync>d__5.MoveNext()\\r\\n--- End of stack trace from previous location where exception was thrown ---\\r\\n   at 
System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw()\\r\\n   at System.Web.Http.Filters.ActionFilterAttribute.<CallOnActionExecutedAsync>d__5.MoveNext()\\r\\n--- End of stack trace from previous 
location where exception was thrown ---\\r\\n   at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw()\\r\\n   at 
System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)\\r\\n   at 
System.Web.Http.Filters.ActionFilterAttribute.<ExecuteActionFilterAsyncCore>d__0.MoveNext()\\r\\n--- End of stack trace from previous location where exception was thrown ---\\r\\n   at 
System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw()\\r\\n   at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)\\r\\n   at 
System.Web.Http.Controllers.ActionFilterResult.<ExecuteAsync>d__2.MoveNext()\\r\\n--- End of stack trace from previous location where exception was thrown ---\\r\\n   at 
System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw()\\r\\n   at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)\\r\\n   at 
System.Web.Http.Controllers.ExceptionFilterResult.<ExecuteAsync>d__0.MoveNext()\\r\\n--- End of stack trace from previous location where exception was thrown ---\\r\\n   at 
System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw()\\r\\n   at System.Web.Http.Controllers.ExceptionFilterResult.<ExecuteAsync>d__0.MoveNext()\\r\\n--- End of stack trace from previous location 
where exception was thrown ---\\r\\n   at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw()\\r\\n   at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task 
task)\\r\\n   at System.Web.Http.Dispatcher.HttpControllerDispatcher.<SendAsync>d__1.MoveNext()\"}","Target":null,"Details":[{"Message":"{\"Message\":\"An error has 
occurred.\",\"ExceptionMessage\":\"Object reference not set to an instance of an object.\",\"ExceptionType\":\"System.NullReferenceException\",\"StackTrace\":\"   at 
Kudu.Services.Jobs.JobsController.CreateContinuousJobArm(String jobName, ArmEntry`1 armContinuousJob)\\r\\n   at lambda_method(Closure , Object , Object[] )\\r\\n   at 
System.Web.Http.Controllers.ReflectedHttpActionDescriptor.ActionExecutor.<>c__DisplayClass10.<GetExecutor>b__9(Object instance, Object[] methodParameters)\\r\\n   at 
System.Web.Http.Controllers.ReflectedHttpActionDescriptor.ExecuteAsync(HttpControllerContext controllerContext, IDictionary`2 arguments, CancellationToken cancellationToken)\\r\\n--- End of stack trace 
from previous location where exception was thrown ---\\r\\n   at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw()\\r\\n   at 
System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)\\r\\n   at 
System.Web.Http.Controllers.ApiControllerActionInvoker.<InvokeActionAsyncCore>d__0.MoveNext()\\r\\n--- End of stack trace from previous location where exception was thrown ---\\r\\n   at 
System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw()\\r\\n   at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)\\r\\n   at 
System.Web.Http.Filters.ActionFilterAttribute.<CallOnActionExecutedAsync>d__5.MoveNext()\\r\\n--- End of stack trace from previous location where exception was thrown ---\\r\\n   at 
System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw()\\r\\n   at System.Web.Http.Filters.ActionFilterAttribute.<CallOnActionExecutedAsync>d__5.MoveNext()\\r\\n--- End of stack trace from previous 
location where exception was thrown ---\\r\\n   at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw()\\r\\n   at 
System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)\\r\\n   at 
System.Web.Http.Filters.ActionFilterAttribute.<ExecuteActionFilterAsyncCore>d__0.MoveNext()\\r\\n--- End of stack trace from previous location where exception was thrown ---\\r\\n   at 
System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw()\\r\\n   at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)\\r\\n   at 
System.Web.Http.Filters.ActionFilterAttribute.<CallOnActionExecutedAsync>d__5.MoveNext()\\r\\n--- End of stack trace from previous location where exception was thrown ---\\r\\n   at 
System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw()\\r\\n   at System.Web.Http.Filters.ActionFilterAttribute.<CallOnActionExecutedAsync>d__5.MoveNext()\\r\\n--- End of stack trace from previous 
location where exception was thrown ---\\r\\n   at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw()\\r\\n   at 
System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)\\r\\n   at 
System.Web.Http.Filters.ActionFilterAttribute.<ExecuteActionFilterAsyncCore>d__0.MoveNext()\\r\\n--- End of stack trace from previous location where exception was thrown ---\\r\\n   at 
System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw()\\r\\n   at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)\\r\\n   at 
System.Web.Http.Controllers.ActionFilterResult.<ExecuteAsync>d__2.MoveNext()\\r\\n--- End of stack trace from previous location where exception was thrown ---\\r\\n   at 
System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw()\\r\\n   at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)\\r\\n   at 
System.Web.Http.Controllers.ExceptionFilterResult.<ExecuteAsync>d__0.MoveNext()\\r\\n--- End of stack trace from previous location where exception was thrown ---\\r\\n   at 
System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw()\\r\\n   at System.Web.Http.Controllers.ExceptionFilterResult.<ExecuteAsync>d__0.MoveNext()\\r\\n--- End of stack trace from previous location 
where exception was thrown ---\\r\\n   at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw()\\r\\n   at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task 
task)\\r\\n   at 
System.Web.Http.Dispatcher.HttpControllerDispatcher.<SendAsync>d__1.MoveNext()\"}"},{"Code":"InternalServerError"},{"ErrorEntity":{"Code":"InternalServerError","Message":"{\"Message\":\"An error has 
occurred.\",\"ExceptionMessage\":\"Object reference not set to an instance of an object.\",\"ExceptionType\":\"System.NullReferenceException\",\"StackTrace\":\"   at 
Kudu.Services.Jobs.JobsController.CreateContinuousJobArm(String jobName, ArmEntry`1 armContinuousJob)\\r\\n   at lambda_method(Closure , Object , Object[] )\\r\\n   at 
System.Web.Http.Controllers.ReflectedHttpActionDescriptor.ActionExecutor.<>c__DisplayClass10.<GetExecutor>b__9(Object instance, Object[] methodParameters)\\r\\n   at 
System.Web.Http.Controllers.ReflectedHttpActionDescriptor.ExecuteAsync(HttpControllerContext controllerContext, IDictionary`2 arguments, CancellationToken cancellationToken)\\r\\n--- End of stack trace 
from previous location where exception was thrown ---\\r\\n   at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw()\\r\\n   at 
System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)\\r\\n   at 
System.Web.Http.Controllers.ApiControllerActionInvoker.<InvokeActionAsyncCore>d__0.MoveNext()\\r\\n--- End of stack trace from previous location where exception was thrown ---\\r\\n   at 
System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw()\\r\\n   at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)\\r\\n   at 
System.Web.Http.Filters.ActionFilterAttribute.<CallOnActionExecutedAsync>d__5.MoveNext()\\r\\n--- End of stack trace from previous location where exception was thrown ---\\r\\n   at 
System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw()\\r\\n   at System.Web.Http.Filters.ActionFilterAttribute.<CallOnActionExecutedAsync>d__5.MoveNext()\\r\\n--- End of stack trace from previous 
location where exception was thrown ---\\r\\n   at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw()\\r\\n   at 
System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)\\r\\n   at 
System.Web.Http.Filters.ActionFilterAttribute.<ExecuteActionFilterAsyncCore>d__0.MoveNext()\\r\\n--- End of stack trace from previous location where exception was thrown ---\\r\\n   at 
System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw()\\r\\n   at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)\\r\\n   at 
System.Web.Http.Filters.ActionFilterAttribute.<CallOnActionExecutedAsync>d__5.MoveNext()\\r\\n--- End of stack trace from previous location where exception was thrown ---\\r\\n   at 
System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw()\\r\\n   at System.Web.Http.Filters.ActionFilterAttribute.<CallOnActionExecutedAsync>d__5.MoveNext()\\r\\n--- End of stack trace from previous 
location where exception was thrown ---\\r\\n   at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw()\\r\\n   at 
System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)\\r\\n   at 
System.Web.Http.Filters.ActionFilterAttribute.<ExecuteActionFilterAsyncCore>d__0.MoveNext()\\r\\n--- End of stack trace from previous location where exception was thrown ---\\r\\n   at 
System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw()\\r\\n   at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)\\r\\n   at 
System.Web.Http.Controllers.ActionFilterResult.<ExecuteAsync>d__2.MoveNext()\\r\\n--- End of stack trace from previous location where exception was thrown ---\\r\\n   at 
System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw()\\r\\n   at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)\\r\\n   at 
System.Web.Http.Controllers.ExceptionFilterResult.<ExecuteAsync>d__0.MoveNext()\\r\\n--- End of stack trace from previous location where exception was thrown ---\\r\\n   at 
System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw()\\r\\n   at System.Web.Http.Controllers.ExceptionFilterResult.<ExecuteAsync>d__0.MoveNext()\\r\\n--- End of stack trace from previous location 
where exception was thrown ---\\r\\n   at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw()\\r\\n   at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task 
task)\\r\\n   at System.Web.Http.Dispatcher.HttpControllerDispatcher.<SendAsync>d__1.MoveNext()\"}"}}],"Innererror":null}
At C:\Users\mrichman\OneDrive - Campus Management Corp\Azure\Code\New-WebJob.ps1:11 char:1
+ New-AzureRmResource -ResourceName $siteName/$jobName -ResourceGroupNa ...
+ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
    + CategoryInfo          : CloseError: (:) [New-AzureRmResource], ErrorResponseMessageException
    + FullyQualifiedErrorId : InternalServerError,Microsoft.Azure.Commands.ResourceManager.Cmdlets.Implementation.NewAzureResourceCmdlet

mrichman avatar Nov 17 '17 15:11 mrichman

Feature request for managing web jobs via Azure RM gets my support too. We have all our deployments automated with Powershell. We are about to introduce a web job to our solution and it came as a surprise today to see there was no way to automate it.

AlexSanseau avatar Dec 01 '17 13:12 AlexSanseau

@AlexSanseau I have a meeting this morning with the Microsoft OCP team to discuss this very issue. I'll report back with their comments.

mrichman avatar Dec 01 '17 14:12 mrichman

@AlexSanseau @mrichman Probably the best solution is Zip Deployment using Kudu API. Here is are sample scripts that demonstrate deploying a Web Job.

kevinhillinger avatar Dec 05 '17 16:12 kevinhillinger

I was looking for this as well, so that we can switch from using Classic commandlets to Azure RM commandlets in our VSTS deployment tasks.

timvandenhof avatar Jan 08 '18 13:01 timvandenhof

@Nking92 gentle ping

cormacpayne avatar Jan 17 '18 02:01 cormacpayne

Any news :(

bebeo92 avatar Apr 06 '18 08:04 bebeo92

We don't have an ETA for this support. @ahmedelnably as FYI

panchagnula avatar Apr 06 '18 17:04 panchagnula

This is something I need as well, in order to get slot swaps working the way I want to (stopping jobs in the non-production slot).

erick-thompson avatar Apr 23 '18 22:04 erick-thompson