You can use a service definition file to publish a web layer to an ArcGIS Online or ArcGIS Enterprise portal; a locator, web tool, or geodata service to an ArcGIS Enterprise portal; or a service to a stand-alone ArcGIS Server site.
You can create service definitions for web layers, locators, web tools, map services, geocode services, geodata service, and geoprocessing services. To learn more, see Introduction to saving service definitions.
Once you have a service definition, do one of the following to publish a GIS resource to a portal or stand-alone server:
- Run the Upload Service Definition tool.
A warning appears in the tool if the service definition is set to overwrite existing services. If the service name already exists on the server, running the tool will overwrite the service. A new service will be created if the service name doesn't exist. Before running the tool, verify that publishing the service definition would result in the desired outcome.
- Run Upload Service Definition in Python. To learn more, see Use tools in Python.
- If you are publishing an ArcGIS Server service, publish a service definition file from ArcGIS Server Manager.
- If you are publishing a hosted web layer, add the service definition file (.sd) to your portal. See What can you add to ArcGIS Enterprise? for more information.
Service definitions created for locators and web tools cannot be published to ArcGIS Online.
If you published a service definition to ArcGIS Online or an ArcGIS Enterprise portal, an item is created in your organization. If you published a service definition to a stand-alone ArcGIS Server, the service is now running.
Service definition files differ depending on whether you connect to an ArcGIS Server or an ArcGIS Enterprise portal when you create the service definition file. You cannot upload service definitions created for server-based services, such as a map service on a stand-alone server or a map image layer on a federated server, directly to your portal through a web browser. You must use ArcGIS Server Manager to publish server-based services. Similarly, service definitions created for hosted web layers cannot be published from ArcGIS Server Manager. Use your portal website instead. The Upload Service Definition tool can be used to publish all service definitions.