1

是否有任何 ARM 模板用于侦听保管箱文件夹并在 FTP 中创建文件。我确实在 blob 到 FTP 上找到了 azure 中的模板。

另外,部署模板中的 Dropbox 连接资源是什么?我从哪里可以在文档中获得这些详细信息。

请找到我的部署 json 如下

{
  "$schema": "http://schema.management.azure.com/schemas/2015-01-01/deploymentTemplate.json#",
  "contentVersion": "1.0.0.0",
  "parameters": {
  "dropboxconnectionaccountname": {
  "type": "string",
  "metadata": {
    "description": "Account name of the dropbox."
  }
},
"dropboxpassword": {
  "type": "securestring",
  "metadata": {
    "description": "Password for the dropbox account"
  }
},
"dropboxconnectionname": {
  "type": "string",
  "metadata": {
    "description": "The name of the Dropbox connection being created."
  }
},
"ftpServerAddress": {
  "type": "string",
  "metadata": {
    "description": "The address of the FTP server."
  }
},
"ftpUsername": {
  "type": "string",
  "metadata": {
    "description": "The username for the FTP server."
  }
},

 "ftpPassword": {
  "type": "securestring",
  "metadata": {
"description": "The password for the FTP server."
          }
},
"ftpServerPort": {
  "type": "int",
  "defaultvalue": 21,
  "metadata": {
    "description": "The port for the FTP server."
  }
},

"ftpconnectionname": {
  "type": "string",
  "metadata": {
    "description": "The name of the FTP connection being created."
  }
},  

"logicAppName": {
  "type": "string",
  "metadata": {
    "description": "The name of the logic app to create."
  }
},
"flowSkuName": {
  "type": "string",
  "defaultValue": "Standard",
  "allowedValues": [
    "Free",
    "Basic",
    "Standard",
    "Premium"
  ],
  "metadata": {
    "description": "The pricing tier for the logic app."
  }
},
"hostingPlanName": {
  "type": "string",
  "metadata": {
    "description": "The name of the App Service plan to create for hosting the logic app."
  }
},
"hostingSkuName": {
  "type": "string",
  "defaultValue": "S1",
  "allowedValues": [
    "F1",
    "D1",
    "B1",
    "B2",
    "B3",
    "S1",
    "S2",
    "S3",
    "P1",
    "P2",
    "P3",
    "P4"
  ],
  "metadata": {
    "description": "Describes plan's pricing tier and instance size."
  }
},
"hostingSkuCapacity": {
  "type": "int",
  "defaultValue": 1,
  "minValue": 1,
  "metadata": {
    "description": "Describes plan's instance count"
  }
},
"testUri": {
  "type": "string",
  "defaultValue": "http://azure.microsoft.com/en-us/status/feed/",
  "metadata": {
    "description": "A test URI"
  }
}
  },
 "variables": {
"$ftpisssl": true,
"$ftpisBinaryTransport": true,
"$ftpdisableCertificateValidation": true

  },
  "resources": [
{
  "type": "Microsoft.Web/connections",
  "apiVersion": "2016-06-01",
  "location": "[resourceGroup().location]",
  "name": "[parameters('dropboxconnectionname')]",
  "properties": {
    "api": {
      "id": "[concat(subscription().id,'/providers/Microsoft.Web/locations/', resourceGroup().location, '/managedApis/dropbox')]"
    },
    "displayName": "dropbox",
    "parameterValues": {
      "email": "[parameters('dropboxconnectionaccountname')]",
      "password": "[parameters('dropboxpassword')]"
    }
  }
}, 
{
  "type": "Microsoft.Web/connections",
  "apiVersion": "2016-06-01",
  "location": "[resourceGroup().location]",
  "name": "[parameters('ftpconnectionname')]",
  "properties": {
    "api": {
      "id": "[concat(subscription().id,'/providers/Microsoft.Web/locations/', resourceGroup().location, '/managedApis/ftp')]"
    },
    "displayName": "ftp",
    "parameterValues": {
      "serverAddress": "[parameters('ftpServerAddress')]",
      "userName": "[parameters('ftpUsername')]",
      "password": "[parameters('ftpPassword')]",
      "serverPort": "[parameters('ftpServerPort')]",
      "isssl": "[variables('$ftpisssl')]",
      "isBinaryTransport": "[variables('$ftpisBinaryTransport')]",
      "disableCertificateValidation": "[variables('$ftpdisableCertificateValidation')]"
    }
  }
},
{
  "apiVersion": "2015-08-01",
  "name": "[parameters('hostingPlanName')]",
  "type": "Microsoft.Web/serverfarms",
  "location": "[resourceGroup().location]",
  "tags": {
    "displayName": "HostingPlan"
  },
  "sku": {
    "name": "[parameters('hostingSkuName')]",
    "capacity": "[parameters('hostingSkuCapacity')]"
  },
  "properties": {
    "name": "[parameters('hostingPlanName')]"
  }
},
{
  "type": "Microsoft.Logic/workflows",
  "apiVersion": "2015-08-01-preview",
  "name": "[parameters('logicAppName')]",
  "location": "[resourceGroup().location]",
  "dependsOn": [
    "[resourceId('Microsoft.Web/connections', parameters('dropboxconnectionname'))]",
    "[resourceId('Microsoft.Web/connections', parameters('ftpconnectionname'))]"
  ],
  "tags": {
    "displayName": "LogicApp"
  },
  "properties": {
    "sku": {
      "name": "[parameters('flowSkuName')]",
      "plan": {
        "id": "[concat(resourceGroup().id, '/providers/Microsoft.Web/serverfarms/',parameters('hostingPlanName'))]"
      }
    },
    "definition": {
            "$schema": "https://schema.management.azure.com/providers/Microsoft.Logic/schemas/2016-06-01/workflowdefinition.json#",
            "actions": {
                "Create_file": {
                        "inputs": {
                            "body": "@triggerBody()",
                            "host": {
                                "api": {
                                    "runtimeUrl": "[concat('https://logic-apis-', resourceGroup().location, '.azure-apim.net/apim/ftp')]"
                                },
                                "connection": {
                                    "name": "@parameters('$connections')['ftp']['connectionId']"
                                }
                            },
                            "method": "post",
                            "path": "/datasets/default/files",
                            "queries": {
                                "folderPath": "/site/wwwroot/",
                                "name": "@{triggerOutputs()['headers']?['x-ms-file-name']}"
                            }
                        },
                        "runAfter": {},
                        "type": "ApiConnection"
                    }
                },
                "contentVersion": "1.0.0.0",
                "outputs": {},
                "parameters": {
                    "$connections": {
                        "defaultValue": {},
                        "type": "Object"
                    }
                },
                "triggers": {
                    "When_a_file_is_added_or_modified": {
                        "inputs": {
                            "host": {
                                "api": {
                                    "runtimeUrl": "[concat('https://logic-apis-', resourceGroup().location, '.azure-apim.net/apim/dropbox')]"
                                },
                                "connection": {
                                    "name": "@parameters('$connections')['dropbox']['connectionId']"
                                }
                            },
                            "method": "get",
                            "path": "/datasets/default/triggers/onupdatedfile",
                            "queries": {
                                "folderId": "/site/wwwroot"
                            }
                        },
                        "recurrence": {
                            "frequency": "Second",
                            "interval": 15
                        },
                        "type": "ApiConnection"
                    }
                }
        },
    "parameters": {
        "$connections": {
        "value": {
          "ftp": {
            "id": "[reference(concat('Microsoft.Web/connections/', parameters('ftpconnectionname')), '2015-08-01-preview').api.id]",  
            "connectionName": "[parameters('ftpconnectionname')]",
            "connectionId": "[resourceId('Microsoft.Web/connections', parameters('ftpconnectionname'))]"
          },
          "dropbox": {
            "id": "[reference(concat('Microsoft.Web/connections/', parameters('dropboxconnectionname')), '2015-08-01-preview').api.id]",  
            "connectionName": "[parameters('dropboxconnectionname')]",
            "connectionId": "[resourceId('Microsoft.Web/connections', parameters('dropboxconnectionname'))]"
          }
        }
      }
    }
  }
}
 ],
 "outputs": {}
}
4

0 回答 0