Azure 函数 Blob 存储日期时间输出路径
Azure functions Blob Storage Date Time output path
我有一个将 Blob 存储作为输出的 azure 函数。
我的问题是如何从 Azure 函数指定 {date}/{time} 输出路径模式?我不想将所有 blob 平放在容器中。
我尝试了 mycontainername/{date}/{time},但它抱怨说 "No binding parameter exists for 'date'"
谢谢
您可以使用具有适当格式字符串的 datetime
参数解析器。
例如:
{datetime:yyyy}
将导致 2017 年(2017 年)
{datetime:hhmmss}
将得到小时、分钟和秒,没有分隔符。
使用的格式字符串是.NET框架支持的格式字符串,您可以了解更多信息here。 (也支持标准字符串)。
您现在也可以在 Java Azure Function 中使用它。
{日期时间}
示例:
@BlobOutput(name = "blob", connection = "AzureWebJobsStorage", path = "samples-java/new-{DateTime}.zip") OutputBinding<byte[]> blob
我有一个将 Blob 存储作为输出的 azure 函数。 我的问题是如何从 Azure 函数指定 {date}/{time} 输出路径模式?我不想将所有 blob 平放在容器中。
我尝试了 mycontainername/{date}/{time},但它抱怨说 "No binding parameter exists for 'date'"
谢谢
您可以使用具有适当格式字符串的 datetime
参数解析器。
例如:
{datetime:yyyy}
将导致 2017 年(2017 年)
{datetime:hhmmss}
将得到小时、分钟和秒,没有分隔符。
使用的格式字符串是.NET框架支持的格式字符串,您可以了解更多信息here。 (也支持标准字符串)。
您现在也可以在 Java Azure Function 中使用它。
{日期时间}
示例:
@BlobOutput(name = "blob", connection = "AzureWebJobsStorage", path = "samples-java/new-{DateTime}.zip") OutputBinding<byte[]> blob