Welcome to OStack Knowledge Sharing Community for programmer and developer-Open, Learning and Share
Welcome To Ask or Share your Answers For Others

Categories

0 votes
305 views
in Technique[技术] by (71.8m points)

json - 401 Error when creating file using SFTP Logic App Action

I am transferring 50 flat files smaller than 15mb each from blob Azure storage to an SFTP site using the create file SFTP action. When the App completes it does so without writing all the files to SFTP it only writes maybe 46 files. when checking the run details I see 401 Permission errors on the files that did not transfer in some cases it writes 0 bytes and does not fail consistently for the same files. So there are 2 concerns here 1 is how is possible to get a 401 error for only some files and 2 how to add additional code to retry the failed files or 0 byte files since doing a retry works.Click here to see actions

question from:https://stackoverflow.com/questions/65946124/401-error-when-creating-file-using-sftp-logic-app-action

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome To Ask or Share your Answers For Others

1 Answer

0 votes
by (71.8m points)

Your SFTP server address and account credentials, which let your logic app access your SFTP account. You also need access to an SSH private key and the SSH private key password. To use chunking when uploading large files, you need both read and write permissions for the root folder on your SFTP server. Otherwise, you get a "401 Unauthorized" error.

401 is usually an error caused by no authentication, but why some files can be created successfully and some failed, I am very confused. Maybe you need to seek help from Microsoft official technical support.

If the Create file action fails, you can use until to retry:

Expression in Until action:

actions('<Create_file-action-name>').status

enter image description here

But those 0-byte files may need to be traversed from the sftp server to judge, which will be very complicated.


与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome to OStack Knowledge Sharing Community for programmer and developer-Open, Learning and Share
Click Here to Ask a Question

...