If you have a large on premise environment, you might want to automate the assignment of Office 365 licenses by using (dynamic) security groups in Azure AD. With this simple manual you should be able to setup automatic license assignment based on a security group.
STEP 1: In the Azure portal (https://portal.azure.com) go to Azure Active Directory
Go to the Licenses tab
Now go to All products and select the product that you want to automatically assign based on a group. In this example we will use Office 365 E3.
STEP 2: Now go to Licensed groups and click on + Assign
STEP 3: Now select the appropriate group. (In my case this is an AD security group part of the RBAC model) But you can create dynamic security groups in Azure AD as well.
Now make sure that you assign all options you need.
Assign the license setting:
The result should look like this, and your good to go: