1

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

1 Answer 1

0

I ran this pipeline

trigger: none
pr: none

pool:
  vmImage: 'windows-latest'

steps:
- task: AzureCLI@2
  inputs:
    azureSubscription: 'rg-the-code-manual'
    scriptType: 'ps'
    scriptLocation: 'inlineScript'
    inlineScript: 'az functionapp create --name myapp-nightly-webhook-1 --resource-group TheCodeManual --consumption-plan-location australiaeast --functions-version 3 --os-type Windows --runtime dotnet --storage-account storageaccountthecobfaf'

I got warnings but the whole pipeline succeeded: enter image description here

Can you compare this with your pipeline?

You can also remove --runtime dotnet to get rid of this warning. For that configuration you will get this

enter image description here

Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.