@lin Welcome to Microsoft Q&A forums.
If you are using Azure Database Migration Service, you can easily migrate the logins using a graphical user interface.
If you want to migrate logins using a TSQL script, please use MoveLogin.ps1 to generate it.
The tool allows the automatic mapping of Windows AD accounts to Azure AD accounts or it can do UPN lookups for each login against the on-premise Windows Active Directory.
----------
If an answer is helpful, please "Accept answer" or "Up-Vote" for the same which might be beneficial to other community members reading this thread.