I'm writing a Python script that will require access to non-token-based ArcGIS Server services. Looking at the ArcPy documentation, the approach is to use ImportCredentials.
In its simplest form, here's my Python script:
<SPAN class="keyword token">import</SPAN> arcpy
arcpy<SPAN class="punctuation token">.</SPAN>ImportCredentials<SPAN class="punctuation token">(</SPAN>my_ags_file<SPAN class="punctuation token">)</SPAN><SPAN class="line-numbers-rows"><SPAN></SPAN><SPAN></SPAN></SPAN>
Attempting to lint or run this code in Visual Studio Code results in the error:
Module 'arcpy' has no 'ImportCredentials' member<SPAN class="line-numbers-rows"><SPAN></SPAN></SPAN>
What am I doing wrong?
Using ArcGIS Pro 2.5.1 and ArcGIS Server 10.8.1