ArcGIS Pro 2.4.3
In pro, you can add a feature service and manually export the features to a file geodatabase feature class.
How do you mimic that functionality in python? I have tried:
<SPAN class="keyword token">import</SPAN> arcpy
source <SPAN class="operator token">=</SPAN> r<SPAN class="string token">'https://path/toOur/rest/services/MapServer/0'</SPAN>
arcpy<SPAN class="punctuation token">.</SPAN>FeatureClassToFeatureClass_conversion<SPAN class="punctuation token">(</SPAN>source<SPAN class="punctuation token">,</SPAN>r<SPAN class="string token">'C:\pathTo\Test.gdb'</SPAN><SPAN class="punctuation token">,</SPAN><SPAN class="string token">'newFC'</SPAN><SPAN class="punctuation token">)</SPAN>
<SPAN class="line-numbers-rows"><SPAN></SPAN><SPAN></SPAN><SPAN></SPAN><SPAN></SPAN></SPAN>
and get :
ExecuteError: ERROR 000210: Cannot create output C:\pathTo\Test.gdb\newFC
Failed to execute (FeatureClassToFeatureClass).
I googled the error, and then tried to use the same python approach with an Egdb feature class as the source, and it worked splendidly. Is this a case for the python api?