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

David 40 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.
0 comments No comments
{count} votes

1 answer

Sort by: Most helpful
  1. David 40 Reputation points
    2024-08-14T20:02:13.95+00:00

    Answering my own question, this connector doesn't work like the others, it doesn't keep all the details in connections.json but at the app service configuration level, and, a setting is needed, WEBSITE_CONTENTOVERVNET for this to work,

    All the details available here

    0 comments No comments

Your answer

Answers can be marked as 'Accepted' by the question author and 'Recommended' by moderators, which helps users know the answer solved the author's problem.