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

az cognitiveservices account create --kind QnAMaker NOT WORKING #6888

Closed
stephanbisser opened this issue Jul 25, 2018 · 10 comments
Closed

az cognitiveservices account create --kind QnAMaker NOT WORKING #6888

stephanbisser opened this issue Jul 25, 2018 · 10 comments
Labels
Cognitive Services az cognitiveservices Service Attention This issue is responsible by Azure service team.

Comments

@stephanbisser
Copy link

I tried to create a new QnAMaker service via the CLI like you can do it for other Cognitive Services with the following command:

az cognitiveservices account create -n Cloudguy_CLI_QnAMaker -g Cloudguy_CLI_Bot --kind QnAMaker --sku F0 -l westus --yes

I get the following error output:

(ApiPropertiesInvalid) The given 'apiProperties' '{}' is invalid. Validation errors: Required properties are missing from object: qnaRuntimeEndpoint. Path ''.
Traceback (most recent call last):
  File "C:\Program Files (x86)\Microsoft SDKs\Azure\CLI2\Lib\site-packages\knack\cli.py", line 197, in invoke
    cmd_result = self.invocation.execute(args)
  File "C:\Users\trdai\AppData\Local\Temp\pip-install-17ev678d\azure-cli-core\azure\cli\core\commands\__init__.py", line 369, in execute
  File "C:\Program Files (x86)\Microsoft SDKs\Azure\CLI2\Lib\site-packages\six.py", line 693, in reraise
    raise value
  File "C:\Users\trdai\AppData\Local\Temp\pip-install-17ev678d\azure-cli-core\azure\cli\core\commands\__init__.py", line 343, in execute
  File "C:\Users\trdai\AppData\Local\Temp\pip-install-17ev678d\azure-cli-core\azure\cli\core\commands\__init__.py", line 182, in __call__
  File "C:\Users\trdai\AppData\Local\Temp\pip-install-17ev678d\azure-cli-core\azure\cli\core\__init__.py", line 436, in default_command_handler
  File "C:\Users\trdai\AppData\Local\Temp\pip-install-17ev678d\azure-cli-cognitiveservices\azure\cli\command_modules\cognitiveservices\custom.py", line 48, in create
  File "C:\Users\trdai\AppData\Local\Temp\pip-install-17ev678d\azure-mgmt-cognitiveservices\azure\mgmt\cognitiveservices\operations\cognitive_services_accounts_operations.py", line 95, in create
azure.mgmt.cognitiveservices.models.error.ErrorException: (ApiPropertiesInvalid) The given 'apiProperties' '{}' is invalid. Validation errors: Required properties are missing from object: qnaRuntimeEndpoint. Path ''.

The strange thing is that the exact same command executes perfectly fine if I change QnAMaker to LUIS and the LUIS service will deployed just fine.
Any ideas?

@yugangw-msft yugangw-msft added the Cognitive Services az cognitiveservices label Jul 25, 2018
@pchoudhari
Copy link

Hi,

The QnAMaker resource creation is a bit different from other cognitive services, as there are other dependent resources that get deployed as well.

We will investigate how to enable a CLI for QnAMaker creation

@stephanbisser
Copy link
Author

Ok, it would be really nice to get this working in order to have the CLI for all Cognitive Services available...

@tjprescott
Copy link
Member

#7034 has been merged and should unblock you. It will be released 8/28.

@stephanbisser
Copy link
Author

Great thank you!
Looking forward to testing it...

@stephanbisser
Copy link
Author

sorry but am I missing something? I now get this error:

az: error: unrecognized arguments: --api-properties qnaRuntimeEndpoint=https://cloudguy-cli-bot.azurewebsites.net

when I try to run this command:

**az cognitiveservices account create -n Cloudguy_CLI_QnAMaker -g Cloudguy_CLI_Bot --kind QnAMaker --sku F0 -l westus --api-properties 'qnaRuntimeEndpoint=https://cloudguy-cli-bot.azurewebsites.net' --yes**

image

@tjprescott
Copy link
Member

Did you update your CLI? az --version

@stephanbisser
Copy link
Author

Sorry, I had version 2.0.44 not 2.0.45 installed - now it worked. Thanks

@yangyuan
Copy link
Member

yangyuan commented Sep 1, 2018

Just in case you might encounter other configuration issues.
Here is a full working example:

# Create resource group.
az group create --name devexp-qnamaker --location westus

# Create Search instance and get admin key.
# in this example, the key is "B044183F2450193E26751DC20423DFE4"
az search service create -g devexp-qnamaker -n devexp-qnamaker-search --sku standard
az search admin-key show -g devexp-qnamaker --service-name devexp-qnamaker-search

# Create App Service plan and Web App
# in this example, Web App endpoint will be https://devexp-qnamaker-webapp.azurewebsites.net
az appservice plan create -g devexp-qnamaker -n devexp-qnamaker-webapp-plan --sku S1
az webapp create -g devexp-qnamaker -n devexp-qnamaker-webapp --plan devexp-qnamaker-webapp-plan

# Configure Web App
az webapp config appsettings set -g devexp-qnamaker -n devexp-qnamaker-webapp --settings \
    AzureSearchName=devexp-qnamaker-search \
    AzureSearchAdminKey=B044183F2450193E26751DC20423DFE4 \
    PrimaryEndpointKey=devexp-qnamaker-webapp-PrimaryEndpointKey \
    SecondaryEndpointKey=devexp-qnamaker-webapp-SecondaryEndpointKey \
    DefaultAnswer="No good match found in KB." \
    QNAMAKER_EXTENSION_VERSION="latest"
az webapp cors add -g devexp-qnamaker -n devexp-qnamaker-webapp -a "*"

# Create QnAMaker account
az cognitiveservices account create -g devexp-qnamaker -n devexp-qnamaker-account --kind QnAMaker --sku S0 --location westus --api-properties qnaRuntimeEndpoint=https://devexp-qnamaker-webapp.azurewebsites.net

@Kabylone
Copy link

Thanks a lot !
It works for me , with azure cli version : 2.32.0

@Kabylone
Copy link

..but i changed this with adding quotes and --yes : 'qnaRuntimeEndpoint=https://devexp-qnamaker-webapp.azurewebsites.net' --yes

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Cognitive Services az cognitiveservices Service Attention This issue is responsible by Azure service team.
Projects
None yet
Development

No branches or pull requests

8 participants