0

My azure function not trigger after upload my file to corresponding storage account container, but this is working fine when I test my local with following settings.

I had to use local.setting.json like below

"Values": {
....
"AzureWebJobsStorage" : "UseDevelopmentStorage=true",
"AzureStorageMyUpload" : "<<My storage account access key, 
which is get copy from my container>>"
.....
}

I real time "AzureWebJobsStorage" value is another one storage account information

"AzureStorageMyUpload" : "DefaultEndpointsProtocol=https;AccountName=<<ACCOUNT_NAME>>;AccountKey=<<ACCOUNT_KEY>>;EndpointSuffix=core.windows.net"

and

"AzureStorageMyUpload" : "DefaultEndpointsProtocol=https;AccountName=<<ACCOUNT_NAME>>;AccountKey=<<ACCOUNT_KEY>>;BlobEndpoint=https://<<ACCOUNT_NAME>>.blob.core.windows.net/;TableEndpoint=https://<<ACCOUNT_NAME>>.table.core.windows.net/;QueueEndpoint=https://<<ACCOUNT_NAME>>.queue.core.windows.net/;FileEndpoint=https://<<ACCOUNT_NAME>>.file.core.windows.net/"

My azure function below

[FunctionName("UploadCSV")]
public static async Task Run([BlobTrigger("<<containerName>>/<<folderName>>/{name}.csv", 
Connection = "AzureStorageMyUpload")]
            Stream stream, string name, ILogger log){
              log.LogInformation("UploadCSV starts");
    }

Function

Runtime version: 1.0.12922.0 (~1)

When I was created new blob trigger from the azure portal itself, it is working fine for me. the same one is not working when I create from local with help of visual studio code 2019 in azure portal it's seems like "function.json".

Rajamohan Anguchamy
  • 1,726
  • 1
  • 17
  • 35
  • Did you set the `AzureStorageMyUpload` value in the app settings? – George Chen Jan 08 '20 at 06:58
  • yes I am added my storage account information, like DefaultEndpointsProtocol=https;AccountName=<>;AccountKey=<>;EndpointSuffix=core.windows.net – Rajamohan Anguchamy Jan 08 '20 at 07:01
  • and also i tried like "DefaultEndpointsProtocol=https;AccountName=<>;AccountKey=<>;BlobEndpoint=https://<>.blob.core.windows.net/;TableEndpoint=https://<>.table.core.windows.net/;QueueEndpoint=https://<>.queue.core.windows.net/;FileEndpoint=https://<>.file.core.windows.net/" – Rajamohan Anguchamy Jan 08 '20 at 07:10
  • Did you have `AzureWebJobsStorage` setting and do you have any error shown in the azure portal? – George Chen Jan 08 '20 at 07:22
  • I am use "AzureWebJobsStorage" : "UseDevelopmentStorage=true" only my testing purpose, not for real time. – Rajamohan Anguchamy Jan 08 '20 at 07:39
  • I real time "AzureWebJobsStorage" value is another one storage account information – Rajamohan Anguchamy Jan 08 '20 at 07:40
  • How are you hosting your Function; on a Consumption Plan, App Service Plan or Premium plan? If on an App Service plan, is Always On enabled? How long was your Function deployed before you uploaded a blob? How long did you wait for the trigger to kick off your Function? I have a LOT of questions :p You could look into using [Event Grid](https://azure.microsoft.com/en-us/services/event-grid/) if triggers don't do what you need them to do. – rickvdbosch Jan 08 '20 at 08:07
  • @rickvdbosch , with the help of azure CICD pipe. this is company account I don't know which plan is it, but when ever the release was completed it automatically updated. it takes 5 to 10 min along with all other service and UI. I try to upload a file through rest API and also tried using direct blob upload. – Rajamohan Anguchamy Jan 08 '20 at 08:47
  • thank you guys, your suggestion, thanks – Rajamohan Anguchamy Jan 09 '20 at 12:26
  • Again i got the same issue, can any one help me out. it's too headache to resolve. I though blob trigger is related to some configuration in storage account – Rajamohan Anguchamy Jan 20 '20 at 07:29
  • @RajamohanAnguchamy, is it a v1 or v2 function? and can you attach a screenshot of the Application settings of the function in azure portal? – Ivan Glasenberg Jan 20 '20 at 08:07
  • I am already added info Runtime version: 1.0.12922.0 (~1) – Rajamohan Anguchamy Jan 20 '20 at 08:45

1 Answers1

1

This is working now, I just removed connection string name and replay to

"AzureWebJobsStorage": "<<live storage account details>>"


[FunctionName("UploadCSV")]
public static async Task Run([BlobTrigger("<<containerName>>/<<folderName>>/{name}.csv", 
Connection = "AzureWebJobsStorage")]
            Stream stream, string name, ILogger log){
              log.LogInformation("UploadCSV starts");
    }
Rajamohan Anguchamy
  • 1,726
  • 1
  • 17
  • 35