If ye love me, ye will keep my commandments: and I will pray the Father, and He shall give you another Comforter, even the Spirit of truth.' --John 14:15,16
'The Holy Spirit, whom God hath given to them that obey Him.'Acts 5:32.
Here is a paradox. How can we be obedient apart from the Spirit of God? How can we receive the Spirit of God without being obedient? One seems to follow the other. Obedience followed by the Spirit. Jesus approaches John the Baptist and requests baptism. John feels this is not right, Jesus should be baptizing him. The Sons reply is telling, "Permit it now in order to fulfill all righteousness". After he comes out of the water, the Holy Spirit comes on him and a voice is heard from heaven, "This is the son of my love, listen to him". Jesus was obedient to the Father and the Father gave him the Spirit.
The Spirit also precedes obedience. After Jesus is baptized he is led by the Spirit into the wilderness to be tempted of the Devil. When Jesus returns from his ordeal he does so in the power of the Spirit. After Jesus submitted himself to death on the cross, God raised him up. He went to the cross because the Holy Spirit lead him there. Paul said "If we are led by the Spirit we will not fulfill the lust of the flesh". There is no doubt that the Spirit leads us to obedience and following obedience comes the Spirit.
This is like walking. Left foot, right foot, left foot right foot. Which comes first the right or left foot? Does it matter? You need both to get anywhere. When we obey what we know we are given more and lead into even more obedience. The Spirit causes us to understand the Gospel. We respond in faith (obedience) and he gives us life. This life leads us to other steps of faith (obedience) such as baptism, prayer and fellowship. These acts of obedience lead to greater blessing.