Skip to content
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

az webapp config set --linux-fx-version always deploys "PHP version : 8.0.30" and not the specified linux-fx-version #28638

Closed
zockette opened this issue Mar 26, 2024 · 6 comments
Assignees
Labels
app-service-general Auto-Assign Auto assign by bot Auto-Resolve Auto resolve by bot bug This issue requires a change to an existing behavior in the product in order to be resolved. customer-reported Issues that are reported by GitHub users external to the Azure organization. Service Attention This issue is responsible by Azure service team. Web Apps az webapp

Comments

@zockette
Copy link

Describe the bug

When trying to change the stack (full switch like java => python or just version change python 3.12 => 3.8) with:
az webapp config set --name APP_NAME --slot SLOT_NAME --resource-group RG_NAME --subscription SUB_NAME --linux-fx-version "LINUX_FX_VERSION", the deployed container always ends-up being a PHP container ("PHP version : 8.0.30").

Related command

az webapp config set --name APP_NAME --slot SLOT_NAME --resource-group RG_NAME --subscription SUB_NAME --linux-fx-version "LINUX_FX_VERSION"

Errors

Deploying anything else than a PHP linux-version still deploys a PHP container.

az webapp config set --name APP_NAME --slot SLOT_NAME --resource-group RG_NAME --subscription SUB_NAME --linux-fx-version "PYTHON|3.12"
az webapp config set --name APP_NAME --slot SLOT_NAME --resource-group RG_NAME --subscription SUB_NAME --linux-fx-version "PYTHON:3.12"
az webapp config set --name APP_NAME --slot SLOT_NAME --resource-group RG_NAME --subscription SUB_NAME --linux-fx-version "NODE|18-lts"
az webapp config set --name APP_NAME --slot SLOT_NAME --resource-group RG_NAME --subscription SUB_NAME --linux-fx-version "NODE:18-lts"

They all cause this:

image

Issue script & Debug output

Pick a linux-fx-version from: az webapp list-runtimes --os-type linux (which seems to give outdated values by the way since JAVA 21is not listed there but can be picked from the Azure Portal).
Run: az webapp config set --name APP_NAME --slot SLOT_NAME --resource-group RG_NAME --subscription SUB_NAME --linux-fx-version "PYTHON:3.12"
Ssh to App Service Container and check what the deployed container is from the welcome message.

Expected behavior

Setting --linux-fx-version as a value from az webapp list-runtimes --os-type linux in az webapp config set should have the right container deployed.

Environment Summary

az --version
azure-cli 2.54.0
core 2.54.0
telemetry 1.1.0
Extensions:
bastion 0.3.0
Dependencies:
msal 1.24.0b2
azure-mgmt-resource 23.1.0b2

Additional context

I tried using the values from function apps as well as linux-fx-version, it doesn't work either (az functionapp list-runtimes --os linux --query "[].{stack:join(' ', [runtime, version]), LinuxFxVersion:linux_fx_version, SupportedFunctionsVersions:to_string(supported_functions_versions[])}" --output table, coming from https://learn.microsoft.com/en-us/azure/azure-functions/functions-app-settings#linuxfxversion.
I also tried fiddling around with --python-version but it seems to have no effect.

@zockette zockette added the bug This issue requires a change to an existing behavior in the product in order to be resolved. label Mar 26, 2024
Copy link

Hi @zockette,

2.54.0 is not the latest Azure CLI(2.58.0).

If you haven't already attempted to do so, please upgrade to the latest Azure CLI version by following https://learn.microsoft.com/en-us/cli/azure/update-azure-cli.

@azure-client-tools-bot-prd azure-client-tools-bot-prd bot added the Auto-Resolve Auto resolve by bot label Mar 26, 2024
@microsoft-github-policy-service microsoft-github-policy-service bot added customer-reported Issues that are reported by GitHub users external to the Azure organization. Web Apps az webapp labels Mar 26, 2024
@yonzhan
Copy link
Collaborator

yonzhan commented Mar 26, 2024

Thank you for opening this issue, we will look into it.

@microsoft-github-policy-service microsoft-github-policy-service bot added Service Attention This issue is responsible by Azure service team. Auto-Assign Auto assign by bot app-service-general labels Mar 26, 2024
Copy link
Contributor

Thanks for the feedback! We are routing this to the appropriate team for follow-up. cc @AzureAppServiceCLI, @antcp.

@Arthusmeng
Copy link

Yes, i have the same issues.
I think this is App service frame issues. maybe you container is running.
you can see it when you in azure resource explorer. Go to app service resource ,maybe see some run-time os have.
like this
image
Az cli have not command az webapp config delete only have az webapp config set --windows-fx-version.
I find fix it only using ARM . i hope microsoft add new command to fix it easy.

@seligj95
Copy link
Contributor

seligj95 commented Jan 29, 2025

Investigated what's going on here and the issue is the formatting when you input a value into the --linux-fx-version parameter. That site property can be interpreted as a free-text field, and if you don't input the value exactly as the platform needs it to be, you will get defaulted to whatever the current PHP version is. One way to see this is to go into the Azure portal and update the stack for the app in the configuration blade to the intended value. When you do that, you can see the format of the input it is looking for when you check what the linuxFxVersion gets set to. I'll have to dig deeper as to why this formatting is different than in other places.

The command does work when you format the input correctly though which means this is not a CLI issue, but rather a backend issue that needs to get addressed there. For that reason, I'm closing this issue but have added this to an internal tool for triage. I will update the parameter description in the meantime to callout this formatting specifically.

@seligj95
Copy link
Contributor

seligj95 commented Jan 29, 2025

Re-reading your comment, I see you have tried the right format for the value, so not sure why it didn't work. I tried to repro and was able to get it to work by using this like in the below screenshot. Can you update to the latest CLI version and try again?

Image

Image

and got this:

Image

@seligj95 seligj95 reopened this Jan 29, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
app-service-general Auto-Assign Auto assign by bot Auto-Resolve Auto resolve by bot bug This issue requires a change to an existing behavior in the product in order to be resolved. customer-reported Issues that are reported by GitHub users external to the Azure organization. Service Attention This issue is responsible by Azure service team. Web Apps az webapp
Projects
None yet
Development

No branches or pull requests

4 participants