Minister of Communication and Digital Economy Isa Ali Pantami said the agreement would boost “job creation and economic development”.
Prof Pantami described the initiative as “amazing and also very huge”.
He told the BBC it would start immediately, and run for five years.
The deal was signed on the sidelines of an IT exhibition in Dubai on Wednesday, with a Microsoft representative saying the company was willing to work with the Nigerian government to provide “economic opportunities” for young people.
Microsoft and the government have been in talks for more than a year about the project.
Nigeria is Africa’s most populous country and biggest economy.
It has a largely young population of more than 200 million.
But unemployment is high and the education sector is struggling.
The government says it is trying to make the economy digitally oriented.
Prof Pantami also said that Nigeria would continue to provide an “enabling environment” for Microsoft and other companies to operate in the country by ensuring that regulatory measures were “developmental and flexible”.