I am going to post a contrarian answer and will welcome any correction.
Flexible cords are covered in article 400 of the National Electrical Code. There are uses not permitted in section 400.8:
400.8 Uses Not Permitted.
Unless specifically permitted in 400.7, flexible cords and cables shall not be used for thefollowing:
(1) As a substitute for the fixed wiring of a structure
(2) Where run through holes in walls, structural ceilings,suspended ceilings, dropped ceilings, or floors
(3) Where run through doorways, windows, or similar openings
(4) Where attached to building surfaces
Exception to (4): Flexible cord and cable shall be permittedto be attached to building surfaces in accordance with the provisions of 368.56(B)
(5) Where concealed by walls, floors, or ceilings or located above suspended or dropped ceilings
(6) Where installed in raceways, except as otherwise permitted in this Code
(7) Where subject to physical damage
Now think about (1) above. At first glance it looks discouraging; but consider that if that rule ruled out all use of flexible cords, this would be a very short article. It's actually not really that clear what (1) means, but it doesn't mean that flexible cords and cables can never be used.
If you look at 400.7, it lists permissible uses of flexible cords and cables:
400.7 Uses Permitted.
Flexible cords and cables shall be used only forthe following:
(2) Wiring of luminaires
(3) Connection of portable luminaires, portable and mo-bile signs, or appliances
(4) Elevator cables
(5) Wiring of cranes and hoists
(6) Connection of utilization equipment to facilitate frequent interchange
(7) Prevention of the transmission of noise or vibration
(8) Appliances where the fastening means and mechanical connections are specifically designed to permit ready removal for maintenance and repair, and the appliance is intended or identified for flexible cord connection
(9) Connection of moving parts
(10) Where specifically permitted elsewhere in this Code
Now to me (2) above sounds promising, doesn't it? Does your light qualify as a luminaire? The NEC does have a definition for "luminaire" in Article 100:
Luminaire. A complete lighting unit consisting of a light source such as a lamp or lamps, together with the parts designed to position the light source and connect it to the power supply. It may also include parts to protect the light source or the ballast or to distribute the light. A lampholder itself is not a luminaire.
This is not surprising to me. For example, in warehouses, it's a common practice to make up a cord and plug connection for the highbay lights up in the rafters. This is done to make maintenance (installation / removal) more convenient. It's a generally accepted practice. The highbays are certainly not portable or frequently moved.
Many outdoor lighting products would, to my read of this, clearly qualify as "luminaires."
Note that 400.8(4) would seem to discourage you from attaching the cord to the building surface, including the roof.
The "subject to physical damage" restriction in 400.8(7) is always subjective. I would say that a cord laying on a pitched roof, no foot traffic etc., is up out of harms way and not subject to physical damage.
The cord you'd use would have to be rated suitable for the environmental conditions, there's no getting around that. The question is, would say SJEW cord, which is rated for extreme hard use (that's what the E means), and to outdoor wet locations where exposed to sunlight and rain (that's what the E means) is suitable for the environmental conditions.
So with all that said, I think I have made a good argument that you could use a cord grip to mount the cord to the light, run plug terminated SJEW cord a short distance to a (preferably twistlock) receptcacle on a GFCI protected circuit, with an in-use cover, located under in the soffit or on the fascia.
An inspector could see it either way. I think the most tenuous part of the argument is the "subject to physical damage" part.