Hi,
If Visual Studio keeps spinning for a long time when trying to sign in with your Microsoft account, it is usually related to the authentication cache or account token used by Visual Studio, not the device registration itself.
The device not appearing in your Microsoft account devices list is normal in many cases. Visual Studio sign-in does not always register the PC as a device there, so that part is typically unrelated to the login issue.
What often helps is clearing the cached credentials that Visual Studio uses. Close Visual Studio, then open Credential Manager in Windows and remove any entries related to Visual Studio, Microsoft Office, or MicrosoftAccount. After that, reopen Visual Studio and try signing in again. This forces the application to request a fresh authentication token.
If the problem continues, also make sure Visual Studio is fully updated and that your network is not blocking Microsoft authentication endpoints, since a slow or blocked connection can cause the login window to appear stuck for several minutes.