Open NetworkAnalysis (geoprocessing service) in ArcGIS Server Manager. In Parameters, change the value "Maximum Number of Records Returned by Server" from 1,000 to 1,000,000. Portal for ArcGIS then accepts the service URL as the Origin Destination Cost Matrix utility service.