Select to view content in your preferred language

Publishing Geoprocessing Service that use Feature Service URLs

1418
10
04-07-2022 08:28 AM
ZacharyHart
Honored Contributor

I've developed a script tool which I'm looking to publish as a GP service. The script leverages several feature service URLs from our Enterprise system hard-coded inputs for the script; using direct DB connections to the under lying database isn't a viable option.

Obviously, you cannot/do not register server URLs with your Data Store, but since the validation process cannot find these resources in the Data Store, it warns that the data source is not registered and will therefore be copied.

 

inFeatures = "https://myserver.mydomain.com/server/rest/services/Folder/FeatureServiceName/FeatureServer/1"

 

I thought that maybe I could simply parameterize these URLs in the Script Tool but I'm not sure that you can make these hidden or locked.

Is there anyway to go about publishing this without using a direct DB connection?

EDIT: I'm suddenly remembering something about registering a folder that contains a valid AGS connection file...hmmm

UPDATE: No dice. I saved a server connection file (.ags) to a folder registered with the data store, but I've am not able to use this input in any code. For example, making a feature layer from the REST endpoint for the layer within the feature service using the .ags file:

 

testLayer = arcpy.management.MakeFeatureLayer("\\\\sharedLocation\\Folder\\AGSConnections\\connectionFile.ags\\serverFolder\\featureService.FeatureServer\\layer","test")

 

[Note this is the format used if you drag the layer from ags connection file in the catalog pane to the Python window in Pro.]

0 Kudos
10 Replies
DougBrowning
MVP Esteemed Contributor

Did you ever figure this out @ZacharyHart ?

0 Kudos