The Azure Flute can only be obtained on mystery gift. When you do get it though, take it to spear pillar. When you get there a shiny staircase appears that leads directly to Arceus.
THAT IS A LIE!
It is hidden in a secret cave ON THE OTHER SIDE OF TOWN