arcpy - sharing and allowExporting settings not working

2 weeks ago
Occasional Contributor

I am publishing a local feature class in arcpy (in ArcGIS Pro) to a Portal hosted feature layer. Some of the settings are not coming through per the documentation. I am following the first code sample in the help almost verbatim (create sharing draft, export to service definition draft, stage service, upload service definition). 

On the sharing draft, I set it to allow exporting like this: 

 sharing_draft.allowExporting = True

I create the feature service via this command: 

in_sd_file = str(sd_file),
in_server = arcpy.GetActivePortalURL(),
in_groups = ['<Group1 name>', '<Group2 name>']


When I look at the item's page, it is only shared at the owner level (should be shared to the organization) and not shared with any groups: 


After it finishes, the settings page shows allow export disabled. I would also love to know how to enable sync, if possible. 


I think some/all of this can be done in the arcgis API, but I'm already using arcpy, so I'd like to keep going with that. 


Note: Same outcome whether creating a new hosted feature layer or overwriting an existing one. 



0 Kudos
0 Replies