MDM - "ErrorCode": 12040 "ErrorDomain": "MCMDMErrorDomain", Please log in to your iTunes Store account

We are getting this on some devices but cannot figure out device state that leads to this response.

These are supervised devices. The App was originally installed using a configurator blueprint using a VPP account. The vast majority of devices change the App to managed with no prompt when one of the following MDM actions are sent, but some devices prompt for an apple id log and fail to make the app managed.

The prompt occurs with either an App install/update
{
"request_type": "InstallApplication",
"udid": "00008020-000561A00E68402E",
"identifier": "com.*.*.default",
"options": {
"purchase_method": 1
}
}
or with a request to make it managed
{
"request_type": "InstallApplication",
"udid": "00008020-000561A00E68402E",
"identifier": "com.*.*.default",
"change_management_state": "Managed"
}


in either case we receive the following
{
"CommandUUID": "d31ec100-dbbe-4801-9795-390b6b6503bf",
"ErrorChain": [
{
"ErrorCode": 12040,
"ErrorDomain": "MCMDMErrorDomain",
"LocalizedDescription": "Please log in to your iTunes Store account.",
"USEnglishDescription": "Please log in to your iTunes Store account."
}
],
"Status": "Error",
"UDID": "00008020-000561A00E68402E"
}

We are pretty certain no Apple ID was used locally. In some cases hitting cancel on the prompt allows the MDM on the next request in other cases we found the App must be removed locally on the device and then installed by the MDM. The App cannot be removed by the MDM since its not managed

Occurred on both iOS 13.7 & 14.4

Hi! Not sure what MDM you're using, but had the same issue with Verizon MDM.

Turns out we had two instances of Outlook pointing to devices. One had an incorrect deployment rule.

Remedy for us - navigate to the app itself within the MDM (after being acquired in ABM) and scope it to the designated area.

Removed the incorrect method of having the MDM provide the app and then scope to the designated area.

MDM - "ErrorCode": 12040 "ErrorDomain": "MCMDMErrorDomain", Please log in to your iTunes Store account
 
 
Q