Crews were called to Tofthills farm near Inverurie, Aberdeenshire, at about 9.35pm on Tuesday.
The building - about 50m x 2m - was filled with bales of straw, which a Scottish Fire and Rescue Service spokeswoman described as “well-alight”.
The roof also contained asbestos.
Four appliances and a water carrier were sent to the scene, along with 22 crew members.
Two fire engines were still at the scene at 9.35am on Wednesday.
The spokeswoman added it did not appear anyone was inside the building when it went up in flames.