Quantcast
Channel: Azure function error
Viewing all articles
Browse latest Browse all 4

Azure function error

$
0
0

il codice è:

run.csx=

#r "System.Drawing"

using System;
using System.Drawing;
using ImageProcessor;

private static readonly Size size = new Size(EnvAsInt("ImageResize-Width"), EnvAsInt("ImageResize-Height"));

public static void Run(Stream myBlob, Stream outputBlob, string name, TraceWriter log)
{
    log.Info($"C# Blob trigger function Processed blob\n Name:{name} \n Size: {myBlob.Length} Bytes");
    if (myBlob==null){
        log.Info($"C# myBlob is NULL");
    }
    log.Info($"C# ok2");
    if (outputBlob==null){
        log.Info($"C# outputBlob is NULL");
    }
    log.Info($"C# ok3");
    using (var imageFactory = new ImageFactory())
    {
        log.Info($"C# ok31");
        imageFactory
            .Load(myBlob)
            .Resize(size)
            .Save(outputBlob);
    }
    log.Info($"C# ok4");
}


private static int EnvAsInt(string name) => int.Parse(Env(name));
private static string Env(string name) => System.Environment.GetEnvironmentVariable(name, EnvironmentVariableTarget.Process);

function.json=

{"bindings": [
    {"type": "blob","name": "outputBlob","path": "photosthumbnails/{name}","connection": "AzureWebJobsStorage","direction": "out"
    },
    {"type": "blobTrigger","name": "myBlob","path": "photos/{name}","connection": "AzureWebJobsStorage","direction": "in"
    }
  ],"disabled": false
}

va in errore in 

imageFactory
            .Load(myBlob)
            .Resize(size)
            .Save(outputBlob);

dov'è sbaglio?

grazie



Viewing all articles
Browse latest Browse all 4

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>