Persist invoice validation reports as JSON blobs
This commit is contained in:
1 parent
2075bcb2c3
commit
bb9b20cc25
3 files changed
+93
-38
No files matched your search
@@ -1,5 +1,25 @@
|
||||
using Azure.Storage.Blobs;
|
||||
|
||||
if (args.Length == 2 && args[0] == "result")
|
||||
{
|
||||
var resultBlob = new BlobClient(
|
||||
"UseDevelopmentStorage=true",
|
||||
"results",
|
||||
$"{args[1]}.json");
|
||||
|
||||
if (!(await resultBlob.ExistsAsync()).Value)
|
||||
{
|
||||
Console.Error.WriteLine(
|
||||
"Bericht noch nicht vorhanden. Prüfe das Function-Log und den Blobnamen.");
|
||||
Environment.ExitCode = 1;
|
||||
return;
|
||||
}
|
||||
|
||||
var download = await resultBlob.DownloadContentAsync();
|
||||
Console.WriteLine(download.Value.Content.ToString());
|
||||
return;
|
||||
}
|
||||
|
||||
if (args.Length != 1 || !File.Exists(args[0]))
|
||||
{
|
||||
Console.Error.WriteLine("Bitte eine vorhandene Datei angeben.");
|
||||
@@ -13,6 +33,12 @@ var container = new BlobContainerClient(
|
||||
|
||||
await container.CreateIfNotExistsAsync();
|
||||
|
||||
var resultsContainer = new BlobContainerClient(
|
||||
"UseDevelopmentStorage=true",
|
||||
"results");
|
||||
|
||||
await resultsContainer.CreateIfNotExistsAsync();
|
||||
|
||||
var blobName = $"{Guid.NewGuid():N}-{Path.GetFileName(args[0])}";
|
||||
var blob = container.GetBlobClient(blobName);
|
||||
|
||||
|
||||
Reference in new issue
Block a user