Acquired resistance is one of the major barriers to successful cancer therapy. The development of resistance is commonly attributed to genetic heterogeneity. However, heterogeneity of drug penetration of the tumor microenvironment both on the microscopic level within solid tumors as well as on the macroscopic level across metastases may also contribute to acquired drug resistance. Here we use mathematical models to investigate the effect of drug heterogeneity on the probability of escape from treatment and the time to resistance. Specifically we address scenarios with sufficiently potent therapies that suppress growth of all preexisting genetic variants in the compartment with the highest possible drug concentration. To study the joint effect of drug heterogeneity, growth rate, and evolution of resistance, we analyze a multi-type stochastic branching process describing growth of cancer cells in multiple compartments with different drug concentrations and limited migration between compartments. We show that resistance is likely to arise first in the sanctuary compartment with poor drug penetrations and from there populate non-sanctuary compartments with high drug concentrations. Moreover, we show that only below a threshold rate of cell migration does spatial heterogeneity accelerate resistance evolution, otherwise deterring drug resistance with excessively high migration rates. Our results provide new insights into understanding why cancers tend to quickly become resistant, and that cell migration and the presence of sanctuary sites with little drug exposure are essential to this end. 