Azure / Azure/autorest.powershell

[Azure] Need to check whether authentication is done when users use any generated Azure cmdlets

Open
#1,388 1 comment 0 reactions 1 assignee Claimed by @Pan-Qi View on GitHub
feature-request P1 Tracking
Dominant language
C#
Stars
123
Forks
99
PR merge metrics
No merged PRs in 30d

Description

Currently, if users do not do authentication before they run any cmdlets, we will return a confused error messages. See https://github.com/Azure/azure-powershell/issues/26183 for a real case.

Instead of we should check whether users have login in. If not, we should throw an error like **Run Connect-AzAccount to login**

Regarding to how to check whether users have login in. We may have following options.

1. Check whether there is a context through Get-AzContext
2. Check whether (Get-AzContext).Subscription.Id is null (there is a limitation for this solution, Id could be null in some cases even the users have login in.)

Contributor guide

No contributing guide indexed for this repository

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.