Skip to content

SCP with AZ CLI

If you are using AZ CLI to SSH to servers and rely on Entra authentication, you can use the below to SCP files to the server.

# Export the shh config relating to the target server.
az ssh config --ip {server ip} --file /location/to/store/config

# Use the scp command while specifying the ssh config to use with -F:  
scp -F /location/of/config "filename.zip" {server ip}:/scp/location