Hi,
To use cloud shell/cli to create SSH key please see this article:
Manage administrative users, SSH, and check or repair disks on Linux VMs using the VMAccess Extension with the Azure CLI
https://learn.microsoft.com/en-us/azure/virtual-machines/extensions/vmaccess#update-ssh-key
To use portal to create SSH key please see this article:
Troubleshoot SSH connections to an Azure Linux VM that fails, errors out, or is refused
If the above was helpful please click Accept Answer.
Thanks.
-TP