I'm running the following Azure CLI command in an Azure DevOps yaml and it fails, but the same command works fine when run in a local console.
az functionapp create --name myapp-nightly-webhook --resource-group myapp-nightly --consumption-plan-location australiaeast --functions-version 3 --os-type Windows --runtime dotnet --storage-account myappnightlywebhook
Although it succeeds in the local console, it does return the following warnings:
--runtime-version is not supported for --runtime dotnet. Dotnet version is determined by --functions-version. Dotnet version will be 3.1 for this function app.
Application Insights "lightning-nightly-webhook" was created for this Function App. You can visit https://portal.azure.com/#resource/subscriptions/snip/resourceGroups/lightning-nightly/providers/microsoft.insights/components/myapp-nightly-webhook/overview to view your Application Insights component
I was wondering why it was returning the first warning (I'm not using the --runtime-version switch in my command) and whether that was making the task fail.
The DevOps task (AzureCLI@2) log shows:
2020-09-24T05:23:42.2169333Z az : --runtime-version is not supported for --runtime dotnet. Dotnet version is determined by --functions-version. 2020-09-24T05:23:42.2180924Z Dotnet version will be 3.1 for this function app. 2020-09-24T05:23:42.2181694Z At D:\a_temp\azureclitaskscript1600924977406_inlinescript.ps1:5 char:3 2020-09-24T05:23:42.2182456Z + az functionapp create --name myapp-qa-webhook --resource-group ... 2020-09-24T05:23:42.2183553Z + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ 2020-09-24T05:23:42.2184379Z + CategoryInfo : NotSpecified: (--runtime-versi...s function app.:String) [], RemoteException 2020-09-24T05:23:42.2185073Z + FullyQualifiedErrorId : NativeCommandError