You probably want to use the graph api then.
https://learn.microsoft.com/en-us/graph/api/resources/azure-ad-overview?view=graph-rest-1.0
Here is also a link to the get user part
https://learn.microsoft.com/en-us/graph/api/user-get?view=graph-rest-1.0&tabs=http
If you are using adconnect it's possible to also sync custom attributes to azure. Graph should be able to query them too, but using non extension attributes makes your life a lot easier.