Skip to content
This repository has been archived by the owner on Sep 12, 2023. It is now read-only.

Mixing PoSH and CLI commands can produce unexpected results #220

Open
Commochief opened this issue Dec 14, 2022 · 2 comments
Open

Mixing PoSH and CLI commands can produce unexpected results #220

Commochief opened this issue Dec 14, 2022 · 2 comments
Assignees
Labels
Training Issues, bugs, and work related to training

Comments

@Commochief
Copy link

Commochief commented Dec 14, 2022

Describe the bug
Working thru the Demo 1 - module keeps switching between PSH and Az CLI which will not work. The context can be different between the two so it needs to offer both solutions (PoSH/CLI) completely or stick with one/other

To Reproduce
Steps to reproduce the behavior:

az cloudset --name [AzureCloud | AzureGovernment]
az login
$context = Get-AzContext
$location = [your region]

Expected behavior
All commands in a given module should have both CLI and PoSH or just one of the options because the context between the two can be totally different. To do the same 'Get-Context' you would use 'az account show'

Screenshots
Demo1ContextIssue

@matross-ghes matross-ghes self-assigned this Dec 14, 2022
@matross-ghes matross-ghes added the Training Issues, bugs, and work related to training label Dec 14, 2022
@matross-ghes
Copy link
Contributor

We are using PowerShell with Azure CLI so we can capture the results of Get-AzContext to make the deployment a bit easier with variables. The output of AZ ACCOUNT SHOW could be used within the command, but it will be a bit messy. We can use either BASH or PowerShell, and we opt'd to use PowerShell with AZ CLI for demonstrations here. $context is then used as $context.Tenant.Id when specifying --management-group-id in the az deployment command.

The demonstrations attempt to make it known in the beginning we are using AZ CLI in PowerShell.

@matross-ghes
Copy link
Contributor

Thanks for the additional information @Commochief ! We will implement PowerShell and change to a singular language.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Training Issues, bugs, and work related to training
Projects
None yet
Development

No branches or pull requests

2 participants