0

I am trying to build a pipeline using YAML to deploy web jobs in azure app service. How to list the existing web jobs? I tried to use AzurePowerShell@5 task with following script:

Get-AzResource -ResourceGroupName "RESGRPDEV01" | ft

But it does not show the web job name. Could you please help? Also, I need to create a new web job if it does not exists.

user3441903
  • 77
  • 10

2 Answers2

0

Earlier there was a specific command to achieve the same, but now you can't use Get-AzureWebsiteJob to get web jobs.

Instead you could try the below,

Get-AzureRmResource -ResourceGroupName $ResourceGroupName -ResourceName $AppService -ResourceType microsoft.web/sites/<Webjob-type> -ApiVersion $Apiversion

enter image description here

You will need to use the ResourceId to get the names.

Sajeetharan
  • 216,225
  • 63
  • 350
  • 396
0

Azure CLI might help too.

az webapp webjob triggered list --name MyWebApp --resource-group MyResourceGroup

Additionally, you can query the above result and get the desired information you are looking for

az webapp webjob triggered list --name MyWebApp --resource-group MyResourceGroup  --query "[].{Name:name, Schedule:settings.schedule}"
EZR
  • 63
  • 6