Skip to content

[Functions] Update logic to populate tab completers and cache in the New-AzFunctionApp cmdlet #23788

@Francisco-Gamino

Description

@Francisco-Gamino

Description

Currently, the tab completers for the Runtime and RuntimeVersion parameters in the New-AzFunctionApp cmdlet are populated upon importing the Az.Functions module. However, this operation requires calling an ARM API with authentication. If there is no active session, this operation will result in an error. Additionally, this operation is used to create a cache with configuration options for creating function apps in the Functions service. To address this behavior, we propose the following steps:

  1. When Az.Functions is imported, if there is no active Azure PowerShell session, the tab completers and cache should not be populated.

  2. Next, we should populate the tab completer and build the cache only when there is an active Azure PowerShell session and under these conditions:
    a. The user invokes the New-AzFunctionApp cmdlet. It is important to note that the tab completers will not be populated until the New-AzFunctionApp cmdlet is invoked for the first time. Subsequently, the tab completers will be available from the second invocation of the New-AzFunctionApp cmdlet onwards.
    b. The user invokes any cmdlet from the Az.Functions module.

Issue script & Debug output

N/A

Environment data

N/A

Module versions

N/A

Error output

N/A

Metadata

Metadata

Labels

FunctionsbugThis issue requires a change to an existing behavior in the product in order to be resolved.

Type

No type

Projects

No projects

Relationships

None yet

Development

No branches or pull requests

Issue actions