Azure / Azure/azure-cli-extensions
'az ssh vm' and 'az ssh config' do not work with VMSS
- Dominant language
- Python
- Stars
- 454
- Forks
- 1.7k
- Avg merge
- 2d 19h
- Merged PRs (30d)
- 64
Description
### **This is autogenerated. Please review and update as needed.**
## Describe the bug
_NOTE: Everything below also applies when running `az ssh config` command_
When running `az ssh vm --ip `, AzureCLI returns the following error message:
```
--resource-group and --vm-name/--name must be provided together
```
If I add either of those parameters while leaving `--ip` present, I get the following error message:
```
--ip cannot be used with --resource-group or --vm-name/--name
```
If I remove the `--ip` from the command and keep `--resource-group --name ` , I basically receive a 404 from AzureCLI:
```
A valid resource in the resource group was not found.
Please ensure the active subscription is set properly and resource exists.
```
Since I'm trying to connect to an instance of an Ubuntu VMSS, the documentation clearly states I only need to provide the private IP, from a location that has access to it. I made sure the resource group name was accurate (copy-pasted from Azure Portal), same with the VMSS name. Tried using the instance name (`_0`), to no avail. Also tried adding `--prefer-private-ip` and still nothing.
Since we have multiple subscriptions, I made sure I was targeting the correct one using `--subscription ""`
**Command Name**
`az ssh vm
Extension Name: ssh. Version: 1.1.3.`
`az ssh config
Extension Name: ssh. Version: 1.1.3.`
## To Reproduce:
1. Create an Ubuntu-based VMSS in Azure, making sure to enable AzureAD SSH Login feature/extension
2. Try and login using `az ssh vm --subscription --ip `, `` being the private IP of one of the VMSS instances.
3. Get the same error messages
## Expected Behavior
As per [the documentation](https://learn.microsoft.com/en-us/azure/active-directory/devices/howto-vm-sign-in-azure-ad-linux#connect-to-vms-in-virtual-machine-scale-sets), the command should proceed with authenticating me with Azure, and then connecting me to the Ubuntu instance via SSH.
## Environment Summary
```
Linux-5.10.102.1-microsoft-standard-WSL2-x86_64-with-glibc2.31, Ubuntu 20.04.4 LTS
Python 3.10.8
Installer: DEB
azure-cli 2.45.0
Extensions:
azure-devops 0.26.0
ssh 1.1.3
Dependencies:
msal 1.20.0
azure-mgmt-resource 21.1.0b1
```
## Additional Context
Contributor guide
Assessment
This issue has not been assessed yet.