Germany had allied itself with Russia in order to avoid a two front war, between them and France. The reason Germany had allied with Austria, was because they both contained a lot of German peoples and German speakers.
Even though Germany allied itself with Russia, it doesn't stay that way, and pretty soon Germany is faced with a two front war; because it neglected Russia.