Intramolecular hydrazide condensation
Your reaction product is a double bond isomer of a diazirine. 

Halogene-substituted derivatives of the latter are typically prepared via oxidation of amidines with hypochlorites (Graham oxidation).

Heating your hydrazide in an aqueous solution of a mineral acid will only turn it to the corresponding carboxylic acid.