Legends appear at certain Mirage Spots at different times of the day.
The Mirage Spot is at a specific location.
Link to all legends: .
The period is a link. Enjoy your legend hunting! :D
As for your case, wait 12 hours or beat the league and Azelf should respawn. But if you go at a different time of day that's not between 21:00 and 3:59, you will not find Azelf.
Hope I helped!
-It's a secret!