When you have an Availability Group, you will end up with jobs that you want to run only on the primary replica. Yet, the job should be installed identically on all replicas. This post shows several methods of creating primary replica jobs that will only run on the primary replica.