Skip to content

Commit

Permalink
Update Program.cs
Browse files Browse the repository at this point in the history
Updated to use environment variables to store subscription key and endpoints per standard practice.
  • Loading branch information
v-jaswel committed Dec 11, 2020
1 parent 123bd61 commit 40412b4
Showing 1 changed file with 28 additions and 30 deletions.
58 changes: 28 additions & 30 deletions dotnet/QnAMaker/SDK-based-quickstart/Program.cs
Original file line number Diff line number Diff line change
@@ -1,28 +1,28 @@
/*
* ==========================================
Install QnA Maker package with command
* ==========================================
*
* dotnet add package Microsoft.Azure.CognitiveServices.Knowledge.QnAMaker --version 2.0.1
*
* ==========================================
Tasks Included
* ==========================================
* Create a knowledgebase
* Update a knowledgebase
* Publish a knowledgebase, waiting for publishing to complete
* Get Query runtime endpoint key
* Download a knowledgebase
* Get answer
* Delete a knowledgebase
* ==========================================
Further reading
* General documentation: https://docs.microsoft.com/azure/cognitive-services/QnAMaker
* Reference documentation: https://docs.microsoft.com/en-in/dotnet/api/microsoft.azure.cognitiveservices.knowledge.qnamaker?view=azure-dotnet
* ==========================================
*/
/*
* ==========================================
Install QnA Maker package with command
* ==========================================
*
* dotnet add package Microsoft.Azure.CognitiveServices.Knowledge.QnAMaker --version 2.0.1
*
* ==========================================
Tasks Included
* ==========================================
* Create a knowledgebase
* Update a knowledgebase
* Publish a knowledgebase, waiting for publishing to complete
* Get Query runtime endpoint key
* Download a knowledgebase
* Get answer
* Delete a knowledgebase
* ==========================================
Further reading
* General documentation: https://docs.microsoft.com/azure/cognitive-services/QnAMaker
* Reference documentation: https://docs.microsoft.com/en-in/dotnet/api/microsoft.azure.cognitiveservices.knowledge.qnamaker?view=azure-dotnet
* ==========================================
*/
namespace Knowledgebase_Quickstart
{
// <Dependencies>
Expand All @@ -40,11 +40,9 @@ class Program
static void Main(string[] args)
{
// <Resourcevariables>
var authoringKey = "REPLACE-WITH-YOUR-QNA-MAKER-KEY";
var resourceName = "REPLACE-WITH-YOUR-RESOURCE-NAME";

var authoringURL = $"https://{resourceName}.cognitiveservices.azure.com";
var queryingURL = $"https://{resourceName}.azurewebsites.net";
var authoringKey = Environment.GetEnvironmentVariable("QNA_MAKER_SUBSCRIPTION_KEY");
var authoringURL = Environment.GetEnvironmentVariable("QNA_MAKER_ENDPOINT");
var queryingURL = Environment.GetEnvironmentVariable("QNA_MAKER_RUNTIME_ENDPOINT");
// </Resourcevariables>


Expand Down

0 comments on commit 40412b4

Please sign in to comment.