Failure when running swap slot task due to task using unexpected parameter during execution
See original GitHub issueType: BUG
Enter Task Name: Swap slots
Environment
- Server - Azure Pipelines
- Agent - Private (2016 Data center, agent version: 2.155.1)
Issue Description
We have began to encounter the following issue with release pipelines using the “Swap slots” task. This has only started happening today, with all previous releases working as expected without any pipelines updates.
The “Swap slots” task is failing with the following message:
2019-09-24T09:02:11.3402222Z ##[section]Starting: App : Swap Slot
2019-09-24T09:02:11.3581484Z ==============================================================================
2019-09-24T09:02:11.3581617Z Task : Azure App Service manage
2019-09-24T09:02:11.3581712Z Description : Start, stop, restart, slot swap, slot delete, install site extensions or enable continuous monitoring for an Azure App Service
2019-09-24T09:02:11.3581840Z Version : 0.2.59
2019-09-24T09:02:11.3581907Z Author : Microsoft Corporation
2019-09-24T09:02:11.3582013Z Help : https://docs.microsoft.com/azure/devops/pipelines/tasks/deploy/azure-app-service-manage
2019-09-24T09:02:11.3582102Z ==============================================================================
2019-09-24T09:02:12.0901116Z ##[error]Error: Failed to fetch App Service 'sample-app-$(arm.siteSlotName)' details. Error: The Resource 'Microsoft.Web/sites/sample-app/slots/$(arm.siteSlotName)' under resource group 'sample-app-rg' was not found. (CODE: 404)
2019-09-24T09:02:12.0939769Z ##[section]Finishing: App : Swap Slot
The error includes a variable $(arm.siteSlotName)
that is not defined anywhere in the visible UI, however when exporting the pipeline and searching I have discovered the following:
{
"environment": {},
"taskId": "f045e430-8704-11e6-968f-e717e6411619",
"version": "0.*",
"name": "App : Swap Slot",
"refName": "",
"enabled": true,
"alwaysRun": false,
"continueOnError": false,
"timeoutInMinutes": 0,
"definitionType": "task",
"overrideInputs": {},
"condition": "succeeded()",
"inputs": {
"ConnectedServiceName": "xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx",
"Action": "Swap Slots",
"WebAppName": "$(arm.app_siteName)",
"SpecifySlot": "true",
"ResourceGroupName": "$(rg.name)",
"SourceSlot": "$(arm.app_siteSlotName)",
"SwapWithProduction": "true",
"TargetSlot": "",
"PreserveVnet": "false",
"Slot": "$(arm.siteSlotName)",
"ExtensionsList": "",
"OutputVariable": "",
"AppInsightsResourceGroupName": "",
"ApplicationInsightsResourceName": "",
"ApplicationInsightsWebTestName": ""
}
}
Within this snippet the task action is Swap Slots
, with the parameter SourceSlot
shown in the UI and completed correctly. However, the Slot
parameter is also listed and completed with a different variable. This is the case because we frequently copy and clone tasks within a pipeline and alter the action and update the parameters. I would appear that a recent update is causing the “Swap slots” task to fail due to this extra parameter not related to its own action:
If I change only the action for this task the following is displayed:
In order to workaround/fix this issue we have had to manual alter each task, switch the action, delete the value in Slot
and re-save the pipeline.
Issue Analytics
- State:
- Created 4 years ago
- Comments:5 (3 by maintainers)
Top GitHub Comments
Thank you @eaarora-ms
The issue is fixed and will be rolled out in a couple of weeks. I hope this is not a blocker for you since you can remove and add the task again to get rid of the old slot name value.