Skip to content

Commit

Permalink
fix API change for blob bindings in PerformanceTests
Browse files Browse the repository at this point in the history
  • Loading branch information
sebastianburckhardt committed Oct 2, 2024
1 parent 7080442 commit 9e0277a
Showing 1 changed file with 8 additions and 8 deletions.
16 changes: 8 additions & 8 deletions test/PerformanceTests/Benchmarks/Sequence/BlobSequence.cs
Original file line number Diff line number Diff line change
Expand Up @@ -11,9 +11,9 @@ namespace PerformanceTests.Sequence
using Microsoft.Azure.WebJobs.Extensions.Http;
using Microsoft.AspNetCore.Http;
using Microsoft.Extensions.Logging;
using Microsoft.Azure.Storage.Blob;
using Microsoft.Azure.WebJobs.Extensions.DurableTask;
using Newtonsoft.Json;
using Azure.Storage.Blobs;

/// <summary>
/// An orchestration that runs the sequence using blob triggers.
Expand All @@ -39,22 +39,22 @@ public static async Task<string> Run(
[FunctionName(nameof(SequenceTaskStart))]
public static async Task SequenceTaskStart(
[ActivityTrigger] IDurableActivityContext context,
[Blob("blobtriggers/blobs")] CloudBlobDirectory directory,
[Blob("blobtriggers/blobs")] BlobContainerClient containerClient,
ILogger logger)
{
Sequence.Input input = context.GetInput<Sequence.Input>();
await directory.Container.CreateIfNotExistsAsync();
await containerClient.CreateIfNotExistsAsync();
string content = JsonConvert.SerializeObject(input);
var blob = directory.GetBlockBlobReference(Guid.NewGuid().ToString());
await blob.UploadTextAsync(content);
var blob = containerClient.GetBlobClient(Guid.NewGuid().ToString());
await blob.UploadAsync(content);
logger.LogWarning($"blob sequence {context.InstanceId} started.");
}

[Disable]
[FunctionName(nameof(BlobSequenceTask1))]
public static async Task BlobSequenceTask1(
[BlobTrigger("blobtriggers/blobs/{blobname}")] Stream inputStream,
[Blob("blobtriggers/blobs")] CloudBlobDirectory directory,
[Blob("blobtriggers/blobs")] BlobContainerClient containerClient,
[DurableClient] IDurableClient client,
string blobname,
ILogger logger)
Expand All @@ -72,8 +72,8 @@ public static async Task BlobSequenceTask1(
{
// write the blob to trigger the next task
string content = JsonConvert.SerializeObject(input);
var blob = directory.GetBlockBlobReference(Guid.NewGuid().ToString());
await blob.UploadTextAsync(content);
var blob = containerClient.GetBlobClient(Guid.NewGuid().ToString());
await blob.UploadAsync(content);
}
else
{
Expand Down

0 comments on commit 9e0277a

Please sign in to comment.