In this step the map services of the Sample Project will be published to the server.
Note: Ensure that there exists a connection to ArcGIS Server with at least publisher rights. If there is no connection or only a connection with user rights, then create a new one according to chapter Check ArcGIS Server.
First you need to register the SampleProject.gdb with the server. Therefore, right-click your ArcGIS 10.2 for Server connection and open the server properties. Go to tab Data Store and add the SampleProject.gdb to the registered folders.

Register the SampleProject.gdb with the server
Differences of the publishing process regarding dynamic and cached map services will be shown using the MXDs SampleProject_Cadaster.mxd (dynamic) and SampleProject_LandDev.mxd (cached). Publish the other map documents as described below.
| • | Dynamic Services: SampleProject_Elevation.mxd SampleProject_Overview.mxd SampleProject_Poi.mxd SampleProject_Sewer.mxd |
| • | Cached Services: SampleProject_LandDev.mxd SampleProject_Orthophoto.mxd |
Start with the publishing of all dynamic services by opening the MXD SampleProject_Cadaster.mxd from <ArcGIS Server location>\directories\ServiceDocuments.
Choose File > Share As > Service ...

Publish map as service
Pick the first option Publish a service in the window Share as Service.

Publish a service
Choose a connection and keep the default service name.
Note: Ensure that the server has a Publisher role.

Choose connection
By default the services are published to the root folder of ArcGIS 10.2 for Server.
For the sample project create a new folder SampleProject.

Create new folder 'SampleProject'
In the Service Editor window you can define properties of the service.

Properties in Service Editor
Pick Capabilities and deselect KML, Mapping must always be enabled.

Deselect "KML" in the capabilities
In a next step pick Analyze to find potential troubles before publishing the map to the server.

Analyze in Service Editor
A window appears, that shows errors, warnings and messages. In case of the Sample Project files you can leave the warnings and messages unresolved, errors would have to be corrected.
Publish the map to the server with the Publish button.

Publish the service
At the end a note confirms, the the service for SampleProject_Cadaster.mxd has been successfully published.

Service Publishing Result
Publish the following MXDs in the same way as described above:
SampleProject_Elevation.mxd
SampleProject_Overview.mxd
SampleProject_Poi.mxd
SampleProject_Sewer.mxd
Publish Cached Map Services
For the sample project the MXD SampleProject_LandDev.mxd will be published as a cached service. Proceed through the steps as shown before until reaching the service editor. Deactivate KML in Capabilities, then pick Caching and choose Using tiles from a cache (1). Set tiling scheme to ArcGIS Online / Bing Maps / Google Maps (2) and choose 15 to 19 as Levels of Detail (3). Press the button Calculate Cache Size to calculate an estimated cache size (4).

Cache the map service
The estimated cache size will be about 3 MB. Leave all other settings unchanged and publish the service. The cache generation will start immediately after publishing the service.

The cache is being generated
Now publish the MXD SampleProject_Orthophoto.mxd the same way except one point. Before clicking Publish, go to Advanced Settings and change the tile format to JPEG.

Advanced Caching Settings