Azelf has been the fastest Pokémon to learn Imprison and an entry hazard since Generation IV, but even during Generation IV, when Azelf's usage was at its peak, no one thought of this, even though this fact means that it was Game Freak's intention. And despite that Magic Coat now reflects entry hazards as well as Taunt, giving it a way to counter other entry hazard leads, and the fact that its usage alongside Imprison makes them both even better, nobody uses it on Azelf, despite Explosion's nerf giving it a moveslot. However, now Azelf has a reason to be used over Deoxys-S, because Imprison can prevent the foe from ever using three moves vital to every entry hazard lead other than those who only know Spikes and/or Toxic Spikes, and Imprison is not blocked by Magic Coat.
Azelf
move 1: Magic Coat
move 2: Imprison
move 3: Stealth Rock
move 4: Taunt / Fire Blast
item: Focus Sash
nature: Timid
evs: 252 HP / 4 SpD / 252 Spe
Thanks to Imprison and Magic Coat, Azelf doesn't have to worry about getting Taunted as much, and thus can afford to go without a damaging attack. Use Magic Coat first turn to reflect predicted Taunt or predicted entry hazards, then use Imprison to prevent them from ever using Stealth Rock, Taunt, or Magic Coat, making them powerless to stop Azelf from using Stealth Rock on them unless:
a:) they attacked both turns Azelf used Magic Coat and Imprison, and knocked Azelf out after it used Imprison (in this situation you still won in a sense because now they can't use Stealth Rock on your team, and even better if that's the only entry hazard they know)
b:) they attacked both turns Azelf used Magic Coat and Imprison, and knocked Azelf out before it could use Imprison (in this situation you still won in a sense IF on the turn Azelf used Magic Coat, it reflected an entry hazard)
c:) they attacked both turns Azelf used Magic Coat and Imprison, and didn't knock Azelf out, but KOd Azelf before it could use Stealth Rock (in this situation you still won in a sense for the same reason as in a)
d:) they attacked when Azelf used Magic Coat, didn't attack Azelf when you used Imprison, and KOd Azelf before it could use Stealth Rock (in this situation you lose even more if the foe got an entry hazard up while Azelf was using Imprison; this situation requires expectance of this set from the opponent)
e:) they didn't use Taunt when Azelf used Magic Coat and used Taunt before Azelf could use Imprison (in this situation you still won in a sense for the same reason as b)
f:) they attacked when Azelf used Magic Coat, didn't attack, successfully Taunt, or get any entry hazards up on the turn Azelf used Imprison, and knocked out Azelf before it could use Stealth Rock (in this situation you still won in a sense if Stealth Rock is the only entry hazard they know)
g:) they didn't attack when Azelf used Magic Coat, attacked when Azelf used Imprison, and knocked out Azelf before it could use Stealth Rock
If they used Spikes or Toxic Spikes on the turn Azelf used Magic Coat, that's even better! And if they used Taunt on the turn Azelf used Magic Coat, that guarantees for Azelf to succeed in using Stealth Rock, but you might want to Imprison first to make sure that it doesn't start using entry hazards when the three turns of Taunt are up.
If they used Stealth Rock on the turn Azelf used Magic Coat, then use Imprison and they can't try again.
Since Azelf has no attacks, it can invest in HP, giving it more survivability. The extra 4 EVs are in Special Defense so that Download Pokémon get an Attack boost instead of a Special Attack boost.
This set is good for teams that need entry hazards on the opponent's side and not on theirs, without using a Rapid Spinner. If that's what you need, and your five other party members are self-sufficient, then this is the best option, over Deoxys-S.