Azure / logicapps

Azure Logic Apps labs, samples, and tools
MIT License
348 stars 291 forks source link

SFTP connector adding superfluous backslash #1088

Open brad302 opened 2 weeks ago

brad302 commented 2 weeks ago

Describe the Bug

I have an issue where the file name I am passing in to be uploaded does not contain a leading backslash but it is being added once the file reaches the SFTP endpoint. It may be because the endpoint itself is actually an S3 bucket and therefore, backslashes end up forming a part of the file name rather than a folder path.

I'm not passing anything in other than the name of the file which is WFS.csv ...! That file is not expected to reside in any folder below the root folder the user has access to.

image

image

Plan Type

Standard

Steps to Reproduce the Bug or Issue

It's simple, see the screenshots.

Workflow JSON

{
    "definition": {
        "$schema": "https://schema.management.azure.com/providers/Microsoft.Logic/schemas/2016-06-01/workflowdefinition.json#",
        "actions": {
            "Is_WFS_File": {
                "type": "If",
                "expression": {
                    "and": [
                        {
                            "equals": [
                                "@first(split(triggerBody()?['properties']?['blobPath'], '/'))",
                                "WFS"
                            ]
                        }
                    ]
                },
                "actions": {
                    "Upload_Blob_Content_To_WFS": {
                        "type": "ServiceProvider",
                        "inputs": {
                            "parameters": {
                                "filePath": "@outputs('Compose_File_Name')",
                                "overWriteFileIfExists": true,
                                "content": "@decodeBase64(triggerBody()?['content']['$content'])"
                            },
                            "serviceProviderConfiguration": {
                                "connectionName": "OFlowSFTP",
                                "operationId": "uploadFileContent",
                                "serviceProviderId": "/serviceProviders/Sftp"
                            }
                        },
                        "runAfter": {
                            "Compose_File_Name": [
                                "SUCCEEDED"
                            ]
                        }
                    },
                    "Delete_Blob": {
                        "type": "ServiceProvider",
                        "inputs": {
                            "parameters": {
                                "containerName": "@triggerBody()?['containerInfo']?['name']",
                                "blobName": "@triggerBody()?['properties']?['blobPath']"
                            },
                            "serviceProviderConfiguration": {
                                "connectionName": "AzureBlob",
                                "operationId": "deleteBlob",
                                "serviceProviderId": "/serviceProviders/AzureBlob"
                            }
                        },
                        "runAfter": {
                            "Upload_Blob_Content_To_WFS": [
                                "SUCCEEDED"
                            ]
                        }
                    },
                    "Compose_File_Name": {
                        "type": "Compose",
                        "inputs": "@triggerBody()?['properties']?['blobName']"
                    }
                },
                "else": {
                    "actions": {}
                },
                "runAfter": {}
            }
        },
        "contentVersion": "1.0.0.0",
        "outputs": {},
        "triggers": {
            "When_A_Blob_Is_Added_Or_Updated": {
                "type": "ServiceProvider",
                "inputs": {
                    "parameters": {
                        "path": "lsl-integration-outbound"
                    },
                    "serviceProviderConfiguration": {
                        "connectionName": "AzureBlob",
                        "operationId": "whenABlobIsAddedOrModified",
                        "serviceProviderId": "/serviceProviders/AzureBlob"
                    }
                }
            }
        }
    },
    "kind": "Stateful"
}

Screenshots or Videos

No response

Additional context

No response