Publishing a geodata service involves referencing a file geodatabase or enterprise geodatabase that you want to publish as a service. To publish a file geodatabase as a geodata service, the ArcGIS Server account must have permissions to access the geodatabase. To publish an enterprise geodatabase as a geodata service, the ArcGIS Server account must have permissions to access the geodatabase and the connection file used to connect to the geodatabase.
You must use an ArcGIS Server site licensed as ArcGIS GIS Server to publish geodata services.
For example, the connections you've made in the Catalog are located in your Windows profile directory under AppData\Roaming\Esri\ArcGISPro\Favorites. Before publishing the geodata service, it is recommended that you copy the connection file to a common directory to which the ArcGIS Server account has been granted access. For more information, see Make data accessible to ArcGIS Server.
When publishing a geodata service from SQL Server Express, you need to save the connection to your geodatabase to create the connection file. To do this, browse to the geodatabase in the Catalog under the Database Servers node. Right-click the geodatabase you want to publish and click Save Connection. This creates a connection (.sde) file in your profile directory, as described in the previous paragraph. You need to reference this connection file when publishing the geodatabase. As suggested, copy the connection file to a common location to which the ArcGIS Server account has access before you publish the service.
To publish a geodata service, see Share a geodata service.