The assign license method of MS Graph API might help. Triggering from flow should be possible as well. Hope this helps.
Assign license is used to add or remove subscriptions for the user. You can also enable and disable specific plans associated with a subscription.
Supercharge your business intelligence skills with our MSBI Course – Enroll now!