With ArcGIS Pro, you can save service definitions for your geoprocessing service to be shared or overwritten to a stand-alone ArcGIS Server at a later time. A service definition file (.sd) contains the information of how the geoprocessing service is going to be published and configured in ArcGIS Enterprise or ArcGIS Server. See Introduction to saving service definitions to learn more about how service definitions can be used in your organization's sharing workflows.
Save a connected service definition for a geoprocessing service
A connected service definition is configured for a specific server connection. Use the Publish Geoprocessing Service pane to save a service definition. As with publishing a geoprocessing service, you must run the tool at least once to get the correct result before you save it as a service definition. You must have the role of Administrator to save as a service definition.
To save a connected service definition for publishing or overwriting a geoprocessing service, complete the following steps:
- Add the server connection with the steps of Add new ArcGIS server connection. If the connection is not an administrator connection, edit it with the steps of Configure ArcGIS server connection type.
- Follow the steps in Publish a geoprocessing service to open the Publish Geoprocessing Service pane. For overwriting a geoprocessing service, follow the steps in Overwrite a geoprocessing service to open the Overwrite Geoprocessing Service.
- Set the publish pane properties using the steps of Set the geoprocessing service properties.
- Under Finish Sharing, click Analyze to review for problems.
Errors and warnings are listed on the Messages tab. Right-click a message to open its help topic or take corrective action in the software. Errors must be resolved before you can save the service definition. Resolving warnings is recommended but not required.
- After you have resolved errors, and optionally resolved warnings, click the Publish drop-down arrow and click Save As SD.
The Save As Service Definition File dialog box appears.
- On the dialog box, specify the location and name of the service definition file and click Save.
- Optionally, click Jobs to monitor the job status.
- Once the service definition has been successfully staged, click the Manage the service definition link at the bottom of the pane to open the location of the service definition file.
Save an offline service definition for a geoprocessing service
An offline service definition is connection-neutral; it is not configured for any specific server connection. You can save an offline service definition if you are offline or not connected to the server. The option to save an offline service definition starts from the History pane. Just like publishing a geoprocessing service, you must run the tool at least once to get the correct result before you save it as a service definition. You must have the role of Administrator to save as a service definition.
When saving the offline service definition from ArcGIS Pro 3.0 or later, choose the correct version of ArcGIS Server you are sharing to as several tools behave differently if you publish to 10.9.1 or an earlier version. When referencing data using a server data store while saving the offline service definition file, be aware of the following:
- The data is either all copied or referenced when publishing the offline service definition file. If some data needs to be copied whereas others referenced, save the file as a connected service definition file instead.
- Before publishing the file to a server, make sure the server has the access to the database or folder path of the referenced data, register the data on both the publisher and server side of the data store of the server.
To save an offline service definition for a geoprocessing service, complete the following steps:
- On the Analysis tab, in the Geoprocessing group, click History to open the History pane.
- On the Geoprocessing tab of the pane, right-click the item you want to save and click Share As > Save As Offline Service Definition > Geoprocessing Service on Standalone Server to open the Save As Offline Service Definition pane.
- Set the pane properties using the steps of Set the geoprocessing service properties. Notice there is no server connection in the General tab under Location. Be sure to choose the correct version of ArcGIS Server if using ArcGIS Pro 3.0 or later,
- If you want to use the saved service definition file to overwrite a pre-existing web tool, check the check box next to the Save as Overwrite under Overwrite in the General pane.
- Under Finish Staging, click Analyze to review for problems.
Errors and warnings are listed on the Messages tab. Right-click a message to open its help topic or take corrective action in the software. Errors must be resolved before you can save the service definition. Resolving warnings is recommended but not required.
- After you have resolved errors, and optionally resolved warnings, click Save.
The Save As Service Definition File dialog box appears.
- On the dialog box, specify the location and name of the service definition file and click Save.
- Optionally, click Jobs to monitor the job status.
- Once the service definition has been successfully staged, click the Manage the service definition link at the bottom of the pane to open the location of the service definition file.
Save a service definition using Python
To save a connected service definition, check the code examples from the GeoprocessingSharingDraft class of the Sharing module or the publishing function CreateGPSDDraft.
To save an offline service definition, use the GeoprocessingSharingDraft class of the Sharing module by using the offline and offlineTarget parameters.
If you are ready to publish your service to an ArcGIS Server, see Publish a service definition.