Feasibility of Electrophilic attack on the Nitrogen over the Phenyl ring of Aniline
Electrophilic Aromatic substitution in Aniline will occur when the $\pi$-electron cloud of Benzene ring attacks the electrophile generated (mostly in-situ)  instead of the lone pair on the Nitrogen atom. Thus for occurance of Electrophilic aromatic substitution, there always remains a competition between the $\ce{N}$ atom and the $\pi$-electron rich benzene ring. You may think that the lone pair of nitogen remains fully delocalised through the Benzene ring, but there always remains a high enough electronic charge density on the Nitrogen atom to behave as a nucleophile and in fact in greater extent the electronic density of the ring (not always for Oxygen though, being highly electronegative, its less nucleophilic, but Nitrogen is certainly more nucleophilic).

Thus,you will observe that it is difficult to perform electrophilic aromatic substitution reaction on  unprotected Aniline. Thus, most of the reactions on Aniline are initiated by attacking of the elctrophile by Nitrogen atom instead of the ring. It is its general trend. Thus to do substitution in the ring, we first need to decrease electronic charge density on the Nitrogen atom and that's why we first treat the Aniline with $\ce{CH3COCl}$ in Pyridine medium to form acetanilide, and then perform any other reaction on the ring like Bromination, Chlorination, Alkylation etc. 

You will also observe that Aniline doesn't undergo Friedel Crafts alkylation/acylation to a great extent. As at the moment you add Lewis acid, Nitogen atom behave as Lewis Base and forms the adduct, which make the ring highly electron deficient due to induced positive charge on Nitrogen.

Thus, the Diazotization  and Acetylation are the normal/expected reaction of Aniline as a effect of higher nucleophilicity of $\ce{N}$(due to lesser elctronegativity and weaker basicity). Instead if you have to perform Electrophilic aromatic substiution in the ring, you have to think about how to perform it.