I'm trying to create some resources using the AzureCLI@2 pipeline task. I'm creating a resource group, followed by a linux app service plan then trying to create a webapp that uses the app service plan. This is my task...
- task: AzureCLI@2
displayName: Create resources
inputs:
azureSubscription: ${{parameters.serviceConnectionName}}
scriptType: ps
scriptLocation: inlineScript
inlineScript: | #I cannot get a linux webapp to work! ARGHHHH!
az group create --location ${{parameters.location}} --name $(resourceGroup)
az configure --defaults group=$(resourceGroup) location=${{parameters.location}}
az appservice plan create -n $(appServicePlan) --sku ${{parameters.appPlanSku}} --is-linux
az webapp create --name $(AppServiceName) --plan $(appServicePlan) --runtime --% "DOTNETCORE|5.0"
This is the error I receive:
ERROR: Linux Runtime 'DOTNETCORE|5.0' is not supported. Please invoke 'az webapp list-runtimes --linux' to cross check
running az webapp list-runtimes --linux gives me
az webapp list-runtimes --linux
[
"RUBY|2.5.5",
"RUBY|2.6.2",
"NODE|14-lts",
"NODE|12-lts",
"NODE|10-lts",
"NODE|10.1",
"NODE|10.10",
"NODE|10.12",
"NODE|10.14",
"NODE|12.9",
"PHP|7.2",
"PHP|7.3",
"PHP|7.4",
"DOTNETCORE|2.1",
"DOTNETCORE|3.1",
"DOTNETCORE|5.0",
"TOMCAT|8.5-jre8",
"TOMCAT|9.0-jre8",
"JAVA|8-jre8",
"WILDFLY|14-jre8",
"JBOSSEAP|7-java8",
"TOMCAT|8.5-java11",
"TOMCAT|9.0-java11",
"JAVA|11-java11",
"JBOSSEAP|7-java11",
"PYTHON|3.8",
"PYTHON|3.7",
"PYTHON|3.6",
"STATICSITE|1.0"
]
Whats more frustrating is that this works if I use the Azure CLI locally.
The build agent is a self host windows agent running the latest version of the Azure CLI (upgraded to make sure that wasn't the issue).
Will switch to a windows app service plan for now as I've wasted so much time on this already. Has anybody got any suggestions?