Skip to content

az aks bastion does not open the expected subshell #9060

@audunsolemdal

Description

@audunsolemdal

Describe the bug

When running the az aks bastion ... from PowerShell 7 on Windows 11 (via Windows Terminal) command we end up with

Launching subshell with command 'cmd.exe'.

Based on the logic here

def _aks_bastion_get_current_shell_cmd():
"""Get the current shell command being used by the parent process."""
ppid = os.getppid()
parent = psutil.Process(ppid)
return parent.name()
I would assume that the correct behaviour would be to launch pwsh.exe instead. The current behaviour is annoying as I do not have aliases and my prompt set up in cmd.exe

Related command

az aks bastion --name xx --resource-group yyy --bastion zz

Errors

No error

Issue script & Debug output

Not relevant

Expected behavior

Would expect the subshell launched to be of type pwsh.exe

Environment Summary

azure-cli 2.75.0 *

core 2.75.0 *
telemetry 1.1.0

Extensions:
aks-preview 18.0.0b26
bastion 1.4.0
ssh 2.0.6

Dependencies:
msal 1.33.0b1
azure-mgmt-resource 23.3.0

Python location 'C:\Program Files\Microsoft SDKs\Azure\CLI2\python.exe'
Config directory 'C:\Users\xxx.azure'
Extensions directory 'C:\Users\xxx.azure\cliextensions'

Python (Windows) 3.12.10 (tags/v3.12.10:0cc8128, Apr 8 2025, 12:21:36) [MSC v.1943 64 bit (AMD64)]

Additional context

No response

Metadata

Metadata

Assignees

No one assigned

    Labels

    AKSAuto-AssignAuto assign by botService AttentionThis issue is responsible by Azure service team.bugThis issue requires a change to an existing behavior in the product in order to be resolved.customer-reportedIssues that are reported by GitHub users external to the Azure organization.

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions