Azure / Azure/logicapps

SFTP Connector - "Get file or directory metadata" action not working as intended - can't retrieve outputs from action

Open
#1,492 0 comments 0 reactions 0 assignees View on GitHub
bug
Dominant language
ABAP
Stars
424
Forks
320
Avg merge
14h 41m
Merged PRs (30d)
1

Description

### Severity

P2 - High (Major functionality broken)

### Describe the Bug with repro steps

**Expected behaviour:**
- When a "Get file or directory metadata" action is added to an Azure Logic App Workflow, I should be able to retrieve and use the outputs of this action in subsequent actions (e.g. I should be able to see a file's "Created date" metadata and set it as a variable).

**Actual behaviour:**
- I am unable to retrieve or use any outputs from the "Get file or directory metadata" action in subsequent actions.

**Steps to reproduce:**
1. Create an Azure Logic App Workflow with any trigger, e.g. "Scheduled to run once a month"
2. Add the SFTP action "List folder", fill in the connection screen using valid credentials to an SFTP, and point it to a folder that has multiple files in it
3. Add the SFTP action "Get file or directory metadata", and in the "File Or Folder Path" field, click the lightning bolt icon ("Enter data from a previous step") and select "List folder output body Path relative to root directory" output from the previous "List folder" step. This should add a "For each" loop around the "Get file or directory metadata" action.
4. Add the Outlook 365 action "Send an email (V2)"
5. In the body of the email, click the lightning bolt icon ("Enter data from a previous step") - you will see here that you are unable to use any of the data from the "Get file or directory metadata" action. It simply doesn't appear in the list.

I have included two screenshots:

1. One shows a test workflow
2. The other shows me attempting to add data from previous actions to an Outlook "Send an email (V2)", per my above repro steps. You can see that I'm able to add data from the initial "List folder" action, and I'm also able to add data from a different SFTP action, "Get file content". There is no option to add data from the previous "Get file or directory metadata" action.

Image
Image

### What type of Logic App Is this happening in?

Standard (Portal)

### Are you experiencing a regression?

_No response_

### Which operating system are you using?

Windows

### Did you refer to the TSG before filing this issue? https://aka.ms/lauxtsg

Yes

### Workflow JSON

```json
// I have removed all connection names and references.

{
"definition": {
"$schema": "https://schema.management.azure.com/providers/Microsoft.Logic/schemas/2016-06-01/workflowdefinition.json#",
"contentVersion": "1.0.0.0",
"actions": {
"List_folder": {
"type": "ServiceProvider",
"inputs": {
"parameters": {
"folderPath": "/outgoing/SCV/",
"filesOnly": true
},
"serviceProviderConfiguration": {
"connectionName": "",
"operationId": "listFolder",
"serviceProviderId": "/serviceProviders/Sftp"
}
},
"runAfter": {}
},
"For_each": {
"type": "foreach",
"foreach": "@outputs('List_folder')?['body']",
"actions": {
"Get_file_or_directory_metadata": {
"type": "ServiceProvider",
"inputs": {
"parameters": {
"fileOrFolderPath": "@item()?['pathRelativeToRootDirectory']"
},
"serviceProviderConfiguration": {
"connectionName": "",
"operationId": "getMetadata",
"serviceProviderId": "/serviceProviders/Sftp"
}
},
"runAfter": {
"Get_file_content": [
"SUCCEEDED"
]
}
},
"Get_file_content": {
"type": "ServiceProvider",
"inputs": {
"parameters": {
"filePath": "@item()?['absolutePath']",
"inferContentType": true
},
"serviceProviderConfiguration": {
"connectionName": "",
"operationId": "getFileContent",
"serviceProviderId": "/serviceProviders/Sftp"
}
}
},
"Send_an_email_(V2)": {
"type": "ApiConnection",
"inputs": {
"host": {
"connection": {
"referenceName": ""
}
},
"method": "post",
"body": {
"To": "",
"Subject": "test",
"Body": "

test

",
"Importance": "Normal"
},
"path": "/v2/Mail"
},
"runAfter": {
"Get_file_or_directory_metadata": [
"SUCCEEDED"
]
}
}
},
"runAfter": {
"List_folder": [
"SUCCEEDED"
]
}
}
},
"outputs": {},
"triggers": {
"Recurrence": {
"type": "Recurrence",
"recurrence": {
"interval": 1,
"frequency": "Month"
}
}
}
},
"kind": "Stateful"
}
```

### Screenshots or Videos

Image
Image

### Environment

- Browser: Microsoft Edge, Version 139.0.3405.125
- VS Code Version: Unsure
- Extension Version: Unsure
- Azure CLI Version: Unsure

### Additional context

_No response_

Contributor guide

No contributing guide indexed for this repository

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.