What do I specify for the root directory using rootDirectory with FtpUpload@2?

Rod Falanga 561 Reputation points
2021-09-08T03:57:47.667+00:00

I'm using the task FtpUpload@2 in an Azure DevOps pipeline to upload a static website to a hosting company. But I'm not sure how to specify the root folder at the destination website. (I know how to do a subfolder, but not the root folder.) Here's what I've got for that step so far:

- task: FtpUpload@2
  inputs:
    credentialsOption: 'inputs'
    serverUrl: 'ftp://ftp.destination.com'
    username: '$(MyUsername)'
    password: '$(MyPassword)'
    rootDirectory: '.'
    filePatterns: '**'
    remoteDirectory: '.'
    clean: true
    cleanContents: false
    preservePaths: true
    trustSSL: false

The thing is I don't know what I should use for remoteDirectory. Should I use an empty string (''), or should I use a single period like I've got here ('.'). Or should I use a single slash ('/')? Or should I use something entirely different?

Not Monitored
Not Monitored
Tag not monitored by Microsoft.
36,194 questions
0 comments No comments
{count} votes

1 answer

Sort by: Most helpful
  1. SnehaAgrawal-MSFT 18,366 Reputation points
    2021-09-08T11:31:44.367+00:00

    Thanks! You may refer to this document link here https://learn.microsoft.com/en-us/azure/devops/pipelines/tasks/utility/ftp-upload?view=azure-devops might be helpful.

    Also, Your query seems to be more related to Azure DevOps and questions related to it are not supported on this forum

    Suggest you to reach out in dedicated forum for it over here : Azure DevOps forum