Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update README and Code to explain the Environment Variable setup #243

Closed
thinkingserious opened this issue Jun 17, 2016 · 8 comments
Closed
Labels
difficulty: easy fix is easy in difficulty status: help wanted requesting help from the community type: community enhancement feature request not on Twilio's roadmap

Comments

@thinkingserious
Copy link
Contributor

thinkingserious commented Jun 17, 2016

Issue Summary

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

Technical details:

  • sendgrid-csharp Version: 7.0.2
  • .NET Version: 4.5.2
@thinkingserious thinkingserious added type: community enhancement feature request not on Twilio's roadmap status: help wanted requesting help from the community labels Jun 17, 2016
@J242
Copy link

J242 commented Jun 20, 2016

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.

@thinkingserious
Copy link
Contributor Author

Hello @J242,

You will want to setup your environment variables in Azure. Here is some help on how to do that:

https://blogs.msdn.microsoft.com/stuartleeks/2015/08/10/azure-api-apps-configuration-with-environment-variables

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!

@aaron-horst
Copy link

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.

@andredublin
Copy link

@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

@J242
Copy link

J242 commented Jun 23, 2016

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?

@andredublin
Copy link

@J242 Yes, so long as your able to retrieve the string it can be stored anywhere really.

@J242
Copy link

J242 commented Jun 23, 2016

Cool! I'll probably try both methods. I'll use web.config locally and environment on Azure.

@thinkingserious
Copy link
Contributor Author

Please see #473 (comment)

gabrielkrell pushed a commit to gabrielkrell/sendgrid-csharp that referenced this issue Aug 2, 2017
gabrielkrell pushed a commit to gabrielkrell/sendgrid-csharp that referenced this issue Aug 2, 2017
@thinkingserious thinkingserious added the difficulty: easy fix is easy in difficulty label Sep 30, 2017
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
difficulty: easy fix is easy in difficulty status: help wanted requesting help from the community type: community enhancement feature request not on Twilio's roadmap
Projects
None yet
Development

No branches or pull requests

5 participants