The layers and tables you add to a map are included in the feature service when you publish. You need to configure the data to meet the requirements of a feature service.
Some data definition requirements are common whether your data source is a geodatabase or a database. Common requirements are described in the next section. In other cases, how you define the data depends on whether it's in a geodatabase or database. The Enterprise or workgroup geodatabase-specific requirements and Database-specific requirements sections below describe those differences.
If you plan to take the feature service offline, additional data preparation is needed. See Prepare data for offline use for more information on those requirements.
Note:
Virtual layers, such as route events and x,y events are read-only through the feature service.
Requirements common to geodatabases and databases
The following requirements are true whether your source data is stored in a database, a workgroup geodatabase, or an enterprise geodatabase:
- Data you publish to the feature service must come from a single source geodatabase or database. You cannot publish data from more than one database connection in a single map.
- The data must have a valid spatial reference defined for it. If it does not, specify one in ArcGIS Pro before you publish. If no spatial reference is defined, you cannot publish the data.
- The database account you stored with the database connection file you register with the GIS Server site must have the privileges necessary to access the data. If the feature service will remain read-only, the account only needs select access to the data. If you plan to use the feature service for editing, you must grant editing permissions on the data. If the database connection you register with the site uses operating system authentication, these permissions must be granted to the ArcGIS Server account.
- Esri recommends that the map you publish as an editable feature service only contain data you want to edit. Publish data that you don't want to edit, such as basemap layers, in a different service. For more information about planning your operational and basemap services, see Map service planning. Another alternative is to use an ArcGIS Online basemap. For more information on designing a map to overlay online maps and services, see Designing a map to overlay ArcGIS Online, Google Maps, or Bing Maps.
- Do not define multiple layers for the same feature class in the map you publish as a feature service if people will be adding the feature service to ArcGIS Pro and editing it. For example, if you want to serve the same feature class with different symbology or different definition queries applied, create separate feature services; do not include these differently configured representations of the same feature class in the same feature service.
- If your data contains z-values and editors need to edit the feature service in clients that do not support adding z-values when editing feature geometry (such as Map Viewer Classic in ArcGIS Online and ArcGIS Enterprise portals), configure the feature service to insert default z-values.
- If your data contains m-values and editors need to edit the feature service in clients that do not support adding m-values when editing feature geometry (such as Map Viewer Classic in ArcGIS Online and ArcGIS Enterprise portals), configure the feature service to insert NaNs for the m-values.
Tip:
ArcGIS Desktop clients support all editing operations (insert, delete, and update, including geometry updates) on features with m- and z-values. You do not need to configure default z- and NaN m-values if editors will only edit the feature service in these clients.
Enterprise or workgroup geodatabase-specific requirements
The feature service requirements listed here are specific to data stored in an enterprise or workgroup geodatabase. Your data needs to meet the requirements described in the previous section, as well as those described in this section.
- You can publish tables or feature classes that are not registered with the geodatabase.
- If you allow edits on the feature service and the feature service contains feature classes that participate in a geometric network, the feature class data must be in the same projection and coordinate reference system used by the editing client application. For example, if you plan to add the feature service to Map Viewer Classic to edit, the data must be stored in WGS 1984 Web Mercator (Auxiliary Sphere). Changing the projection in an ArcGIS Pro map before you publish is not sufficient; the data must use the same projection and coordinate reference system as the editing client.
- Versioned (traditional and branch) and nonversioned geodatabase data is supported in feature services. Branch versioned data must be published to be edited.
- To edit branch versioned data, you must publish a feature layer from ArcGIS Pro that references your registered data. See Share branch versioned data in the ArcGIS Pro help for more information.
- It is not supported to publish a feature layer that references registered data from ArcGIS Pro if any of the following layers are present in your map:
- Dimensions that have not been upgraded
- Group layers
- Query layers that contain virtual columns, where clauses, or joins
- Rasters
- Terrains
- You can include annotation layers in your map when you publish a feature layer that references registered data from ArcGIS Pro.
- ArcMap parcel fabrics are always read-only when accessed through a feature service. Whereas parcel fabrics created in ArcGIS Pro must be published as a feature service edit it.
- You can publish layers that are part of complex types, such as geometric networks and network datasets, but the types themselves are not returned by the feature service. For example, you can query the layers that are part of a network dataset, but you cannot query the network.
- You can include topologies that contain branch versioned feature classes in feature services. Because you can only edit branch versioned data through a feature service, including the topology in the feature service allows you to validate the topology after editing and correct any topology errors that arise as a result of your edits. See Share a topology in the ArcGIS Pro help for more information.
- Feature services allow queries on related data, but only if the relationship is defined through a geodatabase relationship class. If a published map document has a layer and table related through a geodatabase relationship class, the feature service allows queries on the layer to return objects from the related table. To support queries that return related objects, you must include the table and layer involved in the relationship class in the published map document. If either the origin or destination layer or table is not included in the map document, the feature service ignores the relationship.
Note:
For attributed relationship classes, include the relationship class table in the map document.
- To maintain a utility network, you must publish it as a feature layer from ArcGIS Pro. See Publishing and consuming services with the utility network in the ArcGIS Pro help for more information.
- You cannot enable editing when publishing a feature service that contains a view that is registered with the geodatabase.
When you use ArcGIS Survey123 with a feature service that references data in a registered enterprise geodatabase, run the Upgrade Attachments geoprocessing tool in ArcGIS Pro on the data. Upgrading attachments allows Survey123 to associate the images that people submit through the survey with specific survey questions. If you don't upgrade your existing attachments, images are still stored with the survey but will not be associated with a specific survey question.
Caution:
After you run the Upgrade Attachments tool, ArcGIS Desktop, ArcGIS Pro 2.6 and earlier, and ArcGIS Enterprise 10.8.1 and earlier can no longer access the attachment data. If you decide you need to remove the attachments to allow these clients to access the data, run the Downgrade Attachments geoprocessing tool.
Prepare geodatabase data for use while offline
To work with maps when you're offline (in other words, not connected to your organziation's network), enable the sync capability on the feature services you use in your map. For more information, see Prepare data for offline use.
Note:
In future, ArcGIS clients and developer SDKs may support the sync capability in feature services. Currently, ArcGIS Collector and ArcGIS Runtime SDK support working with maps while offline and use the sync capability to synchronize changes.
Other clients can access the sync capability through the ArcGIS REST API.
Database-specific requirements
The following describes feature service data requirements specific to data stored in a database. Your data must meet these requirements in addition to the requirements common to geodatabases and databases.
- When you add database data to a map in ArcGIS Pro, a query layer is created. If you alter the query layer definition, be sure the query contains only one table, does not have duplicate columns, and does not include joins, where clauses, or virtual or merged columns.
- The query layer that's defined for the table determines what data publishes. For example, tables containing data types that are not supported by ArcGIS can be published, but unsupported data types are not accessible through ArcGIS or the feature service. See View database data in ArcGIS for information on how the query layer is initially defined when you add a database table to the map.
- The table must contain a unique integer column maintained by the database. If you create tables and load the data to the database using ArcGIS, a database-maintained unique integer object ID is added automatically. If you create data outside of ArcGIS, be sure to include a database-maintained, unique, not null integer column in the table. If such a column does not exist, you cannot publish a feature service. You can use the Add Incrementing ID Field geoprocessing tool to add a database-maintained integer column to your table in the databases listed in the tool's usage section. For all other databases, use database management system tools or SQL to create the ID column.
- Supported database platforms from which you can publish feature services include Dameng, Db2 (on Linux, UNIX, or Windows), Oracle, PostgreSQL, SAP HANA, SQL Server, Teradata Data Warehouse Appliance, and supported cloud-based database services.