@Alexander Spak As asked by cthivierge, we would need more information on this. You can have a look at this article as well with this particular error you are facing :
https://learn.microsoft.com/en-us/troubleshoot/windows-server/identity/fail-to-configure-server-using-server-manager
Also a good article to setup a domain controller in Azure VM : https://vikaskumawat.dev/create-a-domain-controller-in-azure/
Let us know if you still are facing the issue after following above 2 articles.
-----------------------------------------------------------------------------------------------------------------
Please remember to "Accept Answer" if any answer/reply helped, so that others in the community facing similar issues can easily find the solution.