Azure Function From Queue to Blob or CosmosDB

From Azure Queue to Azure Storage Blob Container From Azure Queue to Azure NoSQL CosmosDB Container Sources: https://docs.microsoft.com/en-us/azure/azure-functions/functions-add-output-binding-cosmos-db-vs-code?pivots=programming-language-csharp

CosmosDB Trigger Azure Function

Get specified field value… Note: Make sure you installed the Microsoft.Azure.WebJobs.Extensions.CosmosDB package. Created a CosmosDB connection string (Get string value from Azure Portal). Created a container called “leases” or set CreateLeaseCollectionIfNotExists =true.

Set Azure Function Time Zone for Timer Trigger

Azure Function based on Web app sandbox. Web app need you to set the timezone in env settings first. The timetrigger attribute is the declaration part of the function. The environment variables will be checked here. If you do not set the environment variables about the time zone in advance, it will be processed according... » read more

Error: input is not a valid Base-64 string

Error: Get the following error when trying to process a json object within Azure Function. System.Private.CoreLib: Exception while executing function: xxxxxxxx. Microsoft.Azure.WebJobs.Host: Exception binding parameter 'myQueueItem'. System.Private.CoreLib: The input is not a valid Base-64 string as it contains a non-base 64 character, more than two padding characters, or an illegal character among the padding characters.... » read more

Azure Function Queue Trigger Retry

Azure functions with Storage Queue trigger has a built in retry logic based on the dequeue count of the message in the queue. You can configure the frequency of the retry in the bindings either through code or host.json. After the max number of retry, the message will be placed in the <queue-name>-poison queue. visibilityTimeout┬áproperty... » read more

Handling CORS Policy In Azure Functions

Option 1: In Azure Portal Cross-Origin Resource Sharing (CORS) allows JavaScript code running in a browser on an external host to interact with your backend. Specify the origins that should be allowed to make cross-origin calls (for example: http://example.com:12345). To allow all, use “*” and remove all other origins from the list. Slashes are not... » read more

Azure Function Get Environment Variable using local.settings.json

To get an environment variable or an app setting value, use System.Environment.GetEnvironmentVariable, as shown in the following code example: local.settings.json Note: Microsoft recommends this method because it works both locally with local.settings.json and in Azure. App settings can be read from environment variables both when developing locally and when running in Azure. When developing locally,... » read more