As artillery and psyops units
Those are almost one to one parallels to the established magic user trope in high fantasy.
In re artillery
When D&D was first published, the creators (military wargamers) used Magic Users as a form of artillery (fire ball and lightning bolt were at-will magic User abilities in the Chainmail rules). (citation here) This was a pragmatic application of what magic can do versus what the foot and cavalry units can do. (I played a few Chainmail games before I ever knew what D&D was, and a few after).
In re psyops.
Full disclosure: I spent a career in the Military. I got to (help) write a few campaign plans, and contingency plans, for some military operations. I was formally schooled in this. Part of that professional field is in picking various kinds of units to get a particular effect or outcome - or at least to plan for that.
Magic users who can form fog clouds, gas clouds like 'cloud kill' (a variation of mustard gas) and illusions, and other super natural effects, can instill fear or doubt in the minds of opposing soldiers. That is what psyops units that I worked with IRL have been doing for decades. If you get inside the enemy's head, they are easier to defeat.
Also, in a very well known work of fiction, Sauron's whole schtick in the LoTR was a massive psyops effect - fear, corruption, evil - over most of the known world, which he wanted to conquer.
For some magic users; be part of a special ops team
A classic example of this is Poul Anderson's novel, Operation Chaos. A werewolf and a witch are a two person spec ops team who fight for one army against another.
Aerial reconnaissance is another application of magic
What would be the structure of the military and how would these magic users be incorporated into it?
Beyond the above already accepted points, those who can fly offer a huge advantage to their side by early warning and reconnaissance. It was not on a whim that planes were developed during WW I; having eyes that see farther was a huge bonus. There were hot air balloons in use in the US Civil War.
Flying scouts? Awesome eyes and ears for any battle captain!
- When the operations that I supported had a Predator on task - well, it
was kind of new at the time and seemed a little bit like magic. ;-)
Nowadays, they are kind of normal. About two decades ago? Nearly
magical in what they allowed us to do what we could not do before.
- Twenty years before that, we had a new IR search device (FLIR) attached to our
aircraft. We could see in the dark~infravision! Magic, almost. Nowadays, it's a commonplace.
Related to aerial (and other) reconnaissance: 'real time' intel.
Depending on the kind of magic that is in your world, communication to the army from various magical scouts via telepathy, clairvoyance, magic crystals, what have you, offers the field general 'real time intel' from your scout units, be they on the ground or flying. Good information on what your enemy is doing and where he is has always been valued and can be a powerful tool in deciding how to deploy your army or navy.
- Taking a tip from real life armies: the proliferation of UAVs,
satellites and communications systems very much underscores how
important this is. The modern professional military sorts place a
high value on the "situational awareness" that comes from "all sensor
fusion." Man, been some years since I used those terms, but the
principles still apply. (thanks for @TheDyingOfLight for prompting me to add this!)
What countermeasures would be used against these magic users on the battlefield?
Bullets, arrows, and other magic users, as well as anything that obstructs their sight/ability to see the battlefield.
If you have not yet, I suggest to you the following work for understanding armies and the military:
Sun Tzu: The Art of War.
While written in a lyrical form, it points out almost everything you need to think about when trying to put together your army for your king/emperor/queen/whatever.