Skip to content

All dotnet scaffold commands attempt to invoke the Azure CLI #3318

@MackinnonBuck

Description

@MackinnonBuck

Summary

Regardless of which options are selected, dotnet scaffold attempts to run the Azure CLI to check the logged in state of the user, obtain usernames and tenant IDs, and get Azure application IDs. On my machine, this adds a 30 to 45 startup time to any dotnet scaffold command (even dotnet scaffold --help).

The culprit is this line:

_areAzCliCommandsSuccessful = AzCliHelper.GetAzureInformation(out List<string> usernames, out List<string> tenants, out List<string> appIds, out string? azCliErrors);

It runs in the AspNetOptions constructor, which runs in AddScaffolderCommands(), which is called directly from Program.cs.

Proposed solution

The Azure CLI could be invoked lazily and only when the Entra ID scaffolder is selected.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions