![](/img/trans.png)
[英]Powershell Azure Function to write an Excel file to Azure Blob Storage
[英]Write to Azure Storage Blob (PowerShell)
我正在尝试使用 PowerShell Azure Z86408593C34AF72FDDZ0B8 写入 Azure 存储 blob。 我在网上找不到任何文档来为 PowerShell 仅 C# 完成此操作。 这就是我所拥有的
using namespace System.Net
# Input bindings are passed in via param block.
param($Request, $TriggerMetadata)
# Interact with query parameters or the body of the request.
$var1 = $Request.Query.var1
if (-not $var1) {
$var1 = $Request.Body.var1
}
$body = "This HTTP triggered function executed successfully. Pass a name in the query string or in the request body for a personalized response."
if ($var1) {
$body = "Variable 1: $var1"
}
outputBlob.WriteLine("test")
# Associate values to output bindings by calling 'Push-OutputBinding'.
Push-OutputBinding -Name Response -Value ([HttpResponseContext]@{
StatusCode = [HttpStatusCode]::OK
Body = $Body
})
当我执行 function 我得到
ERROR: outputBlob.WriteLine: The term 'outputBlob.WriteLine' is not recognized as the name of a cmdlet, function, script file, or operable program.
Azure Blob Stroage 已添加为 Output 集成。
Binding Type: Azure Blob Storage
Blob parameter name: outputBlob
Path: {function}/{rand-guid}
Storage Account Connection: myStorageAccount
任何帮助表示赞赏!
弄清楚了。 我需要推送输出绑定。
这对我有用
Push-OutputBinding -Name outputBlob -Value 'test'
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.