The machine, only the second of its kind in Scotland, was unveiled in Dundee’s Overgate Centre on Monday.
It allows shoppers to pay between £3-£5 for a selection of locally-sourced produce, including bags of potatoes and mixed vegetable boxes.
A day after it was unveiled, shoppers had emptied some of the compartments.
The machine is another feather in the cap for the city, coming days after it was named a Unesco City of Design.
The machine was created by the Grewar family, owners of East Ardler Farm outside Blairgowrie. They launched Grewar Farm Vending as a new way of selling fresh fruit and vegetables.
The only other vending machine is on their farm.
So far, it has been a hit with shoppers who live in Dundee, which was last year crowned the worst city in Scotland for child obesity.
Shocking statistics found that one in five primary one pupils were overweight, obese or severely obese. It is believed that an unhealthy diet was a large factor contributing to the figures.
It was also discovered that Dundee was among the top 10 worst areas in the UK for heart health, with more than 250 deaths coronary heart disease every year.
The machine offers bags of potatoes for £3 and a tray of vegetables and eggs – containing six free-range eggs, six baking potatoes, a turnip, 1.25kg of onions and 1.25kg of carrots – for £5.
Shoppers insert their money into a slot and a corresponding compartment opens, containing their vegetables inside.
Pete Grewar, owner of the farm, said: “It’s a new venture but an exciting one.
“We’ve had a vending machine at the bottom of the farm road for two months and it has been very popular, but it is a quiet road so we thought we would try it somewhere with a bit more footfall and the Overgate were very keen.
“We grow all the potatoes ourselves and if we don’t grow the other vegetables they will be sourced from Tayside or north east Fife.”
He added that if the vending machine is a success with customers then more could be installed.
Rachel Neary, marketing executive at the Overgate Centre, said: “We were approached by the farm and thought it was an interesting and unusual idea.
“So far it’s been really good. I walked past on Monday and could see that several of the boxes had already been bought.
“It’s the only place in the centre where you can buy fresh produce, and it’s local so we know exactly where it came from, even down to the specific field.
“The furthest away the food comes from is 15 miles. It’s great.”
Dundee resident Jill Darling said: “I do like the idea but I was hoping it would sell individual portions of fruit.
“I think it might work out very well because there is nothing else nearby where people can buy vegetables other than Lidl.
“It’s a definite start and you know you are getting good produce.”
The machine will stay in the Overgate for a three-month trial period, and will put down roots permanently if it proves popular.