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

C# samples should be consistent in creating LuisApplication with either SubscriptionKey or AuthoringKey #1159

Closed
dmvtech opened this issue Jan 15, 2019 · 1 comment
Assignees
Labels
bug Indicates an unexpected problem or an unintended behavior. P1 Painful if we don't fix, won't block releasing

Comments

@dmvtech
Copy link
Collaborator

dmvtech commented Jan 15, 2019

Sample information

  1. Sample type: any that use LUIS services
  2. Sample language: C#
  3. Sample name: below

Describe the bug

Some C# samples use SubscriptionKey and some use AuthoringKey from the bot file or config. This can cause issues when using same bot file across different samples (ex: core BasicBot versus webapi BasicBot). Mostly a problem when the different keys are associated with different regions. It should be consistent in implementation across samples.

The following samples use subscription key:
var app = new LuisApplication(luis.AppId, luis.SubscriptionKey, luis.GetEndpoint());

csharp_webapi\12.NLP-With-LUIS\App_Start\BotConfig.cs:90:
csharp_webapi\13.basic-bot\App_Start\BotServices.cs:54:
csharp_dotnetcore\21.luis-with-appinsights\Startup.cs:189:
csharp_dotnetcore\51.cafe-bot\BotServices.cs:40:

The following samples use authoring key:
var app = new LuisApplication(luis.AppId, luis.AuthoringKey, luis.GetEndpoint());

csharp_dotnetcore\12.nlp-with-luis\BotServices.cs:39:
csharp_dotnetcore\13.basic-bot\BotServices.cs:39:
csharp_dotnetcore\14.nlp-with-dispatch\Startup.cs:189:

Additional context

I didn't find any need to be using AuthoringKey over SubscriptionKey in the samples. But if there is, then obviously that would be a valid reason to keep it.

JavaScript flavors seem to go have an approach of going for SubscriptionKey alone or AuthoringKey if null:

endpointKey: luisConfig.subscriptionKey
OR
endpointKey: luisConfig.subscriptionKey || luisConfig.authoringKey,

[bug]

@dmvtech
Copy link
Collaborator Author

dmvtech commented Jan 15, 2019

Mildly related: #1076

@sgellock sgellock self-assigned this Jan 23, 2019
@sgellock sgellock added bug Indicates an unexpected problem or an unintended behavior. Approved P1 Painful if we don't fix, won't block releasing labels Jan 23, 2019
@sgellock sgellock assigned dmvtech and unassigned sgellock Jan 23, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Indicates an unexpected problem or an unintended behavior. P1 Painful if we don't fix, won't block releasing
Projects
None yet
Development

No branches or pull requests

2 participants