[BUG]: AzureWebAppContainer@1
should error if App Service Resource Kind is not a container (such as "app,linux")
#19785
Labels
New issue checklist
Task name
AzureWebAppContainer
Task version
1
Issue Description
This is related, but not the same as #14805.
AzureWebAppContainer
should validate and error if the App Service Resource Kind is not within the supportedosTypeMap
azure-pipelines-tasks/Tasks/AzureWebAppContainerV1/taskparameters.ts
Lines 8 to 11 in e973086
I have just spent a day tracking down why
AzureWebAppContainer
doesn't work for our configuration. We are migrating to use containers with App Service. Since the docs makes no mention of changing the resource kind, I had foolishly left it asapp,linux
.What caused the most confusion was the successful task, and the Azure Portal which showed the correct container image.
I dug into this a little bit, and I've figured out what is going wrong. When the App Service Resource Kind is not within the
osTypeMap
, thegetWebAppKind
returnsosType
asundefined
.azure-pipelines-tasks/Tasks/AzureWebAppContainerV1/taskparameters.ts
Lines 53 to 74 in e973086
This propagates uncaught to
deployWebAppImage
because it usesproperties: any
, which in turn calls_updateConfigurationDetails
.azure-pipelines-tasks/Tasks/AzureWebAppContainerV1/operations/ContainerBasedDeploymentUtility.ts
Lines 56 to 73 in e973086
Here, since
isLinuxApp = undefined
andundefined
is falsy,windowsFxVersion
gets set to the specified image. This in turn is displayed under the Azure Portal under "Properties > Web App > {Publishing model, Container Image}", fooling me into thinking something else was going wrong.It would be really useful if
AzureWebAppContainer
validated the kind parameter and creates a runtime error instead of silently continuing!Environment type (Please select at least one enviroment where you face this issue)
Azure DevOps Server type
dev.azure.com (formerly visualstudio.com)
Relevant log output
Repro steps
The text was updated successfully, but these errors were encountered: