It does not matter bicep version, you configure it by setting appropriate parameter to the resource. For Linux plans it’s LinuxFxVersion, same as in ARM, but a different syntax of writing. You need to see the app service documentation to get more details: https://learn.microsoft.com/en-us/azure/app-service/quickstart-arm-template
If you cannot figure out which property you need to set in bicep/ARM one option is to open developer tools in your browser and examine POST message sent by Portal to management.azure.com or go to resources.azure.com and see the details of the already configured (via Portal) resource or use export template functionality.
Edit:
For Windows App Service Plan setting up runtime stack is a bit complicated.
Basically, there's property netFrameworkVersion
which can be v3.0
v4.0
or v5.0
.
However to get the core It seems you need to manipulate with metadata in sites/config:
resource myAppService 'Microsoft.Web/sites@2021-01-01' = {
name: AppServiceName
location: Location
properties:{
serverFarmId: myAppServicePlan.id
}
resorce 'webConfig' config = {
name: 'web'
properties: {
metadata: [
{
name: 'CURRENT_STACK'
value: 'dotnetcore'
}
]
}
}
}
If you wish to get back to .NET or switch to .NET5 (and then to .NET6) you need to set back the value to dotnet
and use netFrameworkVersion property.
It seems that when you have CURRENT_STACK
with value dotnetcore
, the netFrameworkVersion
is ignored.
I extracted this knowledge from observing the PUT requests - what portal do when changing the stack. I don't know what options is to set different stacks like Java or PHP. Probably in similar way - some combination of CURRENT_STACK + other properties in sites/config 'web'.
It seems that there's no docs on this.
BTW - do not attempt to use it within Microsoft.Web/Sites
resource - use the Microsoft.web/sites/config
with web
name instead. I had history when although I could use those options under siteConfig property, it was not set by the resource provider API.