BotFramework-Composer icon indicating copy to clipboard operation
BotFramework-Composer copied to clipboard

Entering hyphen as second character in resource name causes provisioning to fail.

Open BruceHaley opened this issue 3 years ago • 0 comments

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:

  1. Open Composer.
  2. Create a bot using the Core Assistant Bot template. (Any template requiring QnA maker should work.)
  3. In Publish your bots/Publishing profile, pick Add new.
  4. Enter profile name and select target, hit Next. "Create a publish profile" dialog is displayed.
  5. Pick "Create new resources", hit Next.
  6. Pick a subscription. For Resource group, enter a new resource group name.
  7. For App Service Operating System, pick Windows.
  8. For Resource details, enter "v-brucehaley-CoreAssistant1", or any name with a hyphen as the second character.
  9. Pick Region and LUIS Region, hit Next. The "Add resources" dialog is displayed. Notice QnA Maker is checked as a required resource.
  10. Uncheck the optional resources. Hit Next. The "Review resources to be created" dialog is displayed.
  11. 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

BruceHaley avatar May 23 '22 21:05 BruceHaley