Work starts on 5 September and will be in place between the Almond River bridge and Junction 1A, near Newbridge roundabout.
A Transport Scotland spokesman said "essential repairs" to the road were needed.
Passengers heading for Edinburgh Airport are "strongly urged" to allow extra time for their journey.
There will be a 40mph speed limit through the roadworks.
Transport Scotland said a number of measures would be put in place to minimise the disruption.
These include the works being scheduled to avoid major events and busy times, and resurfacing only taking place overnight and at weekends.
Steven Brown, Transport Scotland roads and infrastructure manager, said: "We have an inspection regime in place to monitor performance of the road, this has identified the need for essential repair work to the road surface. The repair work will be undertaken by the contractor at no cost to the public purse.
"The work has been scheduled to avoid busy periods for the network such as the Edinburgh Festival and Military Tattoo."
Mr Brown advised drivers to avoid the area if possible and to consider using public transport or alternative road routes.
Drivers are being warned of delays on the M9 near Edinburgh Airport ahead of eight weeks' of roadworks.