如何使用C#使用azure blob触发器将文件从azure blob复制到内部部署文件系统? [英] How to copy a file from azure blob to on-premise file system using azure blob trigger using C#?

查看:332
本文介绍了如何使用C#使用azure blob触发器将文件从azure blob复制到内部部署文件系统?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在尝试创建一个azure blob触发器,将上传到azure blob的文件复制到内部部署文件系统。任何人都可以提供相同的步骤吗?



我尝试过:



我创建了一个blob触发器并将其输出参数绑定到外部文件(预览)并选择了文件系统API。它要求显示名称,根文件夹,用户名和密码。这里有什么以及如何将azure连接到我机器的文件系统?





I am trying to create an azure blob trigger to copy the file uploaded to the azure blob to the on premise file system. Can anyone please provide the steps for the same?

What I have tried:

I created a blob trigger and bound its output parameter to external file(preview) and selected the File System API. It asks for Display name, root folder, username and password. What goes here and how to connect azure to my machine's file system?


This is my function.json file.

{
  "bindings": [
    {
      "name": "myBlob",
      "type": "blobTrigger",
      "direction": "in",
      "path": "input/{name}",
      "connection": "connection_Name"
    },
    {
      "type": "apiHubFile",
      "name": "outputFile",
      "path": "outout/{name}",
      "connection": "file_system_connection_name",
      "direction": "out",
      "typeProperties": {
        "host": "HostName",
        "userid": "userid",
        "password": "userpassword",
        "gatewayName": "gatewayName"
      }
    }
  ],
  "disabled": false
}


This is my  run.csx  file.
public static void Run(Stream myBlob, string name, TraceWriter log,Stream outputFile)
{
        myBlob.CopyTo(outputFile);
}

推荐答案

此搜索:从azure blob存储下载文件 - Google [ ^ ]为您找到了这个答案:从Azure存储上传和下载文件 - WebApps [ ^ ] - 完整流程的逐步指南,包括屏幕截图和示例源代码!



更新: Blob触发...此搜索:如何创建azure blob触发器功能 - Google搜索 [ ^ ]找到了这个循序渐进的指南:在Azure中创建一个由Blob存储触发的函数Microsoft Docs [ ^ ]



使用Google搜索进行研究是关键!试试吧,这并不难......
This search: download file from azure blob storage - Google[^] found this answer for you: Upload and Download files from Azure Storage – WebApps[^] - a step-by-step-guide through the complete process including screenshots and sample source code!

UPDATE: Blob triggers... This search: how to create a azure blob trigger function - Google Search[^] found this step-by-step guide: Create a function in Azure triggered by Blob storage | Microsoft Docs[^]

Research using Google search is the key! Try, it, it is not hard...


这篇关于如何使用C#使用azure blob触发器将文件从azure blob复制到内部部署文件系统?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆