简体   繁体   English

天蓝色函数上传到Blob

[英]azure function upload to blob

I am trying to make an azure function that uploads to my azure blob. 我试图做一个上传到我的天蓝色斑点的天蓝色函数。 Reason I am trying to avoid uploading from my web server (Linux vm) is because I noticed that azure charges for data transfers (traffic from client to the virtual network linked to the VM). 我之所以要避免从Web服务器(Linux vm)上载,是因为我注意到数据传输(从客户端到链接到VM的虚拟网络的流量)的天蓝色收费。 I was also afraid of the network traffic this would cause for the web server. 我也担心这会对Web服务器造成网络流量。 Are these really issues that an azure function can fix? 这些真正的功能可以解决吗?

For creating the function, I used visual studio and added a function with a http trigger to my blob storage. 为了创建函数,我使用了Visual Studio,并在我的Blob存储中添加了带有http触发器的函数。 I was planning to receive a signed JWT and media content via http to the function and upload the image to the blob storage the function is currently in. I did find this code: https://www.cyotek.com/blog/upload-data-to-blob-storage-with-azure-functions Where a new image is create in blob. 我打算通过http接收签名的JWT和媒体内容到函数,并将图像上传到函数当前所在的Blob存储中。我确实找到了以下代码: https : //www.cyotek.com/blog/upload-具有天蓝色功能的数据到blob存储在blob中创建新图像的位置。 However It manually connects to the blob. 但是,它手动连接到Blob。 Since my function is already inside the blob, I was wondering if there was any way it could directly create a blob within the currently storage. 由于我的函数已经在blob中,因此我想知道是否有任何方法可以在当前存储中直接创建blob。 This way the function wouldn't connect to the storage over the internet. 这样,该功能将无法通过Internet连接到存储。

You could use Blob Output Binding feature of Azure Functions. 您可以使用Azure函数的Blob输出绑定功能。

It will give you convenience, however it won't save you any traffic compared to writing the blobs manually. 它会为您提供便利,但是与手动编写Blob相比,它不会为您节省任何流量。 The good news: 好消息:

  • If your function is inside the same Azure region as your Blob Storage account, you won't be charged for any internal traffic 如果您的功能与Blob存储帐户位于同一Azure区域内,则无需为任何内部流量付费

  • All the inbound traffic to Azure is free , so you wouldn't be charged anyway 到Azure的所有入站流量都是免费的 ,因此无论如何都不会向您收费

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM