Entering hyphen as second character in resource name causes provisioning to fail.
Problem: Creating a new publishing profile, choosing a resource name having a hyphen as the second character, as in "v-brucehaley-CoreAssistant1", causes provisioning to fail for the QnA search service.
Repro:
- Open Composer.
- Create a bot using the Core Assistant Bot template. (Any template requiring QnA maker should work.)
- In Publish your bots/Publishing profile, pick Add new.
- Enter profile name and select target, hit Next. "Create a publish profile" dialog is displayed.
- Pick "Create new resources", hit Next.
- Pick a subscription. For Resource group, enter a new resource group name.
- For App Service Operating System, pick Windows.
- For Resource details, enter "v-brucehaley-CoreAssistant1", or any name with a hyphen as the second character.
- Pick Region and LUIS Region, hit Next. The "Add resources" dialog is displayed. Notice QnA Maker is checked as a required resource.
- Uncheck the optional resources. Hit Next. The "Review resources to be created" dialog is displayed.
- Notice the auto-generated name for Microsoft QnA Maker is "v-brucehaley-CoreAssistant1-qna". This name is going to cause provisioning to fail. Hit Create.
"Provisioning..." is displayed, then the error:
"Provision partially completed Provisioning completed 5 items before encountering a problem. {"name":"CREATE_QNA_ERROR","message":"Error - Service name 'v-brucehaley-coreassistant1-qna-search' is invalid: Service name must not have '-' as its second character.","stack":"Error\n at new CustomizeError (C:\Program Files\Bot Framework Composer\resources\app.asar.unpacked\extensions\azurePublish\dist\extension.js:276830:25)\n at createCustomizeError (C:\Program Files\Bot Framework Composer\resources\app.asar.unpacked\extensions\azurePublish\dist\extension.js:276835:10)\n at AzureResourceMananger.deployQnAReource (C:\Program Files\Bot Framework Composer\resources\app.asar.unpacked\extensions\azurePublish\dist\extension.js:277843:13)"}. See provision.CoreAssistant1.log in your bot folder"
Expected behavior: I would expect the routine that generates the QnA Maker resource name to remove the offending hyphen from the second character position so provisioning can succeed, as in: "vbrucehaley-CoreAssistant1-qna". (The name generator for Azure Blob Storage strips out hyphens. Why not this routine?)
Actual behavior: The routine that generates the QnA Maker resource name leaves in the offending hyphen, as in: "v-brucehaley-CoreAssistant1-qna", causing resource provisioning to fail.
Suggested fix: Have the routine that appends "-qna" to the name also remove the second character if it is a hyphen.
Composer version = 2.1.2.
Log file is attached. provision.CoreAssistant1.log