コード例 #1
0
 /// <summary>
 /// Covers:
 /// - queue binding to custom object
 /// - queue trigger
 /// - table writing
 /// </summary>
 public static void QueueToTable(
     [QueueTrigger(TestQueueName)] CustomObject e2equeue,
     [Queue(DoneQueueName)] out string e2edone)
 {
     // Write a queue message to signal the scenario completion
     e2edone = "done";
 }
コード例 #2
0
        /// <summary>
        /// Covers:
        /// - blob binding to custom object
        /// - blob trigger
        /// - queue writing
        /// - blob name pattern binding
        /// </summary>
        public static void BlobToQueue(
            [BlobTrigger(ContainerName + @"/{name}")] string input,
            string name,
            [Queue(TestQueueNameEtag)] out CustomObject output)
        {
            // TODO: Use CustomObject as param when POCO blob supported:
            //       https://github.com/Azure/azure-webjobs-sdk/issues/995
            var inputObject = JsonConvert.DeserializeObject <CustomObject>(input);

            CustomObject result = new CustomObject()
            {
                Text   = inputObject.Text + " " + name,
                Number = inputObject.Number + 1
            };

            output = result;
        }
コード例 #3
0
        private async Task UploadTestObject()
        {
            string testContainerName = _resolver.ResolveInString(ContainerName);

            var container = _blobServiceClient.GetBlobContainerClient(testContainerName);
            await container.CreateIfNotExistsAsync();

            // The test blob
            var          testBlob   = container.GetBlockBlobClient(BlobName);
            CustomObject testObject = new CustomObject()
            {
                Text   = "Test",
                Number = 42
            };

            await testBlob.UploadTextAsync(JsonConvert.SerializeObject(testObject));
        }
コード例 #4
0
 /// <summary>
 /// Covers:
 /// - queue binding to custom object
 /// - queue trigger
 /// - table writing
 /// </summary>
 public static void QueueToICollectorAndQueue(
     [QueueTrigger(TestQueueNameEtag)] CustomObject e2equeue,
     [Queue(TestQueueName)] out CustomObject output)
 {
     output = e2equeue;
 }