cURL is a command line tool that can be used to send or receive files. cURL.exe supports numerous protocols like HTTP, HTTPS, FTP, FTPS, SFTP, LDAP, TELNET, SMTP, POP3 etc. For more information please refer the below links:

https://en.wikipedia.org/wiki/CURL
https://curl.haxx.se/docs/

Syntax

** curl.exe -T -u “username:password” “FTP URL” </span>**

From curl documentation

T, —upload-file FILE Transfer FILE to destination
url URL URL to work with -u, –user USER[:PASSWORD] Server user and password
tlsuser USER TLS username
tlspassword STRING TLS password
tlsauthtype STRING TLS authentication type (default SRP)

Pre-Requisites:

  • Deployment over FTPS will work only if the version of the curl is SSL aware. Download it from here:

https://curl.haxx.se/download.html

  • FTP endpoint of the web app. You can get this from portal or from the publish profile of the web app (under FTP section search for publishURL)
    • Username and password for authentication (Either deployment or publish profile credentials. See this)
      • With user-level credentials (User specific): sitename\username
        • With site-level credentials (Site specific/publish profile) : sitename$sitename </ul>

      For FTPS

        • Browse to the following location: http://curl.haxx.se/docs/caextract.html
        • Right click and download the “cacert.pem” file and rename the file extension to “.crt” (Use Chrome)
        • </ul> </ul> </td> </tr> </tbody> </table> </blockquote>

          Deploying via FTP

          • Launch command prompt
          • Browse to the folder location where curl was downloaded and execute the following command:
          • </ul>
            C:\>curl -T C:\sample.war -u “kaushalp\$kaushalp:” </span>ftp://waws-prod-sg1-005.ftp.azurewebsites.windows.net/site/wwwroot/ </td> </tr> </table> </blockquote>

            image

            Deploying via FTPS

            While using cURL via FTPS (FTP over SSL), the following error may be encountered when trying to connect over HTTP.

            image

            The following error is seen because curl will try to verify the certificate received in the Server Hello and it fails as it couldn’t verify the CA who issued the certificate.

            This problem can be addressed by using an additional parameter either –cacert or -k can be specified.

            C:\>curl -T C:\sample.war -u “kaushalp\$kaushalp:” ftps://waws-prod-sg1-005.ftp.azurewebsites.windows.net/site/wwwroot/ -k</span> </span> </td> </tr> </table> </blockquote>

            -k, –insecure Allow connections to SSL sites without certs (H)

            C:\>curl -T C:\sample.war -u “kaushalp\$kaushalp:” ftps://waws-prod-sg1-005.ftp.azurewebsites.windows.net/site/wwwroot/ –cacert e:\tools\kaushal-bundle.crt</span> </span> </td> </tr> </table> </blockquote>

            –cacert FILE CA certificate to verify peer against (SSL)

            TROUBLESHOOTING

            Error: “curl: (25) Failed FTP upload: 550
            image
            This error is seen when the FTP URL does not contain a trailing slash “/”.

            More Information:

            Here is the default list of CA’s that are supported by curl: https://curl.haxx.se/ca/cacert.pem (This was the file that was downloaded under pre-requisites)

            Users can generate their own crt file and pass it to CURL.