-
Notifications
You must be signed in to change notification settings - Fork 2.6k
AzureWebAppContainerV1 incorrectly sets 'windowsFxVersion' for linux container #14805
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Comments
are you sure kind property is set to |
Yes, I can confirm this. I've done some experimentation - I think the heuristic being followed is "if linuxFxVersion is set, update that, otherwise update windowsFxVersion" - I don't think the isLinux flag is being passed down to whatever common code is actually setting this property. |
Can you set |
I'll have to set up a new pipeline to repro but will make some time to do so. |
I'm having the same issue. We are setting the kind to |
@KasperPurunen can you share debug logs? |
Here is the debug log for the deploy azure resources stage: Here is the debug log for the AzureWebAppContainer stage: |
@AmrutaKawade Were those logs helpful? Do you need any more detail? |
Any plans to solve this issue soon? |
@jbowtie , @KasperPurunen For us Whenever app is created without linuxFXVersion in ARM template, app kind is set to as app,linux and not app,linux,container Can any one of you confirm this behavior ?, |
Due to inactivity we are closing this. If it is still exists please raise a new bug |
@PhilipsonJoseph This issue is still outstanding. As you note above, any ARM template deployed without |
@nadesu @PhilipsonJoseph @v-nagarajku do you know when we might see a review for this one line correction and an update to the task? I ask as this is currently blocking my team from being able to use this task as intended, and we will need to make alternative plans if we think this may take some time to make it's way out. Thank you. |
For anyone still struggling with this issue, we worked around it by not using the task at all and instead setting This allowed us to get the staging slot set up correctly with the latest image without disrupting the production slot, perform our testing, etc. then swap slots per the usual process to get the desired image into the production slot. |
I am using Azure CLI |
I just ran into this naturally, tearing my hair out for hours trying to figure out whats going on |
I've hit this issue recently also. I have some Bicep templates that I am using to deploy App Service resources (and other things) within a pipeline, and do not want to set If I don't set As per the issue description, setting a placeholder I have also now switched to use In case it's helpful to have an example, I have switched this: - task: AzureWebAppContainer@1
displayName: 'Deploy to web app'
inputs:
azureSubscription: '$(ServiceConnection)'
appName: '$(WebAppName)'
multicontainerConfigFile: '$(Pipeline.Workspace)/path/to/docker-compose.yml'
deployToSlotOrASE: true
resourceGroupName: '$(ResourceGroupName)'
slotName: '$(WebAppDeploySlotName)' To this: - task: AzureCLI@2
displayName: 'Deploy to web app'
inputs:
azureSubscription: '$(ServiceConnection)'
scriptType: pscore
scriptLocation: inlineScript
inlineScript: |
az webapp config container set --name "$(WebAppName)" --resource-group "$(ResourceGroupName)" --multicontainer-config-file "$(Pipeline.Workspace)/path/to/docker-compose.yml" --multicontainer-config-type COMPOSE --slot "$(WebAppDeploySlotName)" |
Having had a brief look at the source code for this task, it seems to me that it always looks at the main web site setting when determining whether it is a Linux service, even if you are deploying to a deployment slot:
This seems to be the reason for this task failing in the my situation. |
We've also just hit this after spending the afternoon trying to work out why our DevOps deployed image wasn't working. Same issue. |
I just spent an hour debugging this as well. The I used the Azure CLI to set the Is there a way to reset the |
Just FYI, I switched to the
|
Just spent a day trying to understand why my deployed linux container wasn't working. How the container deploy task does not work for linux is super confusing. It wasn't until I did |
This one also caused me some grief lately (situation is complicated by the fact I'm using Terraform for IaC and deploying compose instead of single dockerfile). @CMeeg's workaround worked, but it would be interesting to know proper way to handle this. |
@PhilipsonJoseph Was this resolved? It is still occurring, and we encountered it this week. |
Spent an entire day troubleshooting the issue of why the docker image would not run a Linux web app when deployed through the pipeline. Finally found the difference in the Has there been any updates on this issue? If not, I believe at least the |
A colleague of mine found a good workaround for this using bicep templates. resource sites_WebService 'Microsoft.Web/sites@2021-03-01' = {
name: webServiceName
location: location
kind: 'app,linux,container'
identity: {
type: 'SystemAssigned'
}
properties: {
enabled: true
reserved: true
.......omittet for brevity
}
tags: tags
} Then set the config, where we either use the existing value, or set a placeholder resource sites_app_invoemailtrackingapi_config 'Microsoft.Web/sites/config@2022-09-01' = {
parent: sites_WebService
name: 'web'
properties: {
netFrameworkVersion: 'v6.0'
vnetRouteAllEnabled: true
acrUseManagedIdentityCreds: true
alwaysOn: true
linuxFxVersion: empty(sites_WebService.properties.siteConfig.linuxFxVersion) || sites_WebService.properties.siteConfig.linuxFxVersion == null ? 'DOCKER|alpine' : sites_WebService.properties.siteConfig.linuxFxVersion
minTlsVersion: '1.2'
}
} This will prevent the app from restarting and using the wrong image, since there is no changes. |
I still have this issue when using AzureRmWebAppDeployment@4. When I update the Tag of a container which runs as "app,linux,container", the AzureRmWebAppDeployment@4 process updates the "LinuxFxVersion". But when I open the container settings in Azure Portal, it seems that the container runs the "WindowsFxVersion" which isn't updated. As a workaround, I now also explicitly set the "SiteConfig" Properties when running the AzureRmWebAppDeployment@4. And this works. When updating the tag of a container, it now downloads this correct version when starting the container. This is my Task now:
|
I want to run bicep and inject my docker.compose file: |
anyone who still cares, maybe if you vote for https://developercommunity.visualstudio.com/t/Make-AzureWebAppContainer-recognize-linu/10771718 we'll get some action |
FYI the AzureRmWebAppDeployment@4 work around has the unfortunate side affect of forcing the the workaround i went with was
this mutates windowsFxVersion to technically that hack is only needed once, but doesn't seem to hurt to do it every time |
This issue is stale because it has been open for 180 days with no activity. Remove the stale label or comment on the issue otherwise this will be closed in 5 days |
not stale |
Required Information
Type: Bug
Task Name: AzureWebAppContainer
Issue Description
When a Linux Web App with kind:
app,linux,container
does not have linuxFxVersion set (as can happen with an ARM Template), the AzureWebAppContainer incorrectly sets windowsFxVersion instead. This is difficult to debug as the deployment succeeds but the site does not come up.However, if linuxFxVersion is set to a placeholder value (such as "DOCKER|alpine") it will correctly be updated. (So there is a workaround).
Explicitly setting a placeholder value is undesirable for many workflows. For example:
Since the kind reliably indicates the OS, it seems very odd that the wrong configuration setting is updated.
Task logs
The text was updated successfully, but these errors were encountered: