Bayliss, 44, who currently coaches New South Wales, replaces another Australian Tom Moody, who quit last month to work with Western Australia.
"Bayliss has been appointed for a two-year period starting on August 1," Sri Lanka Cricket (SLC) spokesman Samantha Algama told AFP.
Bayliss was picked over fellow Australian Terry Oliver, the Queensland coach, after being interviewed by SLC's selection panel here on Thursday.
The panel included SLC officials and former captains, including Aravinda de Silva, Ranjan Madugalle, Michael Tissera, Sidath Wettimumy and Bandula Warapura.
Bayliss played 58 first-class matches for New South Wales as a middle-order batsman from 1985 to 1993 before making his mark as the state coach when he took over from Steve Rixon during the 2004-05 season.
Bayliss had told the Sydney Morning Herald last week he would take up the Sri Lanka job if it was offered to him after rejecting overtures from Bangladesh and Australia's Centre of Excellence.
"It's a job