Ally McCoist's side will begin their campaign at Cliftonhill on July 27 after they were paired with Rovers in the competition's South/West section.
Rangers were beaten in the quarter-finals last season by eventual winners Queen of the South, who open up the defence of their trophy at home to Spartans or Threave Rovers.
Dundee, relegated from last season's Scottish Premier League, are away at Alloa in the North/East section.
North/East Section draw:
Formartine United v East Stirlingshire
Stenhousemuir v Arbroath
Forfar Athletic v East Fife
Elgin City v Montrose
Cowdenbeath v Dunfermline Athletic
Peterhead v Brechin City
Alloa Athletic v Dundee
Raith Rovers v Stirling Albion
South/West Section draw:
Annan Athletic v Morton
Berwick Rangers v Livingston
Queen's Park v Ayr United
Queen of the South v Spartans or Threave Rovers
Albion Rovers v Rangers
Clyde v Falkirk
Stranraer v Dumbarton
Airdrieonians v Hamilton Academical