Thanks for reaching out to Microsoft Q&A
The main reason why you are getting the error message is because you are already signed into Azure Cloud shell with the same account you used to sign into Azure Portal, but since you are trying to use Microsoft Graph, you need to sign into it as it's a different resource than Azure Portal.
That being said, when using Azure Cloud shell you need to simply use your credentials to it instead of trying to sign into a different organization.
After adding the code, if your account is not listed for pickup, select Use another account option and insert your credentials in there instead of signing into another organization.
Let me know how that works for you.
Thanks,
Fabio