Hello,
Where in arcpy for ArcGIS Pro can you obtain the workspaces from the map or layers? I cannot find this property in documentation? Specially I am looking for the name and path of the SDE connection file. This was very helpful when resourcing maps as we use standardize SDE connection names so we migrate maps to other environments we easily find and replace the workspace connection locations & names.
In arcpy.mapping for layers in MXDs there is a property which returns the workspacePaths for the layer. The reference is below.
https://desktop.arcgis.com/en/arcmap/latest/analyze/arcpy-mapping/layer-class.htm
In the ArcGIS Pro this help has an example of using the updateConnectionProperties method. For Enterprise Geodatabases, how does one obtain this connection string so this can be achieved?
https://pro.arcgis.com/en/pro-app/latest/arcpy/mapping/updatingandfixingdatasources.htm
There is an info tip in the Layer help stating there is no reference to the .sde connection file.
https://pro.arcgis.com/en/pro-app/latest/arcpy/mapping/layer-class.htm
Tip:
Enterprise geodatabase layers in an ArcGIS Pro project
do not retain the path to the database connection file (.sde)
that was used to create the layer.
Without the original workspacePath/connection string how is it possible to read the .SDE connections from the map and update them programmatically using updateConnectionProperties?