Rafiq had been playing with the second XI in recent weeks and impressed enough to win a contract.
The all-rounder goes straight into the squad for Friday’s NatWest T20 Blast match against Notts at Headingley.
Yorkshire have also recalled pace bowler Josh Shaw from his loan spell at Gloucestershire.
The seam bowler, who has taken 19 first-class wickets this season, has been recalled due to an injury/personnel crisis.
Martyn Moxon, Yorkshire’s director of cricket, said: “With Liam Plunkett and David Willey being called up to the England ODI squad and with injuries to Ryan Sidebottom, Matthew Fisher and Jack Brooks, our seam bowling resources are stretched.
“Therefore, we have requested that Josh returns from his loan spell with immediate effect.
“Josh’s loan spell at Gloucestershire has helped with his development this year and this is clear to see from the wickets that he has taken.
“An option is in place for Josh to return to Gloucestershire at some stage during the season.”
Commenting on Rafiq’s new deal, Moxon said: “Azeem has played for the second team over the last couple of weeks and in light of his positive performances, we are delighted to offer him a new contract at Headingley.”
Yorkshire have been boosted by the news that Jonny Bairstow, Liam Plunkett, Adil Rashid and Joe Root are available to play in Sunday’s NatWest T20Blast match against Derbyshire at Headingley.
The four players had been due to train with England ahead of the ODI series against Sri Lanka, but they have been made available to play for Yorkshire due to non-stop rain in Nottingham over the last few days which has affected outdoor facilities.
The quartet join fellow ODI player David Willey in the Yorkshire side, who had already been made available by England.