From b141a22534360af4d2e32828a30bb95019bb1175 Mon Sep 17 00:00:00 2001 From: Kamil Sobol Date: Tue, 2 Feb 2021 10:14:05 -0800 Subject: [PATCH 1/8] nest sample tests? --- ...ure.WebJobs.Extensions.Storage.Queues.Samples.Tests.csproj | 4 ++-- .../samples/{ => readmes}/QueueExtensionSamples.cs | 0 sdk/storage/Microsoft.Azure.WebJobs.Extensions.Storage.sln | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) rename sdk/storage/Microsoft.Azure.WebJobs.Extensions.Storage.Queues/samples/{ => readmes}/Microsoft.Azure.WebJobs.Extensions.Storage.Queues.Samples.Tests.csproj (56%) rename sdk/storage/Microsoft.Azure.WebJobs.Extensions.Storage.Queues/samples/{ => readmes}/QueueExtensionSamples.cs (100%) diff --git a/sdk/storage/Microsoft.Azure.WebJobs.Extensions.Storage.Queues/samples/Microsoft.Azure.WebJobs.Extensions.Storage.Queues.Samples.Tests.csproj b/sdk/storage/Microsoft.Azure.WebJobs.Extensions.Storage.Queues/samples/readmes/Microsoft.Azure.WebJobs.Extensions.Storage.Queues.Samples.Tests.csproj similarity index 56% rename from sdk/storage/Microsoft.Azure.WebJobs.Extensions.Storage.Queues/samples/Microsoft.Azure.WebJobs.Extensions.Storage.Queues.Samples.Tests.csproj rename to sdk/storage/Microsoft.Azure.WebJobs.Extensions.Storage.Queues/samples/readmes/Microsoft.Azure.WebJobs.Extensions.Storage.Queues.Samples.Tests.csproj index 2f520a52c80e8..773d4f494c6fb 100644 --- a/sdk/storage/Microsoft.Azure.WebJobs.Extensions.Storage.Queues/samples/Microsoft.Azure.WebJobs.Extensions.Storage.Queues.Samples.Tests.csproj +++ b/sdk/storage/Microsoft.Azure.WebJobs.Extensions.Storage.Queues/samples/readmes/Microsoft.Azure.WebJobs.Extensions.Storage.Queues.Samples.Tests.csproj @@ -8,7 +8,7 @@ - - + + diff --git a/sdk/storage/Microsoft.Azure.WebJobs.Extensions.Storage.Queues/samples/QueueExtensionSamples.cs b/sdk/storage/Microsoft.Azure.WebJobs.Extensions.Storage.Queues/samples/readmes/QueueExtensionSamples.cs similarity index 100% rename from sdk/storage/Microsoft.Azure.WebJobs.Extensions.Storage.Queues/samples/QueueExtensionSamples.cs rename to sdk/storage/Microsoft.Azure.WebJobs.Extensions.Storage.Queues/samples/readmes/QueueExtensionSamples.cs diff --git a/sdk/storage/Microsoft.Azure.WebJobs.Extensions.Storage.sln b/sdk/storage/Microsoft.Azure.WebJobs.Extensions.Storage.sln index 7c50ce4bf5f2c..bb57622969f37 100644 --- a/sdk/storage/Microsoft.Azure.WebJobs.Extensions.Storage.sln +++ b/sdk/storage/Microsoft.Azure.WebJobs.Extensions.Storage.sln @@ -34,7 +34,7 @@ Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Microsoft.Extensions.Azure" EndProject Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Microsoft.Azure.WebJobs.Extensions.Storage.Blobs.Samples.Tests", "Microsoft.Azure.WebJobs.Extensions.Storage.Blobs\samples\Microsoft.Azure.WebJobs.Extensions.Storage.Blobs.Samples.Tests.csproj", "{77860E78-4770-4C48-8C2B-AF6B42A8D067}" EndProject -Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Microsoft.Azure.WebJobs.Extensions.Storage.Queues.Samples.Tests", "Microsoft.Azure.WebJobs.Extensions.Storage.Queues\samples\Microsoft.Azure.WebJobs.Extensions.Storage.Queues.Samples.Tests.csproj", "{A7A937E4-F4E1-47B7-8D25-AA5FB6BDE010}" +Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Microsoft.Azure.WebJobs.Extensions.Storage.Queues.Samples.Tests", "Microsoft.Azure.WebJobs.Extensions.Storage.Queues\samples\readmes\Microsoft.Azure.WebJobs.Extensions.Storage.Queues.Samples.Tests.csproj", "{A7A937E4-F4E1-47B7-8D25-AA5FB6BDE010}" EndProject Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Microsoft.Azure.WebJobs.Extensions.Storage", "Microsoft.Azure.WebJobs.Extensions.Storage\src\Microsoft.Azure.WebJobs.Extensions.Storage.csproj", "{022028DA-6134-4648-881C-9503E3034995}" EndProject From 7ba85cfb00fd2e1d160269d3e391f512b1e75e6f Mon Sep 17 00:00:00 2001 From: Kamil Sobol Date: Tue, 2 Feb 2021 13:10:19 -0800 Subject: [PATCH 2/8] queues sample app. --- .../README.md | 4 ++ ...Storage.Queues.Samples.Function.App.csproj | 21 ++++++++++ .../samples/functionapp/README.md | 6 +++ .../samples/functionapp/SampleFunctions.cs | 40 +++++++++++++++++++ .../samples/functionapp/host.json | 21 ++++++++++ .../samples/functionapp/local.settings.json | 7 ++++ ...osoft.Azure.WebJobs.Extensions.Storage.sln | 6 +++ 7 files changed, 105 insertions(+) create mode 100644 sdk/storage/Microsoft.Azure.WebJobs.Extensions.Storage.Queues/samples/functionapp/Microsoft.Azure.WebJobs.Extensions.Storage.Queues.Samples.Function.App.csproj create mode 100644 sdk/storage/Microsoft.Azure.WebJobs.Extensions.Storage.Queues/samples/functionapp/README.md create mode 100644 sdk/storage/Microsoft.Azure.WebJobs.Extensions.Storage.Queues/samples/functionapp/SampleFunctions.cs create mode 100644 sdk/storage/Microsoft.Azure.WebJobs.Extensions.Storage.Queues/samples/functionapp/host.json create mode 100644 sdk/storage/Microsoft.Azure.WebJobs.Extensions.Storage.Queues/samples/functionapp/local.settings.json diff --git a/sdk/storage/Microsoft.Azure.WebJobs.Extensions.Storage.Queues/README.md b/sdk/storage/Microsoft.Azure.WebJobs.Extensions.Storage.Queues/README.md index 49f8d56c6be3f..6e647ee794f10 100644 --- a/sdk/storage/Microsoft.Azure.WebJobs.Extensions.Storage.Queues/README.md +++ b/sdk/storage/Microsoft.Azure.WebJobs.Extensions.Storage.Queues/README.md @@ -259,6 +259,10 @@ public static class Function_BindingToQueueClient } ``` +## Configuring the extension + +Please refer to [sample functions app](samples/functionapp). + ## Troubleshooting Please refer to [Monitor Azure Functions](https://docs.microsoft.com/azure/azure-functions/functions-monitoring) for troubleshooting guidance. diff --git a/sdk/storage/Microsoft.Azure.WebJobs.Extensions.Storage.Queues/samples/functionapp/Microsoft.Azure.WebJobs.Extensions.Storage.Queues.Samples.Function.App.csproj b/sdk/storage/Microsoft.Azure.WebJobs.Extensions.Storage.Queues/samples/functionapp/Microsoft.Azure.WebJobs.Extensions.Storage.Queues.Samples.Function.App.csproj new file mode 100644 index 0000000000000..1120b47412e5f --- /dev/null +++ b/sdk/storage/Microsoft.Azure.WebJobs.Extensions.Storage.Queues/samples/functionapp/Microsoft.Azure.WebJobs.Extensions.Storage.Queues.Samples.Function.App.csproj @@ -0,0 +1,21 @@ + + + netcoreapp3.1 + $(RequiredTargetFrameworks) + v3 + + + + + + + + + PreserveNewest + + + PreserveNewest + Never + + + diff --git a/sdk/storage/Microsoft.Azure.WebJobs.Extensions.Storage.Queues/samples/functionapp/README.md b/sdk/storage/Microsoft.Azure.WebJobs.Extensions.Storage.Queues/samples/functionapp/README.md new file mode 100644 index 0000000000000..430afe1f0d934 --- /dev/null +++ b/sdk/storage/Microsoft.Azure.WebJobs.Extensions.Storage.Queues/samples/functionapp/README.md @@ -0,0 +1,6 @@ +# Sample Azure Function App for Azure Azure WebJobs Storage Queues + +This sample Azure Function application shows usage of Azure Azure WebJobs Storage Queues extension. +`SampleFunctions` contains a pair of producer and consumer that work with an Azure Storage Queue +as well as sample configuration files `host.json` and `local.settings.json`. Settings present in `host.json` are optional and used values can be different than defaults. +Connection string present in `local.settings.json` points to [Azurite](https://github.com/Azure/Azurite), however any valid connection string will work. \ No newline at end of file diff --git a/sdk/storage/Microsoft.Azure.WebJobs.Extensions.Storage.Queues/samples/functionapp/SampleFunctions.cs b/sdk/storage/Microsoft.Azure.WebJobs.Extensions.Storage.Queues/samples/functionapp/SampleFunctions.cs new file mode 100644 index 0000000000000..128e9e3d8b5e8 --- /dev/null +++ b/sdk/storage/Microsoft.Azure.WebJobs.Extensions.Storage.Queues/samples/functionapp/SampleFunctions.cs @@ -0,0 +1,40 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +using System; +using Microsoft.Extensions.Logging; + +namespace Microsoft.Azure.WebJobs.Extensions.Storage.Queues.Samples.Function.App +{ + /// + /// A pair of sample functions. First that produces messages on schedule and second that consumes them. + /// + public static class SampleFunctions + { + /// + /// This function executes on schedule, produces a message and inserts it into the queue. + /// + [FunctionName("SampleQueueMessageProducer")] + [return: Queue("sample-queue")] + public static string ProduceSampleQueueMessage([TimerTrigger("*/10 * * * * *")] TimerInfo timerInfo, ILogger logger) + { + if (timerInfo.IsPastDue) + { + logger.LogInformation("Timer is running late!"); + } + var now = DateTime.Now; + logger.LogInformation($"C# Timer trigger function executed at: {now}"); + + return $"Sample queue message produced at: {now}"; + } + + /// + /// This functions is executed as new messages appear on the queue and consumes them. + /// + [FunctionName("SampleQueueMessageConsumer")] + public static void ConsumeSampleQueueMessage([QueueTrigger("sample-queue")] string message, ILogger logger) + { + logger.LogInformation("Queue message received: {message}", message); + } + } +} diff --git a/sdk/storage/Microsoft.Azure.WebJobs.Extensions.Storage.Queues/samples/functionapp/host.json b/sdk/storage/Microsoft.Azure.WebJobs.Extensions.Storage.Queues/samples/functionapp/host.json new file mode 100644 index 0000000000000..49b881be321ba --- /dev/null +++ b/sdk/storage/Microsoft.Azure.WebJobs.Extensions.Storage.Queues/samples/functionapp/host.json @@ -0,0 +1,21 @@ +{ + "version": "2.0", + "logging": { + "applicationInsights": { + "samplingExcludedTypes": "Request", + "samplingSettings": { + "isEnabled": true + } + } + }, + "extensions": { + "queues": { + "messageEncoding": "none", + "maxPollingInterval": "00:00:02", + "visibilityTimeout": "00:00:30", + "batchSize": 16, + "maxDequeueCount": 5, + "newBatchThreshold": 8 + } + } +} \ No newline at end of file diff --git a/sdk/storage/Microsoft.Azure.WebJobs.Extensions.Storage.Queues/samples/functionapp/local.settings.json b/sdk/storage/Microsoft.Azure.WebJobs.Extensions.Storage.Queues/samples/functionapp/local.settings.json new file mode 100644 index 0000000000000..b818866fce362 --- /dev/null +++ b/sdk/storage/Microsoft.Azure.WebJobs.Extensions.Storage.Queues/samples/functionapp/local.settings.json @@ -0,0 +1,7 @@ +{ + "IsEncrypted": false, + "Values": { + "AzureWebJobsStorage": "DefaultEndpointsProtocol=http;AccountName=devstoreaccount1;AccountKey=Eby8vdM02xNOcqFlqUwJPLlmEtlCDXJ1OUzFT50uSRZ6IFsuFq2UVErCz4I6tq/K1SZFPTOtr/KBHBeksoGMGw==;BlobEndpoint=http://127.0.0.1:10000/devstoreaccount1;QueueEndpoint=http://127.0.0.1:10001/devstoreaccount1;", + "FUNCTIONS_WORKER_RUNTIME": "dotnet" + } +} \ No newline at end of file diff --git a/sdk/storage/Microsoft.Azure.WebJobs.Extensions.Storage.sln b/sdk/storage/Microsoft.Azure.WebJobs.Extensions.Storage.sln index bb57622969f37..cab09ab7e147f 100644 --- a/sdk/storage/Microsoft.Azure.WebJobs.Extensions.Storage.sln +++ b/sdk/storage/Microsoft.Azure.WebJobs.Extensions.Storage.sln @@ -38,6 +38,8 @@ Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Microsoft.Azure.WebJobs.Ext EndProject Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Microsoft.Azure.WebJobs.Extensions.Storage", "Microsoft.Azure.WebJobs.Extensions.Storage\src\Microsoft.Azure.WebJobs.Extensions.Storage.csproj", "{022028DA-6134-4648-881C-9503E3034995}" EndProject +Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Microsoft.Azure.WebJobs.Extensions.Storage.Queues.Samples.Function.App", "Microsoft.Azure.WebJobs.Extensions.Storage.Queues\samples\functionapp\Microsoft.Azure.WebJobs.Extensions.Storage.Queues.Samples.Function.App.csproj", "{342E84D9-3073-4536-A895-0F843782BA97}" +EndProject Global GlobalSection(SolutionConfigurationPlatforms) = preSolution Debug|Any CPU = Debug|Any CPU @@ -104,6 +106,10 @@ Global {022028DA-6134-4648-881C-9503E3034995}.Debug|Any CPU.Build.0 = Debug|Any CPU {022028DA-6134-4648-881C-9503E3034995}.Release|Any CPU.ActiveCfg = Release|Any CPU {022028DA-6134-4648-881C-9503E3034995}.Release|Any CPU.Build.0 = Release|Any CPU + {342E84D9-3073-4536-A895-0F843782BA97}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {342E84D9-3073-4536-A895-0F843782BA97}.Debug|Any CPU.Build.0 = Debug|Any CPU + {342E84D9-3073-4536-A895-0F843782BA97}.Release|Any CPU.ActiveCfg = Release|Any CPU + {342E84D9-3073-4536-A895-0F843782BA97}.Release|Any CPU.Build.0 = Release|Any CPU EndGlobalSection GlobalSection(SolutionProperties) = preSolution HideSolutionNode = FALSE From fe4d8e92caa6884074cb67d5015b534275185e4e Mon Sep 17 00:00:00 2001 From: Kamil Sobol Date: Tue, 2 Feb 2021 13:14:42 -0800 Subject: [PATCH 3/8] nesting. --- .../Microsoft.Azure.WebJobs.Extensions.Storage.Queues/README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sdk/storage/Microsoft.Azure.WebJobs.Extensions.Storage.Queues/README.md b/sdk/storage/Microsoft.Azure.WebJobs.Extensions.Storage.Queues/README.md index 6e647ee794f10..05e83d2fec35d 100644 --- a/sdk/storage/Microsoft.Azure.WebJobs.Extensions.Storage.Queues/README.md +++ b/sdk/storage/Microsoft.Azure.WebJobs.Extensions.Storage.Queues/README.md @@ -259,7 +259,7 @@ public static class Function_BindingToQueueClient } ``` -## Configuring the extension +### Configuring the extension Please refer to [sample functions app](samples/functionapp). From f3c0066432cbad98ecba875fd4b6664e9d86a5e9 Mon Sep 17 00:00:00 2001 From: Kamil Sobol Date: Tue, 2 Feb 2021 13:22:38 -0800 Subject: [PATCH 4/8] new link. --- .../Microsoft.Azure.WebJobs.Extensions.Storage.Queues/README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sdk/storage/Microsoft.Azure.WebJobs.Extensions.Storage.Queues/README.md b/sdk/storage/Microsoft.Azure.WebJobs.Extensions.Storage.Queues/README.md index 05e83d2fec35d..a7c0d2371d1e4 100644 --- a/sdk/storage/Microsoft.Azure.WebJobs.Extensions.Storage.Queues/README.md +++ b/sdk/storage/Microsoft.Azure.WebJobs.Extensions.Storage.Queues/README.md @@ -261,7 +261,7 @@ public static class Function_BindingToQueueClient ### Configuring the extension -Please refer to [sample functions app](samples/functionapp). +Please refer to [sample functions app]. ## Troubleshooting From 7f6b35f21255b9292eb5bc29efaedf41ae3e6cf5 Mon Sep 17 00:00:00 2001 From: Kamil Sobol Date: Tue, 2 Feb 2021 14:05:35 -0800 Subject: [PATCH 5/8] blobs sample. --- .../README.md | 4 ++ ....Storage.Blobs.Samples.Function.App.csproj | 21 ++++++++++ .../samples/functionapp/README.md | 6 +++ .../samples/functionapp/SampleFunctions.cs | 40 +++++++++++++++++++ .../samples/functionapp/host.json | 16 ++++++++ .../samples/functionapp/local.settings.json | 7 ++++ .../{ => readmes}/BlobExtensionSamples.cs | 0 ...ensions.Storage.Blobs.Samples.Tests.csproj | 0 ...osoft.Azure.WebJobs.Extensions.Storage.sln | 8 +++- 9 files changed, 101 insertions(+), 1 deletion(-) create mode 100644 sdk/storage/Microsoft.Azure.WebJobs.Extensions.Storage.Blobs/samples/functionapp/Microsoft.Azure.WebJobs.Extensions.Storage.Blobs.Samples.Function.App.csproj create mode 100644 sdk/storage/Microsoft.Azure.WebJobs.Extensions.Storage.Blobs/samples/functionapp/README.md create mode 100644 sdk/storage/Microsoft.Azure.WebJobs.Extensions.Storage.Blobs/samples/functionapp/SampleFunctions.cs create mode 100644 sdk/storage/Microsoft.Azure.WebJobs.Extensions.Storage.Blobs/samples/functionapp/host.json create mode 100644 sdk/storage/Microsoft.Azure.WebJobs.Extensions.Storage.Blobs/samples/functionapp/local.settings.json rename sdk/storage/Microsoft.Azure.WebJobs.Extensions.Storage.Blobs/samples/{ => readmes}/BlobExtensionSamples.cs (100%) rename sdk/storage/Microsoft.Azure.WebJobs.Extensions.Storage.Blobs/samples/{ => readmes}/Microsoft.Azure.WebJobs.Extensions.Storage.Blobs.Samples.Tests.csproj (100%) diff --git a/sdk/storage/Microsoft.Azure.WebJobs.Extensions.Storage.Blobs/README.md b/sdk/storage/Microsoft.Azure.WebJobs.Extensions.Storage.Blobs/README.md index 35c890e1e4f29..fcd9368e12bc4 100644 --- a/sdk/storage/Microsoft.Azure.WebJobs.Extensions.Storage.Blobs/README.md +++ b/sdk/storage/Microsoft.Azure.WebJobs.Extensions.Storage.Blobs/README.md @@ -308,6 +308,10 @@ public static class BlobFunction_EnumerateBlobs_BlobClient } ``` +### Configuring the extension + +Please refer to [sample functions app]. + ## Troubleshooting Please refer to [Monitor Azure Functions](https://docs.microsoft.com/azure/azure-functions/functions-monitoring) for troubleshooting guidance. diff --git a/sdk/storage/Microsoft.Azure.WebJobs.Extensions.Storage.Blobs/samples/functionapp/Microsoft.Azure.WebJobs.Extensions.Storage.Blobs.Samples.Function.App.csproj b/sdk/storage/Microsoft.Azure.WebJobs.Extensions.Storage.Blobs/samples/functionapp/Microsoft.Azure.WebJobs.Extensions.Storage.Blobs.Samples.Function.App.csproj new file mode 100644 index 0000000000000..832daf1b3dff2 --- /dev/null +++ b/sdk/storage/Microsoft.Azure.WebJobs.Extensions.Storage.Blobs/samples/functionapp/Microsoft.Azure.WebJobs.Extensions.Storage.Blobs.Samples.Function.App.csproj @@ -0,0 +1,21 @@ + + + netcoreapp3.1 + $(RequiredTargetFrameworks) + v3 + + + + + + + + + PreserveNewest + + + PreserveNewest + Never + + + diff --git a/sdk/storage/Microsoft.Azure.WebJobs.Extensions.Storage.Blobs/samples/functionapp/README.md b/sdk/storage/Microsoft.Azure.WebJobs.Extensions.Storage.Blobs/samples/functionapp/README.md new file mode 100644 index 0000000000000..06573909d191e --- /dev/null +++ b/sdk/storage/Microsoft.Azure.WebJobs.Extensions.Storage.Blobs/samples/functionapp/README.md @@ -0,0 +1,6 @@ +# Sample Azure Function App for Azure Azure WebJobs Storage Blobs + +This sample Azure Function application shows usage of Azure Azure WebJobs Storage Blobs extension. +`SampleFunctions` contains a pair of functions that work with an Azure Storage Blobs +as well as sample configuration files `host.json` and `local.settings.json`. Settings present in `host.json` are optional and used values can be different than defaults. +Connection string present in `local.settings.json` points to [Azurite](https://github.com/Azure/Azurite), however any valid connection string will work. \ No newline at end of file diff --git a/sdk/storage/Microsoft.Azure.WebJobs.Extensions.Storage.Blobs/samples/functionapp/SampleFunctions.cs b/sdk/storage/Microsoft.Azure.WebJobs.Extensions.Storage.Blobs/samples/functionapp/SampleFunctions.cs new file mode 100644 index 0000000000000..4bbe99c7125d8 --- /dev/null +++ b/sdk/storage/Microsoft.Azure.WebJobs.Extensions.Storage.Blobs/samples/functionapp/SampleFunctions.cs @@ -0,0 +1,40 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +using System; +using Microsoft.Extensions.Logging; + +namespace Microsoft.Azure.WebJobs.Extensions.Storage.Blobs.Samples.Function.App +{ + /// + /// A pair of sample functions. First that updates a blob on schedule and second that listens to blob changes. + /// + public static class SampleFunctions + { + /// + /// This function executes on schedule, produces a new content and udpates the blob. + /// + [FunctionName("SampleBlobContentUpdater")] + [return: Blob("sample-container/sample-blob")] + public static string UpdateSampleBlobContent([TimerTrigger("*/30 * * * * *")] TimerInfo timerInfo, ILogger logger) + { + if (timerInfo.IsPastDue) + { + logger.LogInformation("Timer is running late!"); + } + var now = DateTime.Now; + logger.LogInformation($"C# Timer trigger function executed at: {now}"); + + return $"Sample blob content produced at: {now}"; + } + + /// + /// This functions is executed when blob is modified. + /// + [FunctionName("SampleBlobUpdateListener")] + public static void OnBlobUpdate([BlobTrigger("sample-container/sample-blob")] string content, ILogger logger) + { + logger.LogInformation("Blob has been updated, content: {content}", content); + } + } +} diff --git a/sdk/storage/Microsoft.Azure.WebJobs.Extensions.Storage.Blobs/samples/functionapp/host.json b/sdk/storage/Microsoft.Azure.WebJobs.Extensions.Storage.Blobs/samples/functionapp/host.json new file mode 100644 index 0000000000000..1d897c06e943b --- /dev/null +++ b/sdk/storage/Microsoft.Azure.WebJobs.Extensions.Storage.Blobs/samples/functionapp/host.json @@ -0,0 +1,16 @@ +{ + "version": "2.0", + "logging": { + "applicationInsights": { + "samplingExcludedTypes": "Request", + "samplingSettings": { + "isEnabled": true + } + } + }, + "extensions": { + "blobs": { + "maxDegreeOfParallelism": "5" + } + } +} \ No newline at end of file diff --git a/sdk/storage/Microsoft.Azure.WebJobs.Extensions.Storage.Blobs/samples/functionapp/local.settings.json b/sdk/storage/Microsoft.Azure.WebJobs.Extensions.Storage.Blobs/samples/functionapp/local.settings.json new file mode 100644 index 0000000000000..b818866fce362 --- /dev/null +++ b/sdk/storage/Microsoft.Azure.WebJobs.Extensions.Storage.Blobs/samples/functionapp/local.settings.json @@ -0,0 +1,7 @@ +{ + "IsEncrypted": false, + "Values": { + "AzureWebJobsStorage": "DefaultEndpointsProtocol=http;AccountName=devstoreaccount1;AccountKey=Eby8vdM02xNOcqFlqUwJPLlmEtlCDXJ1OUzFT50uSRZ6IFsuFq2UVErCz4I6tq/K1SZFPTOtr/KBHBeksoGMGw==;BlobEndpoint=http://127.0.0.1:10000/devstoreaccount1;QueueEndpoint=http://127.0.0.1:10001/devstoreaccount1;", + "FUNCTIONS_WORKER_RUNTIME": "dotnet" + } +} \ No newline at end of file diff --git a/sdk/storage/Microsoft.Azure.WebJobs.Extensions.Storage.Blobs/samples/BlobExtensionSamples.cs b/sdk/storage/Microsoft.Azure.WebJobs.Extensions.Storage.Blobs/samples/readmes/BlobExtensionSamples.cs similarity index 100% rename from sdk/storage/Microsoft.Azure.WebJobs.Extensions.Storage.Blobs/samples/BlobExtensionSamples.cs rename to sdk/storage/Microsoft.Azure.WebJobs.Extensions.Storage.Blobs/samples/readmes/BlobExtensionSamples.cs diff --git a/sdk/storage/Microsoft.Azure.WebJobs.Extensions.Storage.Blobs/samples/Microsoft.Azure.WebJobs.Extensions.Storage.Blobs.Samples.Tests.csproj b/sdk/storage/Microsoft.Azure.WebJobs.Extensions.Storage.Blobs/samples/readmes/Microsoft.Azure.WebJobs.Extensions.Storage.Blobs.Samples.Tests.csproj similarity index 100% rename from sdk/storage/Microsoft.Azure.WebJobs.Extensions.Storage.Blobs/samples/Microsoft.Azure.WebJobs.Extensions.Storage.Blobs.Samples.Tests.csproj rename to sdk/storage/Microsoft.Azure.WebJobs.Extensions.Storage.Blobs/samples/readmes/Microsoft.Azure.WebJobs.Extensions.Storage.Blobs.Samples.Tests.csproj diff --git a/sdk/storage/Microsoft.Azure.WebJobs.Extensions.Storage.sln b/sdk/storage/Microsoft.Azure.WebJobs.Extensions.Storage.sln index cab09ab7e147f..86d6aaa1dbaed 100644 --- a/sdk/storage/Microsoft.Azure.WebJobs.Extensions.Storage.sln +++ b/sdk/storage/Microsoft.Azure.WebJobs.Extensions.Storage.sln @@ -32,7 +32,7 @@ Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Microsoft.Azure.WebJobs.Ext EndProject Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Microsoft.Extensions.Azure", "..\extensions\Microsoft.Extensions.Azure\src\Microsoft.Extensions.Azure.csproj", "{CB002B93-3D25-42DD-B1A6-472C10B99BA7}" EndProject -Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Microsoft.Azure.WebJobs.Extensions.Storage.Blobs.Samples.Tests", "Microsoft.Azure.WebJobs.Extensions.Storage.Blobs\samples\Microsoft.Azure.WebJobs.Extensions.Storage.Blobs.Samples.Tests.csproj", "{77860E78-4770-4C48-8C2B-AF6B42A8D067}" +Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Microsoft.Azure.WebJobs.Extensions.Storage.Blobs.Samples.Tests", "Microsoft.Azure.WebJobs.Extensions.Storage.Blobs\samples\readmes\Microsoft.Azure.WebJobs.Extensions.Storage.Blobs.Samples.Tests.csproj", "{77860E78-4770-4C48-8C2B-AF6B42A8D067}" EndProject Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Microsoft.Azure.WebJobs.Extensions.Storage.Queues.Samples.Tests", "Microsoft.Azure.WebJobs.Extensions.Storage.Queues\samples\readmes\Microsoft.Azure.WebJobs.Extensions.Storage.Queues.Samples.Tests.csproj", "{A7A937E4-F4E1-47B7-8D25-AA5FB6BDE010}" EndProject @@ -40,6 +40,8 @@ Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Microsoft.Azure.WebJobs.Ext EndProject Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Microsoft.Azure.WebJobs.Extensions.Storage.Queues.Samples.Function.App", "Microsoft.Azure.WebJobs.Extensions.Storage.Queues\samples\functionapp\Microsoft.Azure.WebJobs.Extensions.Storage.Queues.Samples.Function.App.csproj", "{342E84D9-3073-4536-A895-0F843782BA97}" EndProject +Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Microsoft.Azure.WebJobs.Extensions.Storage.Blobs.Samples.Function.App", "Microsoft.Azure.WebJobs.Extensions.Storage.Blobs\samples\functionapp\Microsoft.Azure.WebJobs.Extensions.Storage.Blobs.Samples.Function.App.csproj", "{22D974DB-0B34-48F5-90EC-F65F9902E7D3}" +EndProject Global GlobalSection(SolutionConfigurationPlatforms) = preSolution Debug|Any CPU = Debug|Any CPU @@ -110,6 +112,10 @@ Global {342E84D9-3073-4536-A895-0F843782BA97}.Debug|Any CPU.Build.0 = Debug|Any CPU {342E84D9-3073-4536-A895-0F843782BA97}.Release|Any CPU.ActiveCfg = Release|Any CPU {342E84D9-3073-4536-A895-0F843782BA97}.Release|Any CPU.Build.0 = Release|Any CPU + {22D974DB-0B34-48F5-90EC-F65F9902E7D3}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {22D974DB-0B34-48F5-90EC-F65F9902E7D3}.Debug|Any CPU.Build.0 = Debug|Any CPU + {22D974DB-0B34-48F5-90EC-F65F9902E7D3}.Release|Any CPU.ActiveCfg = Release|Any CPU + {22D974DB-0B34-48F5-90EC-F65F9902E7D3}.Release|Any CPU.Build.0 = Release|Any CPU EndGlobalSection GlobalSection(SolutionProperties) = preSolution HideSolutionNode = FALSE From 1ec6044345fddf5ba118134aeefb87d86be81cd3 Mon Sep 17 00:00:00 2001 From: Kamil Sobol Date: Tue, 2 Feb 2021 14:17:44 -0800 Subject: [PATCH 6/8] fix build. --- ...zure.WebJobs.Extensions.Storage.Blobs.Samples.Tests.csproj | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/sdk/storage/Microsoft.Azure.WebJobs.Extensions.Storage.Blobs/samples/readmes/Microsoft.Azure.WebJobs.Extensions.Storage.Blobs.Samples.Tests.csproj b/sdk/storage/Microsoft.Azure.WebJobs.Extensions.Storage.Blobs/samples/readmes/Microsoft.Azure.WebJobs.Extensions.Storage.Blobs.Samples.Tests.csproj index a32e1d8abd6ac..aa37cf960406f 100644 --- a/sdk/storage/Microsoft.Azure.WebJobs.Extensions.Storage.Blobs/samples/readmes/Microsoft.Azure.WebJobs.Extensions.Storage.Blobs.Samples.Tests.csproj +++ b/sdk/storage/Microsoft.Azure.WebJobs.Extensions.Storage.Blobs/samples/readmes/Microsoft.Azure.WebJobs.Extensions.Storage.Blobs.Samples.Tests.csproj @@ -8,7 +8,7 @@ - - + + From 85823fde0f51719609a356376188f4b1c03df533 Mon Sep 17 00:00:00 2001 From: Kamil Sobol Date: Tue, 2 Feb 2021 14:35:03 -0800 Subject: [PATCH 7/8] fix build. --- .../samples/Directory.Build.props | 15 +++++++++++++++ .../samples/Directory.Build.props | 15 +++++++++++++++ 2 files changed, 30 insertions(+) create mode 100644 sdk/storage/Microsoft.Azure.WebJobs.Extensions.Storage.Blobs/samples/Directory.Build.props create mode 100644 sdk/storage/Microsoft.Azure.WebJobs.Extensions.Storage.Queues/samples/Directory.Build.props diff --git a/sdk/storage/Microsoft.Azure.WebJobs.Extensions.Storage.Blobs/samples/Directory.Build.props b/sdk/storage/Microsoft.Azure.WebJobs.Extensions.Storage.Blobs/samples/Directory.Build.props new file mode 100644 index 0000000000000..0c5e5c56b11e2 --- /dev/null +++ b/sdk/storage/Microsoft.Azure.WebJobs.Extensions.Storage.Blobs/samples/Directory.Build.props @@ -0,0 +1,15 @@ + + + + true + false + true + false + + + + + + false + + \ No newline at end of file diff --git a/sdk/storage/Microsoft.Azure.WebJobs.Extensions.Storage.Queues/samples/Directory.Build.props b/sdk/storage/Microsoft.Azure.WebJobs.Extensions.Storage.Queues/samples/Directory.Build.props new file mode 100644 index 0000000000000..0c5e5c56b11e2 --- /dev/null +++ b/sdk/storage/Microsoft.Azure.WebJobs.Extensions.Storage.Queues/samples/Directory.Build.props @@ -0,0 +1,15 @@ + + + + true + false + true + false + + + + + + false + + \ No newline at end of file From 6647dc02a0f5cb109f061d456999595d141775ec Mon Sep 17 00:00:00 2001 From: Kamil Sobol Date: Tue, 2 Feb 2021 15:07:08 -0800 Subject: [PATCH 8/8] does this fix the build ? --- .../samples/Directory.Build.props | 2 +- .../samples/Directory.Build.props | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/sdk/storage/Microsoft.Azure.WebJobs.Extensions.Storage.Blobs/samples/Directory.Build.props b/sdk/storage/Microsoft.Azure.WebJobs.Extensions.Storage.Blobs/samples/Directory.Build.props index 0c5e5c56b11e2..7c94cde1f3a29 100644 --- a/sdk/storage/Microsoft.Azure.WebJobs.Extensions.Storage.Blobs/samples/Directory.Build.props +++ b/sdk/storage/Microsoft.Azure.WebJobs.Extensions.Storage.Blobs/samples/Directory.Build.props @@ -1,7 +1,7 @@ - true + true false true false diff --git a/sdk/storage/Microsoft.Azure.WebJobs.Extensions.Storage.Queues/samples/Directory.Build.props b/sdk/storage/Microsoft.Azure.WebJobs.Extensions.Storage.Queues/samples/Directory.Build.props index 0c5e5c56b11e2..7c94cde1f3a29 100644 --- a/sdk/storage/Microsoft.Azure.WebJobs.Extensions.Storage.Queues/samples/Directory.Build.props +++ b/sdk/storage/Microsoft.Azure.WebJobs.Extensions.Storage.Queues/samples/Directory.Build.props @@ -1,7 +1,7 @@ - true + true false true false