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:
arcpy.server.UploadServiceDefinition(
in_sd_file = str(sd_file),
in_server = arcpy.GetActivePortalURL(),
in_organization='SHARE_ORGANIZATION',
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.
thanks!