AnsweredAssumed Answered

arcpy.UploadServiceDefinition_server() and On-Premise Portal

Question asked by patblair on Jul 22, 2016
Latest reply on May 15, 2018 by Szymon.Piskula_WoodMacOnline

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.

Outcomes