Hello 井村 鷹希,
To use a custom terminal emulator with Entra ID, the most technically robust method is to treat your emulator (e.g., Windows Terminal, Hyper, or VS Code integrated terminal) as the shell host and execute the native Azure CLI wrapper directly within it. The command az network bastion ssh --name "<BastionName>" --resource-group "<RG>" --target-resource-id "<VMID>" --auth-type "AAD" is specifically engineered to handle the background certificate exchange and then hand off the session to the OpenSSH client. This allows you to work within your preferred visual environment while maintaining the necessary security handshake.
If you strictly require the use of the az network bastion tunnel command to map the connection to a local port (e.g., mapping the VM's port 22 to your localhost:50022), you must manually handle the authentication tokens. This involves running az ssh cert to generate the short-lived RSA key pair and signed certificate, and then configuring your SSH client to explicitly use those generated files (specifically the -i private key and -o CertificateFile options) when connecting to localhost. This manual certificate management is tedious and prone to timeout errors, which is why the direct CLI wrapper command inside your terminal of choice is the official best practice.
I hope you've found something useful here. If it helps you get more insight into the issue, it's appreciated to accept the answer. Should you have more questions, feel free to leave a message. Have a nice day!
VP