fMRI is used to plan procedures that put eloquent cortex at risk. For example, tumor resections. Typically, fMRI is used for initial planning (whether the tumor is in the dominant hemisphere, how to approach the tumor). Then, in the actual surgery, function is confirmed using awake cortical mapping (e.g. stimulating different cortical areas with a bipolar electrode while the patient performs language tasks).
See more: https://www.ncbi.nlm.nih.gov/pmc/articles/PMC4966674/