Hearts will face former player and head coach Robbie Neilson's Dundee United side in the Betfred Cup.
The Tynecastle encounter looks the highlight of the group stage, which takes place over three weekends and two midweeks from July 13-28.
United will face an interesting test of their close-season transfer activity as Neilson looks to build a team capable of getting promotion at the fourth time of asking. East Fife, Stenhousemuir and Cowdenbeath complete Group A.
Hibernian will face four part-time teams in Alloa, Stirling, Elgin and Ladbrokes League One champions Arbroath.
Motherwell take on familiar opposition in the shape of three teams they have played in the past three group stages – Morton, Queen of the South and Annan. Dumbarton make up Group E.
Championship winners Ross County will get a taste of Premiership opposition when they travel to face St Johnstone. There will also be three Angus derbies in Group B, with Forfar, Brechin and Montrose drawn together.
St Mirren will face Lowland League champions East Kilbride, along with Dunfermline, Albion Rovers and Edinburgh City.
There are a host of derbies in Group F with Lanarkshire teams Hamilton, Airdrie and Clyde drawn along with Glasgow pair Partick Thistle and Queen's Park.
Livingston will play Ayr, Stranraer and Falkirk, along with Berwick – who lost their league status with a 7-0 aggregate defeat by Cove.
Relegated Dundee take on new Championship rivals Inverness, as well as Raith Rovers, Peterhead and Highland League champions Cove.
The draw was split into north and south sections, with the eight group winners joining the four best runners-up and European qualifiers Celtic, Rangers, Kilmarnock and Aberdeen in the second round.
The top seeds will host the second seeds with the other venues for games being decided in the coming days.
ga('create', 'UA-72310761-1', 'auto', {'name': 'pacontentapi'});
ga('pacontentapi.set', 'referrer', location.origin);
ga('pacontentapi.set', 'dimension1', 'By Gavin McCafferty, Press Association Sport');
ga('pacontentapi.set', 'dimension2', 'a9213126-7d03-497e-9d7d-ce942f9f38f3');
ga('pacontentapi.set', 'dimension3', 'paservice:sport,paservice:sport:football');
ga('pacontentapi.set', 'dimension6', 'story');
ga('pacontentapi.set', 'dimension7', 'composite');
ga('pacontentapi.set', 'dimension8', null);
ga('pacontentapi.set', 'dimension9', 'sport:football');
ga('pacontentapi.send', 'pageview', { 'location': location.href, 'page': (location.pathname + location.search + location.hash), 'title': 'Hearts drawn to face Dundee United in Betfred Cup'});