This tutorial gives you the steps for publishing a map service to ArcGIS Server using ArcMap. A map service is the way that you make maps, features, and attribute data available to the web using ArcGIS. If you're new to map services and want to learn more about them before attempting this tutorial, see map services.
ArcGIS Enterprise 10.9.x, including ArcGIS Server, is the last release of ArcGIS Enterprise to support services published from ArcMap. Beginning with the ArcGIS 2022 releases, it will no longer be possible to publish services from ArcMap (including ArcPy code based in ArcMap) to ArcGIS Server sites.
Esri highly recommends that all customers transition all publishing workflows to ArcGIS Pro at this time.
This tutorial demonstrates publishing a map service to ArcGIS Server from ArcMap. The equivalent workflow in ArcGIS Pro depends on whether your ArcGIS Server site is federated with an ArcGIS Enterprise portal. Users can share a web layer from ArcGIS Pro to a portal, which automatically publishes a map service to a federated ArcGIS Server site. You can also publish a map service to a stand-alone ArcGIS Server site from ArcGIS Pro.
Before beginning this tutorial
If you've just installed ArcGIS Server, you need to complete some preparatory steps before you can connect to the server and publish services:
Publish your map as a service
To publish your map as a service, follow these steps.
- Open your map document in ArcMap and choose File > Share As > Service from the main menu.
- In the Share as Service window, choose Publish a service. Click Next.
- In the Publish a Service dialog box, click Connect to ArcGIS Server to create a connection to the server.
- In the Add ArcGIS Server window, choose Publish GIS Services. Click Next.
- For the Server URL text box, type the URL of the ArcGIS Server site you want to connect to, for example, http://gisserver.domain.com:6080/arcgis.
- From the Server Type drop-down list, choose ArcGIS Server.
During the publishing process, a service definition file is created and temporarily stored locally on disk. When the publishing process completes, the service definition is uploaded to the server and the local file is deleted.
- For the purposes of this tutorial, accept the default staging folder and continue.
- If your server administrator has enabled security for your site, enter your User Name and Password. Click Finish.
- Optionally, in the Publish a Service window, enter a new name for the service. Click Next.
The name cannot be more than 120 characters long and may contain only alphanumeric characters and underscores.
By default, services are published to the root folder (root) of ArcGIS Server. Services can be organized into subfolders under the root folder.
- Choose the folder where you want to publish the service, or create a folder to contain the service. Click Continue.
The Service Editor window appears. You can use the Service Editor window to choose what users can do with your map service and take fine-grained control of how the server will expose your service.
- Click the Capabilities tab.
By default, mapping and KML are enabled.
- Click Mapping and review the following properties:
- URL—This is the URL clients use to access the map service. The URL is formatted as follows: http://gisserver.domain.com:6080/arcgis/services/folder/service/MapServer.
- Data—Selecting this option allows client applications to perform attribute searches on the features in your map service.
- Map—Selecting this option allows client applications to view the map layers in your map service.
- Query—Selecting this option allows client applications to query the features in your map service.
- Click Analyze .
This examines your map document to see if it can be published to the server.
To give yourself more viewing area when configuring your map service, click the Collapse button at the top of the Service Editor window.
- Fix any Errors in the Prepare window before you publish. Optionally, fix the warnings and informational messages to further improve the performance and appearance of your map service.
For more information about resolving these issues, see Analyzing your GIS resource.
You can register folders and geodatabases with your ArcGIS Server site, ensuring that the server can recognize and use your data. If you proceed with the following steps, any data referenced by your map document originating from an unregistered folder or geodatabase is copied to the server at the time that you publish. This is a precautionary measure to ensure that the server can access all the data used by the service. For full instructions on registering a folder or geodatabase with your ArcGIS Server site, see Registering your data with ArcGIS Server using ArcGIS Desktop.
- Optionally, in the Service Editor window, click Preview .
This can give you an idea of how your map will look when viewed on the web. See Previewing your map for more information.
- Once you've fixed the errors in your map document, click Publish .
Your map service is published to ArcGIS Server. When the publishing process completes, you are ready to consume your map service in a web map.
Consume the map service in a web map
In this section of the tutorial, you'll use Map Viewer Classic to view and interact with your map service on the web. Map Viewer Classic is hosted on ArcGIS.com and is deployable directly through the ArcGIS Server Services Directory. It does not require any configuration or programming work to get Map Viewer Classic up and running.
Note:In this section, you can visualize your published service with a readily available basemap from ArcGIS Online. To save and share your service in a web map or web app, you must sign in with an organizational or named user account.
You may also configure the ArcGIS Server Services Directory to open the map in ArcGIS Enterprise instead of ArcGIS Online. To see configuration steps, see Connect the ArcGIS Server Services Directory to your portal topic.
To get started, follow these steps.
- Open a web browser and browse to the ArcGIS Server Services Directory.
Typically, this is located at http://gisserver.domain.com:6080/arcgis/rest/services. You can also access the Services Directory by opening the shortcut installed with ArcGIS Server.
- In the services list, click the name of your map service. Typically, this is displayed as <map service name> (MapServer).
If you don't see your map service, it may be located within one of the folders listed in the Services Directory.
- On the page describing your map service, click View In: ArcGIS Online Map Viewer.
A new window (or tab) opens, displaying Map Viewer Classic. The Map Viewer Classic display is zoomed to the extent of your map service.
- Take some time to pan and zoom around your map service.
You can also switch the basemap layer to more appropriately complement the context of your map.
- Optionally, save the web map.
Now that you've successfully tested your map service using Map Viewer Classic, you may want to consider how you can use and share your map in other ArcGIS clients. See the following examples:
- In ArcGIS Online and ArcGIS Enterprise, you can create a customized web mapping app using the Configurable Apps and App Builders.
For more about these and other options, see Configurable Apps & App Builders topics on the ArcGIS for Developers site.
By exploring one or all of the ArcGIS clients listed above, you give yourself additional options that can help you tailor your web mapping scenario for a specific purpose, goal, or organizational strategy.