在一些部署我在做一个 App Service
资源中包含2个插槽(a production
和 staging
槽),webjob的临时并不停止之后交换的时隙。
基本上我有在我的管线以下任务:
## Start App Service (staging)
- task: AzureAppServiceManage@0
displayName: 'Start Azure App Service: some-app-webjob (staging)'
inputs:
azureSubscription: 'xxx'
Action: 'Start Azure App Service'
WebAppName: 'some-app-webjob'
SpecifySlotOrASE: true
ResourceGroupName: 'some-rg-app-webjob'
Slot: staging
##Start staging continuous webjob
- task: AzureAppServiceManage@0
displayName: 'Start all continuous webjobs: some-app-webjob (staging)'
inputs:
azureSubscription: 'Subscrição do Visual Studio Enterprise(c9f20c2b-15cf-41fb-8122-ddf095c6db02)'
Action: 'Start all continuous webjobs'
WebAppName: 'some-app-webjob'
SpecifySlotOrASE: true
ResourceGroupName: 'some-rg-app-webjob'
Slot: 'staging'
## Swap Slots (staging to production)
- task: AzureAppServiceManage@0
displayName: 'Swap Slots: some-app-webjob'
inputs:
azureSubscription: 'xxx'
WebAppName: 'some-app-webjob'
ResourceGroupName: 'some-rg-app-webjob'
SourceSlot: staging
TargetSlot: production
# Stop WebJobs running Staging
- task: AzureAppServiceManage@0
displayName: 'Stop all continuous webjobs: some-app-webjob (staging)'
inputs:
azureSubscription: 'xxx'
Action: 'Stop all continuous webjobs'
WebAppName: 'some-app-webjob'
SpecifySlotOrASE: true
ResourceGroupName: 'some-rg-app-webjob'
Slot: staging
## Stop App Service (staging)
- task: AzureAppServiceManage@0
displayName: 'Stop Azure App Service: some-app-webjob (staging)'
inputs:
azureSubscription: 'xxx'
Action: 'Stop Azure App Service'
WebAppName: 'some-app-webjob'
SpecifySlotOrASE: true
ResourceGroupName: 'some-rg-app-webjob'
Slot: staging
如果我去看看我的老虎临时的应用程序服务是停止。 但有时workjob保持运行时,它不应该。 因为我有一个任务,应该有持续web作业之后交换与生产。
在总结这可能发生这样的情况:
- 连续webjob在隙临时运行
- 连续webjob在隙生产运行的
搜索后,我发现这个线。 https://github.com/projectkudu/kudu/issues/1886 它表示web作业的运行在scm网站而不受停止网站的命令。 不过,我有一个任务,应停止所有连续web作业.
没有任何理由为这样的事情发生? 我们如何才能防止这个吗? 我不想一个webjob与老码运行之后的部署。
WEBJOBS_STOPPED
是一个很好的解决方案应用到临时隙。 它不会优雅地停止webjob这是交换?