Hi Ronak Patel
Welcome to the Microsoft Q&A Platform!
You're encountering an issue where the Azure App Service Deploy task in your pipeline doesn't list Node.js 20 as an available runtime stack, causing deployments to revert to Node.js 18.
Update the Azure App Service Deploy Task:
Ensure you're using the latest version of the Azure App Service Deploy task in your pipeline, as older versions may not support Node.js 20.
Set the Node.js Version Using Azure CLI.
Incorporate an Azure CLI task in your pipeline to explicitly set the Node.js version to 20 for your App Service.
- task: AzureCLI@2
inputs:
azureSubscription: '<YourAzureSubscription>'
scriptType: 'bash'
scriptLocation: 'inlineScript'
inlineScript: |
az webapp config set --resource-group <ResourceGroupName> --name <AppName> --linux-fx-version "NODE|20"
Replace <YourAzureSubscription>
, <ResourceGroupName>
, and <AppName>
with your actual Azure subscription, resource group, and app name.
Add the WEBSITE_NODE_DEFAULT_VERSION
setting to your App Service to specify the Node.js version.
- task: AzureAppServiceSettings@1
inputs:
azureSubscription: '<YourAzureSubscription>'
appName: '<YourAppName>'
appSettings: |
[
{
"name": "WEBSITE_NODE_DEFAULT_VERSION",
"value": "20"
}
]
This configuration ensures that your App Service uses Node.js version 20.
Confirm that Azure App Service in your region supports Node.js 20.
As of November 2024, Azure App Service has announced support for Node.js 20.
If the Azure App Service Deploy task doesn't list Node.js 20, consider raising a support ticket or providing feedback to Microsoft to address this discrepancy.
If the answer is helpful, please click Accept Answer and kindly upvote it