microsoft / BotFramework-Services

Microsoft Bot Framework Services
Creative Commons Attribution 4.0 International
38 stars 11 forks source link

Bot created in Composer doesn't show 'Open In Composer' in Azure #313

Closed xieofxie closed 2 years ago

xieofxie commented 3 years ago

Describe the bug

image

should be:

image

Version

Browser

OS

To Reproduce

Steps to reproduce the behavior:

  1. Go to '...'
  2. Click on '....'
  3. Scroll down to '....'
  4. See error

Expected behavior

Screenshots

Additional context

srinaath commented 3 years ago

@hailiu2586 @Andrea-Orimoto Is this a known limitation?

hailiu2586 commented 3 years ago

@srinaath, depends on which azure cloud is the repro reported. Btw, I don't see repro instruction that is actionable in the issue report

hailiu2586 commented 3 years ago

Btw, if the bot is created from composer originally, then the issue goes to composer team to investigate. Also, it might be worthwhile to check the version of composer used to create the bot

srinaath commented 3 years ago

@hailiu2586 Yep. That makes sense. @xieofxie could you specify the Composer version in which the bot was generated and published. In addition, could you specify the Composer version with which you published the bot as well the region used to publish? Screen Shot 2021-07-28 at 2 38 48 PM

luhan2017 commented 3 years ago

@hailiu2586 and @srinaath , I have investigated and found that composer provisioned Azure bot don't have this property: " openWithHint: 'bfcomposer://", But in composer code, we did have this code piece, so I doubt this could be an issue of azure sdk? even I updated https://www.npmjs.com/package/@azure/arm-botservice version to the latest 3.0.0, the azurebot is still not provisioned with the correct value. We may need to update the BotProperties in the arm-botservice.

image

hailiu2586 commented 3 years ago

@luhan2017 below is the arm payload the azure portal used to create azurebot

        {
            "type": "Microsoft.BotService/botServices",
            "name": "[parameters('botId')]",
            "kind": "azurebot",
            "apiVersion": "2018-07-12",
            "location": "global",
            "sku": {
                "name": "[parameters('sku')]"
            },
            "tags": "[variables('botTags')]",
            "dependsOn": [],
            "properties": {
                "displayName": "[variables('botDisplayName')]",
                "msaAppId": "[parameters('msAppId')]",
                "openWithHint": "bfcomposer://",
                ...
            }
        }

Is the composer code using client js sdk or direct arm put to provision azure bot?

hailiu2586 commented 3 years ago

@cwhitten @luhan2017 do we know whether composer created bot has "openWithHint" set for "azurebot"? Could you provide a point to the composer code where the property is being set before the request is sent? thanks

hailiu2586 commented 3 years ago

@swagatmishra2007 do you know why JS SDK uses https://github.com/Azure/azure-sdk-for-js/blob/33602ffe73abe54cf4c4e232ee60057d0ab3395e/sdk/botservice/arm-botservice/src/models/mappers.ts#L106 to only allow known property names?

hailiu2586 commented 3 years ago

I have created PR https://github.com/Azure/azure-rest-api-specs/pull/15456/files add the properties to the swagger spec. Once that is published, and when the new JS SDK gets AutoRest generated. The composer can take on the new JS SDK to get the property set. If the composer wants to make the scenario work without waiting, it can issue direct ARM REST PUT on the bot to patch the properties.

luhan2017 commented 3 years ago

https://github.com/microsoft/BotFramework-Composer/search?q=openWithHint&type=code here is the composer code for openWithHint.

dudeed commented 3 years ago

Hai's PR needs to get reviewed and checked in for this to be fixed.

MichaelHaydenAtMicrosoft commented 2 years ago

@hailiu2586 @luhan2017 @Jeffders - any updates to share on the PR, SDK, timelines, or anything else here?

luhan2017 commented 2 years ago

Hai's PR just got merged, and I submitted api release request. I will update the package version in composer when the release is done. @MichaelHaydenAtMicrosoft

luhan2017 commented 2 years ago

Update, the new sdk package is updated, @zhixzhan will help verify it in composer.

https://github.com/Azure/sdk-release-request/issues/2089

luhan2017 commented 2 years ago

The package is already released, @zhixzhan, could you help create a PR in composer to update to the new version? https://www.npmjs.com/package/@azure/arm-botservice/v/3.1.0