This post is related to an earlier question. I'm spawning a new thread since this is a more specific question.
When you're publishing a map service to ArcGIS Enterprise from ArcGIS Pro, you get to choose what server to publish to, e.g. your federated ArcGIS Server or a Hosting Server. You also get to select whether to "Reference Registered Data" or "Copy all data".
There are no similar preferences or parameters when using (documentation😞
inServiceName,inCluster, inFolderType, inFolder, inStartup,
inOverride, inMyContents, inPublic, inOrganization, inGroups)
You just provide a server URL via inServer.
There is also the attribute
sharing_draft = m.getWebLayerSharingDraft( ... )
when creating your sddraft file.
I've run into a conundrum where the published service shows up in my federated server REST endpoint but the underlying SDE data that the map in PRO was referencing is not referenced by the map service, instead a GDB shows up at:
To confirm, if I wipe out the GDB (have to stop Server), sure enough, the associated Portal item comes up blank. I haven't run into this before. All my other scripted publishing has worked like a charm.
Since there is no "Reference Registered Data" option in arcpy, is this possibly default behavior when a specific datastore is not registered in ArcGIS Server Manager?
If the data source that is being published is not registered with ArcGIS Server, ArcGIS Server would most likely copy the data to the server if the ArcGIS Server site that is being published to is not the hosting server. As you alluded to with the description of your testing, ArcGIS Server must have some kind of way to access the underlying data. During the publishing process, it will perform the check to see if the file path that is being used to publish has been registered with ArcGIS Server. If not, then it will make a copy of this data in "arcgisserver\directories\arcgissystem\arcgisinput".
Please let me know if you have any questions.