I am using arcpy.UploadServiceDefinition_server to publish an MXD to an on-premise Portal for ArcGIS 10.4.1 (ArcGIS Server 10.4.1 is installed and federated with the portal).
I have created a script based on this example. I have also been using this documentation (especially example 3) to guide me.
My goal is to share the published services with a group defined on the Portal server, but so far every time I publish, the feature layer is "Not Shared".
Here is an example of my UploadServiceDefinition call:
arcpy.UploadServiceDefinition_server( "myMapService.sd", # in_sd_file "myServerConnection.ags", # in_server "newServiceName", # in_service_name "", # in_cluster "", # in_folder_type "", # in_folder "STARTED", # in_startupType "OVERRIDE_DEFINITION", # in_override "SHARE_ONLINE", # in_my_contents "PRIVATE", # in_public "NO_SHARE_ORGANIZATION", # in_organization "My Group" # in_groups )
I have also tried changing the in_groups parameters to a list, like so:
arcpy.UploadServiceDefinition_server( "myMapService.sd", # in_sd_file "myServerConnection.ags", # in_server "newServiceName", # in_service_name "", # in_cluster "", # in_folder_type "", # in_folder "STARTED", # in_startupType "OVERRIDE_DEFINITION", # in_override "SHARE_ONLINE", # in_my_contents "PRIVATE", # in_public "NO_SHARE_ORGANIZATION", # in_organization ["My Group"] # in_groups )
But, so far, no matter what parameters I supply that seem to apply to sharing, the feature layer is always "Not Shared" after publishing.
Am I missing something fundamental? If anyone can point me toward the light I would be most appreciative.
Pat, have you fixed that? Is your serve federated? How did you create the .ags connection file in first place?
In 10.6 ArcMap if i create a connection to my federated server using Portal BuildIn account and try to publish using it (from ArcMap 10.6) using the standard UI driven publishing process this can be seen:
If I create an .ags connection just as described here (therefore passing my SSO/SAML):
https://community.esri.com/thread/122100
Then the 'Sharing' tab is active. But this only works for publishing from ArcMap. I cannot get an automated publishing workflow being 'signed in' though.