Logic App Standard in-app Create File Operation - How to configure the connection?

David 0 Reputation points
2024-07-19T21:07:51.7233333+00:00

I want to use the create file shape to create a file in a network reachable file share, windows share, which requires username and password,

When the shape creates the connection, the username is not saved anywhere and the password is saved in app settings (env settings) as FileSystem_password , but not referenced by the connection in connections.json

Connections.json

{
    "managedApiConnections": {},
    "serviceProviderConnections": {
        "FileSystem": {
            "displayName": "share",
            "parameterValues": {
                "mountPath": "@appsetting('FileSystem_mountPath')"
            },
            "serviceProvider": {
                "id": "/serviceProviders/FileSystem"
            }
        }
    }
}

Which settings do I need to manually add for this connector to work, probably wiring up the username and password?

The error message when trying to run it is,

{ "code": "ServiceProviderActionFailed", "message": "The service provider action failed with error code 'ServiceOperationFailed' and error message 'The network path was not found. : 'C:\\mounts\\FileSystem''." }

If I use only the filename in the action,

or

{
  "code": "ServiceProviderActionFailed",
  "message": "The service provider action failed with error code 'Unauthorized' and error message 'Access to the path 'C:\\10.10.10.10\\files' is denied.'."
}

When I use the full path,

Workflow

{
    "definition": {
        "$schema": "https://schema.management.azure.com/providers/Microsoft.Logic/schemas/2016-06-01/workflowdefinition.json#",
        "actions": {
            "Create_file": {
                "inputs": {
                    "parameters": {
                        "body": "the test text",
                        "filePath": "/test.txt" (or \\10.10.10.10\files\text.txt)
                    },
                    "serviceProviderConfiguration": {
                        "connectionName": "FileSystem",
                        "operationId": "createFile",
                        "serviceProviderId": "/serviceProviders/FileSystem"
                    }
                },
                "runAfter": {},
                "type": "ServiceProvider"
            }
        },
        "contentVersion": "1.0.0.0",
        "outputs": {},
        "triggers": {
            "When_a_HTTP_request_is_received": {
                "kind": "Http",
                "type": "Request"
            }
        }
    },
    "kind": "Stateful"
}

This logic app is hosted under a WS1 plan, which is also VNET integrated

Azure Logic Apps
Azure Logic Apps
An Azure service that automates the access and use of data across clouds without writing code.
2,996 questions
0 comments No comments
{count} votes