question

Umair241097 avatar image
0 Votes"
Umair241097 asked Umair241097 commented

hi, i created a fresh azure function to send email using sendgrid and iim getting this errorl

hi, i created a fresh azure function to send email using sendgrid and iim getting this error
Used service bus trigger

110874-image.png

i took the sample from here https://github.com/MicrosoftDocs/azure-docs/blob/master/articles/azure-functions/functions-bindings-sendgrid.md#asynchronous


azure-functions
image.png (88.6 KiB)
5 |1600 characters needed characters left characters exceeded

Up to 10 attachments (including images) can be used with a maximum of 3.0 MiB each and 30.0 MiB total.

1 Answer

MayankBargali-MSFT avatar image
0 Votes"
MayankBargali-MSFT answered Umair241097 commented

Hi @Umair241097

As per the error it is unable to resolve the API key. If you have custom attribute ApiKey define then you should have name CustomSendGridKeyAppSettingName in your local configuration. If you haven't define anything then it takes the default name as AzureWebJobsSendGridApiKey as mentioned in configuration section.

[SendGrid(ApiKey = "CustomSendGridKeyAppSettingName")]

· 7
5 |1600 characters needed characters left characters exceeded

Up to 10 attachments (including images) can be used with a maximum of 3.0 MiB each and 30.0 MiB total.

110944-image.png



I get this error after this

0 Votes 0 ·
image.png (57.9 KiB)

@Umair241097 ·I believe you have already resolved this issue now. As per the error the from address does not match a verified Sender Identity at sendgrid end. The same document talks about host.json setting from parameter and the same should match at sendgrid end.

0 Votes 0 ·

110955-image.png




getting this warning why?

0 Votes 0 ·
image.png (19.3 KiB)

@Umair241097 This could be that your host.json file has some issue or some attribute missing. You can create a new sample project and compare with the existing project. Did you removed FunctionName attribute? I was able to reproduce the issue at my end if I removed the below from my function but there could be different reasons too.
FunctionName("MyFunction")]

110946-image.png

0 Votes 0 ·
image.png (14.2 KiB)

i have created the function app using .net 5 and when i run the function app i get the above error as you said if i create the function app as sseperate project it is working but what create functionapp inside my personal project it is throwing this error

0 Votes 0 ·
Show more comments