Powershell函数,有没有办法获取文件的blob名称 [英] Powershell Function, Is there a way to get the blob name of the file

查看:90
本文介绍了Powershell函数,有没有办法获取文件的blob名称的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有以下Powershell Azure功能,它会在blob路径中删除文件时触发。但是我想得到实际的blob名称

I have the following Powershell Azure function and it triggers when a file is dropped in the blob path. However I would like to get the actual blob name

{
  "bindings": [
    {
      "name": "inBlob",
      "type": "blobTrigger",
      "direction": "in",
      "path": "mycontainet/in/{fname}",
      "connection": "AzureWebJobsStorage"
    }
  ]
}

我想从上面得到fname。我目前有大约20种类型的文件登陆输入blob。但是它们每个都有不同的类型(ZIP,固定文本,csv,管道,jpg等),需要以不同的方式处理。此文件名
中包含类型。我试图不写多个函数,并根据需要处理函数调用各种模块。 

I would like to get the fname from the the above. I have around 20 types of files currently landing on the input blob. However each of them is of a different types (ZIP, fixed text, csv, pipe, jpg etc) and needs to be processed differently. This file name had the type in it. I am trying not to write multiple functions and have a function call various modules depending on the processing it needs to do. 

推荐答案

可以在Powershell中使用

Can use


TriggerMetadata.Name来获取blob的名称。



代码片段:
TriggerMetadata.Name in Powershell to get the name of the blob.

Code Snippet :

# Input bindings are passed in via param block.

param([byte[]]


InputBlob,
InputBlob,


这篇关于Powershell函数,有没有办法获取文件的blob名称的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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