The structure, adsorption energy, and initial dissociation reaction of the energetic 3,3′-diamino-4,4′-azofurazan (DAAzF) assembled inside or outside single-walled carbon nanotubes (i.e. CNT(6,6), CNT(8,8), and CNT(10,10)) were calculated by using an ONIOM approach. It was found that the geometrical changes in the furazan rings were obvious for the DAAZF assembled into CNT(6,6) with respect to that of the isolated DAAzF. As for the other assemblies, the DAAzF showed very similar geometrical parameters of the furazan rings as the isolated DAAzF. Only the furazan rings rotated slightly. It was also found that the DAAZF@CNT(6,6) had a positive adsorption energy. However, the DAAZF/CNT(6,6), DAAZF/CNT(8,8), DAAZF/CNT(10,10), DAAZF@CNT(8,8), DAAZF@CNT(10,10) were found to have the negative adsorption energy, which indicates that these adsorption processes are exothermic and thermodynamically favorable. The total energy of DAAzF@CNT(6,6) was higher than that of DAAZF/CNT(6,6) but the DAAZF@CNT(8,8) and DAAZF@CNT(10,10) had a lower energy than the DAAzF/CNT(8,8) and DAAzF@CNT(10,10), respectively. It is suggested that the DAAzF might spontaneously assemble inside the two CNTs of larger diameters. The calculated potential energy curves showed that that the CN bond thermal decomposition of the DAAzF was not significantly affected when DAAzF was assembled outside the three CNTs or inside the CNT(8,8) and CNT(10,10). However, the thermal decomposition of DAAzF could be promoted when it was assembled within the CNT(6,6). Our theoretical results would be very valuable for the design of the energetic nanocomposites based on CNTs and the azofurazan explosives.