With ArcGIS Pro, you can save service definitions for web tools to be shared to your portal at a later time. A service definition file (.sd) contains the information of how the web tool is going to be published and configured in ArcGIS Enterprise. See Introduction to saving service definitions to learn more about how service definitions can be used in your organization's sharing workflows. Just like publishing a web tool, you must run the tool at least once to get the correct result before you save it as a service definition. You also must have a role of Administrator or customized Publisher to save a service definition.
Save a connected service definition for a web tool
A connected service definition is configured for a specific server connection. The option to save a service definition is available in the Share As Web Tool pane when you are connected to ArcGIS Enterprise. You can save a service definition file to publish a new web tool or overwrite a pre-existing web tool.
To save a connected service definition for publishing or overwriting a web tool, complete the following steps:
- Do one of the following:
- Save from the Share tab.
- For publishing a web tool, on the Share tab, in the Share As group, click the Web Tool drop-down arrow and click Share Web Tool to open the Select Tool To Share pane. Select the item and click OK.
- For overwriting a web tool, on the Share tab, in the Share As group, click the Web Tool drop-down arrow and click Overwrite Web Tool to open the Select the Web Tool to Overwrite pane. Select the item to be overwritten with and click OK to open the Select Tool To Share pane. Select the tool analysis result to overwrite and click OK.
- Save from the History pane.
- For publishing a web tool, 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, point to Share As, and click Share Web Tool.
- For overwriting a web tool, 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, point to Share As, and click Overwrite Web Tool.
The Share As Web Tool or Overwrite Web Tool pane appears.
- Save from the Share tab.
- Configure all the parameters you want to change in the Share As Web Tool or Overwrite Web Tool pane.
- 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 web tool
An offline service definition is connection neutral; it is not configured for any specific server connection. You can save the offline service definition file and either publish the file to, or overwrite an existing web tool in any ArcGIS Enterprise portal. There is no need to connect to ArcGIS Enterprise when saving the file, and there is no option for ArcGIS Enterprise information in the saving pane.
If saving the offline service definition from ArcGIS Pro 3.0 or later, choose the correct version of ArcGIS Enterprise you are sharing to, as several tools behave differently if you publish to 10.9.1 or earlier.
If 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 instead.
- Before publishing the file to an ArcGIS Enterprise portal, make sure its server has the access to the database or folder path of the referenced data, and register the data on both the publisher and server side of the data store of the server.
To save an offline service definition for publishing or overwriting a web tool, complete the following steps:
- Do one of the following:
- Save from the Share tab.
- On the Share tab, in the Share As group, click the Web Tool drop-down arrow and click Save As Offline Service Definition to open the Select Tool To Share dialog box. Select the item and click OK.
- Save from the History pane.
- 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 SD > Web Tool on Portal.
The Save As Offline Service Definition pane appears.
- Save from the Share tab.
- Configure all the parameters you want to change in the Save As Offline Service Definition pane. Be sure to choose the correct ArcGIS Enterprise version 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, select the checkbox 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.
When ready to publish a web tool to an ArcGIS Enterprise portal, see Publish a service definition.