You can assign a security group and have Azure AD will automatically assign licenses to all the members of the group. If ...

* You can assign a security group and have Azure AD will automatically assign licenses to all the members of the group. If a user is subsequently added to, or removed from, the group, a license will be automatically assigned or removed as appropriate. See Simplified License Assignment with Azure AD and EMS.