About service definition files
If you have limited access to the server—for example, in a cloud environment or secure environment—you can create a service definition file that can be shared with a server administrator for publishing at a later time. A service definition file contains information about service properties, capabilities, and the service type, which is encapsulated into one portable file. Optionally, you can configure the service definition file to include the data referenced by your GIS resource.
For example, suppose you're a GIS analyst managing a geodatabase that is constantly being modified by dozens of editors. Every month, this data goes through a quality assurance process to make sure it meets your organization's data integrity standards. After quality checking the data, you can capture the verified geodatabase with a service definition file and transfer it to your server administrator for publishing to ArcGIS Server.
Be aware that service definition files differ depending on whether you connect to an ArcGIS Server site or an organization when you create the service definition file. If you are connected to an ArcGIS Server site or choose the option to include the data referenced by your GIS resource when you create the service definition file, the file can only be used with an ArcGIS Server site; you cannot publish it to Portal for ArcGIS or ArcGIS Online. Similarly, if you are connected to an organization when you create the service definition file, you cannot publish the service definition file to an ArcGIS Server site.
Creating service definition files
Use ArcGIS for Desktop to create a service definition file. You can create a service definition file from any GIS resource: a geodatabase, address locator, map document, geoprocessing model, and so on. Before you go through the process of creating a service definition file, consider the following scenarios:
If you have already configured a server connection
If you or your server administrator have already configured a server connection to use when publishing to ArcGIS Server, you can select this connection when creating the service definition file. Selecting this option creates a service definition file that your server administrator can immediately publish to ArcGIS Server.
If you specify a server connection when creating your service definition, you'll need to decide if you want the data referenced by your GIS resource to be included with the file. For example:
- If you do not want the service definition file to include the data referenced by your GIS resource, you'll need to register your data with the server before creating the file. Data registration provides the server knowledge about the location of your data and helps it understand how to adjust data paths when publishing across machines. When you publish, the service will continue to reference the original data included in your GIS resource. A separate copy is not maintained on the server.
- If you want the service definition to include the data referenced by your GIS resource, do not register your data with the server. All of the data referenced by your GIS resource is encapsulated into the service definition file. When you publish, the service and its associated data are uploaded to the server.
If you are disconnected from the server or have limited access
If you are currently disconnected from the server or do not have access to a server connection, you can configure your service definition with no available connection to ArcGIS Server. Selecting this option creates a service definition file that will have to be configured to work with a server connection at the time of publishing.
If you do not specify a server connection when creating your service definition, you'll need to decide if you want the data referenced by your GIS resource to be included with the file. For example:
- If you do not want the service definition file to include the data referenced by your GIS resource, make sure the Include data in service definition when publishing option is unchecked when creating the file. The data needs to be in a location that is visible to ArcGIS Server and is not required to be registered with the server. When you publish, the service will continue to reference the original data included in your GIS resource. A separate copy is not maintained on the server.
- If you want the service definition to include the data referenced by your GIS resource, select Include data in service definition when publishing when creating the file. Enabling this option copies all of the data referenced by your GIS resource and encapsulates it into the service definition file. When you publish, the service and its associated data are uploaded to the server.
For full instructions, see Creating a service definition in ArcGIS for Desktop.
Publishing service definition files
You can use ArcGIS for Desktop or ArcGIS Server Manager to publish service definition files to ArcGIS Server. For full instructions, see the following topics:
Changing the default staging location
By default, ArcGIS for Desktop stages service definition files to a local folder on disk. If you want to change the default staging location, see the topic Changing the default staging folder in ArcGIS for Desktop.