I was wondering if there is some sort of API from Visual Studio to assign Visual Studio licenses or if there is any other good way to automate the process of assigning licenses since I could not really find anything online.
I am hoping for something similar as the API provided by Intellij to assign licenses. See this: https://sales.jetbrains.com/hc/en-gb/articles/4406854152978-JetBrains-Account-API
The last official statement from Microsoft for an API in VS to manage the subscription was some time ago, but to summarize it, it was more or less a plain "no".
Microsoft recommends Microsoft Entra for bulk assignement of VS licenses which works via Azure Active Directory. If you want more information, have a look here: https://learn.microsoft.com/en-us/visualstudio/subscriptions/assign-license-bulk#use-azure-active-directory-groups-to-assign-subscriptions