Azure SQL query never completes
This has a scent of a parameter sniffing problem.  See what I did there?  Punny, right?

Anyway, Paul White, wrote up a great article on the various approaches available to resolve this issue, so I'm not going to go into detail when you should just read his article instead.  What you can try quickly though, because this is an ad-hoc statement, is to force a recompile using the OPTION (RECOMPILE) hint.  If this fixes your issue, you definitely are running into what I suspect.  However the best way to properly resolve this is to convert your statement into a Stored Procedure and then execute the Stored Procedure passing in the date parameters.  A parameterized Stored Procedure won't fall prey to the current issue and should be reusable as well.