I am a computer science student and I working on this project;
Goal: Python script to publish hosted feature layer to AGOL from a geodatabase. To eventually move features to Open Data.
I am referencing my arcpy object to a Pro project in which lives a gdb file. I store the list of items from the gdb into a list called lyrList that is sent to my publish function.
Problem: Publishing is working, however, the sharing to my groups is not. I am passing a list with two group names to UploadServiceDefinition_server just like the documentation asks for. Code was written referencing the sharing module found here: FeatureSharingDraft
My publish( ) function looks like this:
my_groups is a python list of two group names that I need to share to. To me it seems that in my sharing draft I have a property set to no sharing and my Service Definition is not overriding when I call to UploadServiceDefinition( )
Please, any help is greatly appreciated.
Hey Brandon,
It looks like this is a known issue. It will be fixed in the next version of ArcGIS Pro (2.4).
BUG-000120282: The in_groups parameter in UploadServiceDefinition_s..
-Josh
Have you tested if 2.4 resolves this problem?
I wanted to update with my solution for publishing while also sharing to a group. I used a combination of arcpy and published as stated above while also using the Python API sharing module found here: arcgis.gis module — arcgis 1.6.0 documentation
I followed the tutorial for sharing found here: Share maps and layers | ArcGIS for Developers
My solution looks like this just after the UploadServiceDefinition function call:
groups=groups is a Group object that I obtained earlier in the code like this:
The tutorial goes into more detail.