Azure / azure-cli

Azure Command-Line Interface
MIT License
3.97k stars 2.95k forks source link

Add new page id and token to bot service Facebook channel #7564

Open josephktcheung opened 5 years ago

josephktcheung commented 5 years ago

Is your feature request related to a problem? Please describe. I don't know how to add new Facebook page id and token to an existing bot channel registration.

Describe the solution you'd like A clear and concise description of what you want to happen. From azure cli, it should describe how to update Facebook channel with new page id and token, currently it only has az bot facebook create which creates a new channel.

Describe alternatives you've considered A clear and concise description of any alternative solutions or features you've considered.

Additional context Add any other context or screenshots about the feature request here. Base on https://github.com/Microsoft/BotBuilder/issues/1495#issuecomment-408584611, we can have multiple pages connected to a bot channel registration but it's unclear how to do it using the cli

carlosscastro commented 5 years ago

Hello @josephktcheung we only support a single page in the CLI. The bot framework supports multiple but the CLI supports only one for now.

If you want to replace it, you can just delete and create again with your new page.

We are planning to support multiple facebook pages for an upcoming release, but at this point we can't tell how soon what will be. I'll update when we have a concrete date!

carlosscastro commented 5 years ago

In the meantime, you could call the ARM API that does support multiple facebook endpoints. Basically calling PUT channel, and passing a FacebookChannelProperties with multiple pages, see here for the swagger:

https://github.com/Azure/azure-rest-api-specs/blob/master/specification/botservice/resource-manager/Microsoft.BotService/preview/2018-07-12/botservice.json#L1553

EugeneFoo commented 5 years ago

Hi @carlosscastro

Can I know how's the exactly url/params for this? the response I get seem didn't update at all.

my PUT url: https://management.azure.com/subscriptions/{sub-id}/resourceGroups/{res-group}/providers/Microsoft.BotService/botServices/{bot-name}/channels/FacebookChannel?api-version=2018-07-12

Body JSON:

{
    "properties": {
        "properties": {
            "verifyToken": "",
            "pages": [
                {
                    "id": "{my-fb-page-id}",
                    "accessToken": "{my-fb-page-token}"
                },
                  {
                    "id": "{my-fb-page-id2}",
                    "accessToken": "{my-fb-page-token2}"
                }
            ],
            "appId": "{my-app-id}",
            "appSecret": "{my-app-secret}",
            "callbackUrl": "",
            "isEnabled": true
        }
    }
}

*Update: tested for whole day in Postman however I keep receiving error 400/500 without success. Can please provide a sample url + request body for this? Thanks!

stevengum commented 5 years ago

Let's investigate this for the 4.4 release.

HellDevil commented 5 years ago

Any news regarding this issue ?

PuTaTus commented 2 years ago

Nope, I tried to contact microsoft regarding this issue. They told me that the feature is yet to be added.