This explanation should be in the README and as a comment in the example code:
https://github.com/sendgrid/sendgrid-csharp/blob/master/CONTRIBUTING.md#environment-variables
Also, show an example of retrieving the API Key from web.config
Hello, can you show us how to set up the send grid key? See support question below:
kosullivan Wednesday at 13:19
Hello, I'm setting up SendGrid with C# in Visual Studio Express 2013 for Web with the Quickstart located at https://github.com/sendgrid/sendgrid-csharp and testing on my local machine. Once I get it working, I will deploy to Azure. I have set up an account, set up a key, and installed SendGrid and its dependencies from the NuGet package manager, and set up a web page that runs the Quick Start's code. In the Installation>Setup Environment Variables section it reads, "Next, update your Environment (user space) with your SENDGRID_API_KEY." Where (what file) and how is this done? Where in my project do I store the key?
Avatar
Ryan R. Friday at 14:00
Hi there,
Please feel free to contribute to this Github issue in order to get an answer from our developers.
Best,
Ryan R.
Hello @J242,
You will want to setup your environment variables in Azure. Here is some help on how to do that:
http://stackoverflow.com/questions/34608769/how-and-where-to-define-an-environment-variable-on-azure
Please let me know what resource was most helpful to you.
Thanks!
You are not required to use environment variables correct? The raw string can still be passed in if it lives as a setting in your app.
@aaron-horst that is correct, for example I store the api key in a cloud configuration file and reference it from there with the CloudConfigurationManager
Thanks for the info everyone!
Can I store the api key in my asp.net project's web.config so that I can test it on my local computer before deploying the tested solution to Azure?
@J242 Yes, so long as your able to retrieve the string it can be stored anywhere really.
Cool! I'll probably try both methods. I'll use web.config locally and environment on Azure.
Please see https://github.com/sendgrid/sendgrid-csharp/issues/473#issuecomment-308615551
Most helpful comment
@J242 Yes, so long as your able to retrieve the string it can be stored anywhere really.