service definition for GP service with result map service

Discussion created by posthumusb on May 8, 2013
I have a geoprocessing script tool that creates two derived feature classes in the scratch folder. I need to publish this as a service that will (1) run the geoprocessing script and (2) display the results as a map service. We need to create a service definition file so we can publish to AGS running on multiple Linux servers.

When creating the service definition file, it turns out the path to the scratch folder is hard-coded into it and this breaks the result map service.  When AGS (on the Linux server) tries to access the derived datasets for the map service, it fails since the "scratch folder" is no longer the scratch folder for the service but an actual hard-coded path that doesn't exist on the Linux server. I tried changing the scratch workspace to a folder that's mapped in the data store but it didn't matter - I still get an error saying it can't find the data in that same hard-coded path.

Is there any way to get around this hard-coded folder path in the service definition file?

(Note: the service can be published directly to the server from ArcMap successfully; it only fails when creating a service definition file first and then publishing it with ArcGIS Server Manager. Unfortunately, outside of dev we need to take the service definition route.)