-
Notifications
You must be signed in to change notification settings - Fork 5
/
Copy the file to SharePoint when a new file is added to an SFTP Server.json
1 lines (1 loc) · 4.77 KB
/
Copy the file to SharePoint when a new file is added to an SFTP Server.json
1
{"$schema":"https://schema.management.azure.com/schemas/2015-01-01/deploymentTemplate.json#","contentVersion":"1.0.0.0","parameters":{"logicAppName":{"type":"String","metadata":{"description":"Name of the logic app."}},"logicAppLocation":{"defaultValue":"[resourceGroup().location]","allowedValues":["eastasia","southeastasia","centralus","eastus","eastus2","westus","northcentralus","southcentralus","northeurope","westeurope","japanwest","japaneast","brazilsouth","australiaeast","australiasoutheast","southindia","centralindia","westindia","canadacentral","canadaeast","westcentralus","westus2","[resourceGroup().location]"],"type":"String","metadata":{"description":"Location of the logic app."}},"onedriveforbusiness_Connection_Name":{"defaultValue":"onedriveforbusiness","type":"String","metadata":{"description":"Name of the connection."}},"sftp_Connection_Name":{"defaultValue":"sftp","type":"String","metadata":{"description":"Name of the connection."}}},"resources":[{"type":"Microsoft.Logic/workflows","apiVersion":"2016-06-01","name":"[parameters('logicAppName')]","location":"[parameters('logicAppLocation')]","dependsOn":["[resourceId('Microsoft.Web/connections', parameters('onedriveforbusiness_Connection_Name'))]","[resourceId('Microsoft.Web/connections', parameters('sftp_Connection_Name'))]"],"properties":{"state":"Disabled","definition":{"$schema":"https://schema.management.azure.com/providers/Microsoft.Logic/schemas/2016-06-01/workflowdefinition.json#","contentVersion":"1.0.0.0","parameters":{"$connections":{"defaultValue":{},"type":"Object"},"$authentication":{"defaultValue":{},"type":"SecureObject"},"sharepoint.site":{"defaultValue":"","type":"String"},"sharepoint.folderPath":{"defaultValue":"","type":"String"}},"triggers":{"When_a_file_is_added_or_modified":{"recurrence":{"frequency":"Minute","interval":5},"metadata":{"flowSystemMetadata":{"swaggerOperationId":"OnUpdatedFile"},"L3Zhci9saWIvM2N4cGJ4L0luc3RhbmNlMS9EYXRhL0JhY2t1cHM=":"/var/lib/3cxpbx/Instance1/Data/Backups"},"type":"ApiConnection","inputs":{"host":{"connection":{"name":"@parameters('$connections')['sftp']['connectionId']"}},"method":"get","path":"/datasets/default/triggers/onupdatedfile","queries":{"folderId":"L3Zhci9saWIvM2N4cGJ4L0luc3RhbmNlMS9EYXRhL0JhY2t1cHM=","includeFileContent":true},"authentication":"@parameters('$authentication')"},"conditions":[]}},"actions":{"Upload_file_to_OneDrive":{"runAfter":{},"metadata":{"flowSystemMetadata":{"swaggerOperationId":"CreateFile"}},"type":"ApiConnection","inputs":{"host":{"connection":{"name":"@parameters('$connections')['onedriveforbusiness']['connectionId']"}},"method":"post","body":"@triggerBody()","path":"/datasets/default/files","queries":{"folderPath":"/PBX Backups/Backups","name":"@base64ToString(triggerOutputs()['headers']['x-ms-file-name-encoded'])"},"authentication":"@parameters('$authentication')"},"runtimeConfiguration":{"contentTransfer":{"transferMode":"Chunked"}}}},"description":"When a file is added to an SFTP server, copy the file to a SharePoint library"},"parameters":{"$connections":{"value":{"onedriveforbusiness":{"id":"[concat('/subscriptions/', subscription().subscriptionId, '/providers/Microsoft.Web/locations/', parameters('logicAppLocation'), '/managedApis/', 'onedriveforbusiness')]","connectionId":"[resourceId('Microsoft.Web/connections', parameters('onedriveforbusiness_Connection_Name'))]","connectionName":"[parameters('onedriveforbusiness_Connection_Name')]"},"sftp":{"id":"[concat('/subscriptions/', subscription().subscriptionId, '/providers/Microsoft.Web/locations/', parameters('logicAppLocation'), '/managedApis/', 'sftp')]","connectionId":"[resourceId('Microsoft.Web/connections', parameters('sftp_Connection_Name'))]","connectionName":"[parameters('sftp_Connection_Name')]"}}}},"runtimeConfiguration":{"lifetime":{"unit":"Day","count":30},"collections":{"maximumItemCount":5000},"performanceProfile":{"throttles":{"mode":"Low"}},"retryPolicy":{"type":"Exponential","interval":"PT5M","count":2,"minimumInterval":"PT5M","maximumInterval":"PT1H"}}}},{"type":"Microsoft.Web/connections","apiVersion":"2016-06-01","name":"[parameters('onedriveforbusiness_Connection_Name')]","location":"[parameters('logicAppLocation')]","properties":{"api":{"id":"[concat('/subscriptions/', subscription().subscriptionId, '/providers/Microsoft.Web/locations/', parameters('logicAppLocation'), '/managedApis/', 'onedriveforbusiness')]"},"displayName":"[parameters('onedriveforbusiness_Connection_Name')]"}},{"type":"Microsoft.Web/connections","apiVersion":"2016-06-01","name":"[parameters('sftp_Connection_Name')]","location":"[parameters('logicAppLocation')]","properties":{"api":{"id":"[concat('/subscriptions/', subscription().subscriptionId, '/providers/Microsoft.Web/locations/', parameters('logicAppLocation'), '/managedApis/', 'sftp')]"},"displayName":"[parameters('sftp_Connection_Name')]"}}]}