目前,我只能使用以下触发器上传一个blobtype(文本)
#r "System.Configuration"
#r "System.Data"
using System.Configuration;
using System.Data.SqlClient;
using System.Threading.Tasks;
using System;
public static void Run(Stream myBlob, string name, TraceWriter log)
{
log.Info($"C# Blob trigger function Processed blob\n Name:{name} \n Size: {myBlob.Length} Bytes");
string detail = ($"{name}");
var str = ConfigurationManager.ConnectionStrings["sqldb_connection"].ConnectionString;
using (SqlConnection conn = new SqlConnection(str))
{
conn.Open();
var text = "INSERT INTO PhotoTable(CreatedAt,UpdatedAt,IsDeleted, Url, Title) " +
"VALUES (SYSDATETIMEOFFSET(),SYSDATETIMEOFFSET(), 'true', 'yrhrh', @Name)";
using (SqlCommand cmd = new SqlCommand(text, conn))
{
cmd.Parameters.AddWithValue("@Name", name);
// Execute the command and log the # rows affected.
var rows = cmd.ExecuteNonQueryAsync();
log.Info($"{rows} rows were updated");
}
}
}
有2个问题 01)我可以同时上传两种类型以使SQLstorage蔚蓝化的任何方式(例如text blob和image blob)
02)使用此触发器,我仅获得Blob存储的ID而不是内容,那也是一个问题,即它们以任何方式也可以获取Blob存储的内容? ,
我们将非常感谢您的帮助,谢谢