Hacktoberfest 2026: the issues maintainers tagged for October, open and beginner-friendly. Browse Hacktoberfest issues

az functionapp show consistently fails the first time

Open
#546 1 comment 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Assessment

Difficulty
3/5
Estimated time
1-2 days
Newbie friendliness
52/100
Issue type
Bug
Clarity
Mostly clear
Activity status
Quiet
Tech stack
azure, powershell, yaml
Domain
cli, cloud

Research direction

Reproduce the first post-deployment call to the az functionapp function show entry point from the Azure DevOps AzureCLI@2 PowerShell Core step, then compare it with subsequent calls. Done means the command returns a non-null invokeUrlTemplate on its first attempt without requiring an unexplained sleep loop.

Written by the indexing model from the issue text.

Description

As per the title.

Specifically:
Running a yaml pipeline in Azure Devops

modified example below.

            - task: AzureCLI@2
              displayName: 'Get function urls and keys'
              inputs:
                azureSubscription: 'xyz'
                scriptType: 'pscore'
                scriptLocation: 'inlineScript'
                inlineScript: |
                  Write-Host "rgName: $(rgName)"
                  Write-Host "functionAppName: $(functionAppName)"
                  $statusUrl = az functionapp function show --resource-group $(rgName) --name $(functionAppName) --function-name 'status' --query 'invokeUrlTemplate'
                  Write-Host "##vso[task.setvariable variable=statusUrl]$($statusUrl.Trim('"'))"

Specifically any such code like the above always fails the first time after the referenced function is deployed. It seems to work reliably and successfully every other time after.

Do I need to write a sleep loop to address this? :(

Actual Result

ERROR: (NotFound) Error retrieving function.
Code: NotFound
Message: Error retrieving function.
You cannot call a method on a null-valued expression.
At /home/vsts/work/_temp/azureclitaskscript1681431997529_inlinescript.ps1:8 char:57
+                                                  ~~~~~~~~~~~~~~~~~~~~
+ CategoryInfo          : InvalidOperation: (:) [], ParentContainsErrorRecordException
+ FullyQualifiedErrorId : InvokeMethodOnNull
##[error]Script failed with exit code: 1

Expected result:
$statusUrl has a non-null value and the script executes as expected.

Dominant language
Python
Stars
91
Forks
134
PR merge metrics
No merged PRs in 30d

Getting set up

  • No Dockerfile or Docker Compose file
  • Has a pull request template
  • No contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

More from Azure/azure-cli-dev-tools

All issues in Azure/azure-cli-dev-tools

Similar issues

More Python issues

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.