The layers and tables you add to a map from a database connection file (.sde) are included in the feature service when you publish a feature service that references the data registered with the ArcGIS Server site. Before you publish, you must configure the data to meet the requirements of a feature service (also called a web feature layer).
Some data definition requirements are common whether the 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 the source type. The Enterprise 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 use in offline feature services in the ArcGIS Pro help for those requirements.
Requirements common to geodatabases and databases
The following requirements are true whether the source data is stored in a relational database, a cloud data warehouse, or an enterprise geodatabase:
- Data you publish to the feature service must come from a single source. 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, you must specify one in ArcGIS Pro before you publish. If no spatial reference is defined, you cannot publish the data.
- You cannot edit views using ArcGIS clients; therefore, you cannot publish editable feature services that contain layers based on views.
- The database login account used by 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, the same 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. 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 users will be adding the feature service to ArcGIS Pro and editing it. For example, 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 the data contains z-values and editors need to edit the feature service in clients that do not support adding z-values when editing (such as Map Viewer in ArcGIS Online and ArcGIS Enterprise portals), configure the feature service to insert default z-values.
- If the data contains m-values and editors need to edit the feature service in clients that do not support adding m-values when editing (such as Map Viewer in ArcGIS Online and ArcGIS Enterprise portals), configure the feature service to insert NaNs for the m-values.
ArcGIS Pro supports 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 ArcGIS Pro.
- As much as possible, ensure that the schema of the data to be published is well defined and unlikely to change. Making changes to the schema of the source data requires the service to be restarted, at minimum. Some schema changes, such as adding or deleting fields, require you to republish (overwrite) the feature service.
Enterprise geodatabase-specific requirements
The feature service requirements and limitations listed here are specific to data stored in an enterprise geodatabase. The data must meet the requirements described in the previous section, as well as those described in this section.
- Most geodatabase functionality that is available through a feature service must be configured in the geodatabase before you publish.
- It is not supported to use ArcGIS Pro to publish a web feature layer that references registered data if any of the following layers are present in the map:
- Dimensions that have not been upgraded
- Group layers
- Query layers that contain virtual columns, where clauses, or joins
- Feature services allow queries on related data, but only if the relationship is defined through a geodatabase relationship class and both the origin and destination tables are in the map before you publish. See the Relationship classes section below for more information.
- To edit branch versioned data, parcel fabrics, or utility networks, you must publish a web feature layer (feature service) from ArcGIS Pro that references the data.
- 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 users 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.
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 to remove the attachments to allow these clients to access the data, run the Downgrade Attachments geoprocessing tool.
- You cannot enable sync on a feature service if it contains any of the following field data types:
- 64-bit object ID
- Big integer
- Date only
- Time only
- Timestamp offset
See ArcGIS field data types in the ArcGIS Pro help for more information about these types.
- Feature services support versioned (traditional and branch) and nonversioned geodatabase data.
- Even if the database contains an enterprise geodatabase, you can publish tables or feature classes that are not registered with the geodatabase.
Geodatabase functionality in feature services
If the data is stored in an enterprise geodatabase, you can take advantage of the functionality described below. You must configure this functionality before publishing a feature service. If you configure this functionality after publishing, you must republish and overwrite the feature service.
You can include annotation layers in the map when you use ArcGIS Pro to publish a feature service that references registered data.
An attachment is a media file associated with a feature or object in a geodatabase. For example, you can attach photographs and videos to a bird sighting layer. When a user clicks a feature in the bird sighting layer, they can view the attachment.
Feature services allow you to query and edit attachments but, to use this feature, you must configure the datasets in the geodatabase to support attachments. When these datasets are added to a map and published, clients can query, insert, and delete the attachments through the feature service.
There are limits imposed on the size and file types you can attach to a feature service. To learn more about these limits and how to modify attachment settings, see Uploads in the ArcGIS REST API help.
For more information about how to configure a dataset to support attachments, see Add or remove file attachments.
Attribute domains and subtypes
If the data you publish is in a geodatabase, configure the datasets to use attribute domains and subtypes where appropriate to prevent data entry errors. These provide ways of categorizing the data and ensuring that appropriate values are entered when the data is edited. For example, if you have a domain limiting the color of a fire hydrant to red, yellow, or blue, you see a drop-down list in the web application that allows you to only select one of those three colors.
Branch versioned data
To edit data that is registered for branch versioning, you must publish a web feature layer (feature service) with version management enabled. Only the data owner can publish the branch versioned data. See Share branch versioned data in the ArcGIS Pro help for more information.
If you will publish an editable feature service that you share with others, consider enabling editor tracking on the source feature classes to record who creates and alters features.
You can publish oriented imagery data as a feature service to a stand-alone or federated ArcGIS Server site (11.2 or later). You can also publish oriented imagery data as a hosted feature service (hosted feature layer) to ArcGIS Enterprise 11.2 or later or to ArcGIS Online. Each feature service will include an oriented imagery layer, which you can use in imagery workflows. See Introduction to oriented imagery for more information.
At this time, you cannot enable sync on a feature service that includes oriented imagery data.
Parcel fabrics created in ArcGIS Pro must be published as a web feature layer (feature service) to edit it.
To include related data in a feature service or hosted feature layer, define a relationship class between the feature class and related table or feature class. The related data accessed through a relationship class will be included in the feature service you publish. To support queries that return related objects, you must include the table and layer involved in the relationship class in the published map. If either the origin or destination layer or table is not included in the map, the feature service ignores the relationship.
For attributed relationship classes, include the relationship class table in the map.
Topologies check and enforce spatial rules to help you ensure geographic data integrity. If your data is registered for branch versioning, you can create topologies in the geodatabase and include the topologies in 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.
To maintain a utility network, you must publish it as a web feature layer (feature service) from ArcGIS Pro. See Publish and consume services with the utility network in the ArcGIS Pro help for more information.
Prepare geodatabase data for use while offline
To work with maps when you're offline (in other words, not connected to your organization's network), enable the sync capability on the feature services you use in offline maps.
Before you publish a sync-enabled feature service that references data in a geodatabase, you must prepare the data. For more information, see Prepare data for use in offline feature services and Prepare feature services for offline use.
The following describes feature service data requirements specific to data stored in a database. The 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, ensure 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 data from a database or cloud data warehouse in ArcGIS for information about how the query layer is initially defined when you add a database table to the map.
- To publish a feature service from a query
layer that accesses tables that contain the following data types, you can
configure ArcGIS Pro to use data types that are compatible with ArcGIS Pro 3.1 and earlier releases.
- Big integer
- Date only
- Time only
- Timestamp offset
- 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, include a database-maintained, unique, not null integer column in the table. If such a column does not exist in the table, you cannot publish it in 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.
- See Supported databases and cloud data warehouses to learn which can be used as a data source for feature services.