Script overwriting referenced feature layer in Portal for ArcGIS

1054
4
Jump to solution
03-31-2021 07:46 AM
OsgurMcDermott_Long
New Contributor II

Hi, 

I'm hoping someone can help me. I have a feature layer in my local portal instance. This feature service references a dataset that lives in an enterprise geodatabase. Every month a new version of this dataset is added to the enterprise geodatabase and I overwrite the feature layer in portal. The dataset is made up of two layers, point and polygon.

I would like to automate overwriting the feature layer in the portal. However when reading the guidance and looking at blogs they all indicate that you need to overwrite the service definition layer. I do not seem to have a service definition in my portal (is this because its a referenced layer?). 

Does anyone have any script that might be able to solve this? 

Thank you in advance! 

FYI I have looked at the following: 

https://community.esri.com/t5/python-questions/automate-overwrite-web-layer-feature-class/td-p/20067 

https://developers.arcgis.com/python/sample-notebooks/overwriting-feature-layers/

https://www.esri.com/arcgis-blog/products/api-python/analytics/updating-your-hosted-feature-services...

 

 

0 Kudos
1 Solution

Accepted Solutions
MichaelVolz
Esteemed Contributor

So you are not replacing the data set in SDE, but adding a new data set each time?  If this is the case, is there an error in SDE if you try to overwrite the feature data set?

View solution in original post

0 Kudos
4 Replies
MichaelVolz
Esteemed Contributor

It was my understanding that if you reference an enterprise database, the Portal feature layer should be updated automatically with the new data.  Is this not the case for you?

Does the schema of the data change between monthly updates?

0 Kudos
MichaelVolz
Esteemed Contributor

Osgur:

Have you tried to implement the python code in the 3rd link that you have provided?

I am trying to use that code to update a Portal hosted feature layer but I am getting error in Server manager that says it can not find service even though I can perform the same process manually in Pro.  I did see mention of a bug with updating hosted feature layers with python when Active Directory authentication is being used for Portal which is the case at my org.

0 Kudos
OsgurMcDermott_Long
New Contributor II

The schema does not change between versions. The issues is that it isnt ideally set up, I unfortunately have a new dataset each month. If I could replace the layer easily in the Enterprise Geodatabase and maintain the connection to portal that would be great

0 Kudos
MichaelVolz
Esteemed Contributor

So you are not replacing the data set in SDE, but adding a new data set each time?  If this is the case, is there an error in SDE if you try to overwrite the feature data set?

0 Kudos