Creating azure_oauth2 users using gitlab or some other api

I am working on migrating users from older version of gitlab to latest version. In the older version I have users using LDAP to login which connects to our In house AD server.
In the new AD I have configured Azure Oauth2 for login with following documentation.
https://docs.gitlab.com/ee/integration/azure.html
it is working as expected. But the problem is I will have to ask everyone to do a manual login using azure_oauth2.

Is there any way I can automatically login/create the users with azure_oauth2.

when creating users with ldap we can use create user api of gitlab and provide the identities details as
{
“provider”: “ldapmain”,
“extern_uid”: “cn=user,ou=abc,ou=abc,dc=corp,dc=domain,dc=com”
}

But to create users with azure_oauth I need to provide the extern_uid as some kind of token which I don’t know where to get it.

{
            "provider": "azure_oauth2",
            "extern_uid": "0Nm5df9ondRdBdlt6df9TviSdgvUyzh-bqUdJkdfj5d-o"
        }