Frequently asked question
In ArcGIS Pro, the ArcPy classes are used to publish a map object with a service definition file. This article includes a compilation that describes the type of map object and the corresponding workflows according to the destination portal.
Map object type | Hosted Feature Layer and Tile Layer | Non-hosted Map and Feature Services | |
---|---|---|---|
Destination portal | ArcGIS Online and ArcGIS Enterprise | Federated ArcGIS and GIS Server | Standalone ArcGIS and GIS Server |
Create a Map object | ArcGIS Pro: Map | ArcGIS Pro: Map | ArcGIS Pro: Map |
Create a service definition draft object from map object | ArcGIS Pro: Methods Refer to the getWebLayerSharingDraft() function. | ArcGIS Pro: Methods Refer to the getWebLayerSharingDraft() function. For a feature service, use the Modify SDDraft example code sample in ArcGIS Pro: Code sample. | ArcGIS Pro: CreateSharingDraft() For a feature service, use the Modify SDDraft example code sample in ArcGIS Pro: Code sample. |
Export the service definition drat object (.sddraft) to a file | ArcGIS Pro: Methods Refer to the exportToSDDraft() function. | ArcGIS Pro: Methods Refer to the exportToSDDraft() function. | ArcGIS Pro: Methods Refer to the exportToSDDraft() function. |
Stage the service by creating the service definition (.sd) | ArcGIS Pro: Stage Service (Server) | ArcGIS Pro: Stage Service (Server) | ArcGIS Pro: Stage Service (Server) |
Publish the service definition to the destination portal | ArcGIS Pro: Upload Service Definition (Server) | ArcGIS Pro: Upload Service Definition (Server) | ArcGIS Pro: Upload Service Definition (Server) |
Complete code samples | To publish as a web feature layer, refer to ArcGIS Pro: Code Sample (FeatureSharingDraft). To publish as a web tile layer, refer to ArcGIS Pro: Code sample (TileSharingDraft). | To publish as a map image layer, refer to the MapImageSharingDraft script example in ArcGIS Pro: Code sample. | To publish a map image service with a modified service definition draft file, refer to the Modify SDDraft example in ArcGIS Pro: Code sample. |
Get help from ArcGIS experts
Download the Esri Support App