The goal of Part A is to find the highest tolerable dose of avelumab that can be given in combination with 5-azacytidine to patients with relapsed or refractory AML. The goal of Part B is to learn if the highest tolerable dose of this drug combination found in Part A can help to control the disease.