Configuring LDAP and SSO creating 2 accounts for the same user in Nextcloud

Originally Nextcloud was set up using LDAP and recently we implemented the SSO via Azure. Though SSO works seamlessly, it is creating new user accounts rather than mapping them to the existing LDAP user account.

Also wondering if editing the LDAP query in the users tab will affect the existing users. Will it only take effect on the new users or it will update the uid on the existing users?

Please help!