AnsweredAssumed Answered

Unable to change SDE connections with Layer.updateConnectionProperties

Question asked by sbuscher on Mar 2, 2018

I have an ArcSDE layer added to a map in an aprx.  I want to change its connection to a different ArcSDE gdb using a *.sde connection file. The dataset name is identical in both enterprise GDBs. After running the snippet below the layer's data source remain the same. I realize I could alter the dictionary instead, but that is not ideal as the password is encrypted in the *.sde file. Any insights on how to get this working? Is it even supported? 

...
map = aprx.listMaps()[0]
lyr = map.listLayers()[0]
lyr.updateConnectionProperties(lyr.connectionProperties, r"C:\foo\enterprisegdb.sde")

...

Outcomes