Azure / azure-rest-api-specs

The source for REST API specifications for Microsoft Azure.
MIT License
2.63k stars 5.08k forks source link

BotChannel.ListWithKeys API doesn't return extensionKey1 and extensionKey2 #15400

Open neil-yechenwei opened 3 years ago

neil-yechenwei commented 3 years ago

After tested, seems the directline channel on Azure Portal would use ListWithKeys rest api to retrieve and show extensionKey1 and extensionKey2. image

So I also tried to use ListWithKeys API in GO sdk client to retrieve extensionKey1 and extensionKey2 but seems they would be omitted by ListWithKeysResponder function. Actually, api response which is returned by service side includes extensionKey1 and extensionKey2 but they aren't in the properties section of API response after ListWithKeysSender function is executed. May I ask is it expected?

API response body returned by ListWithKeysSender function:

{
    "resource": {
        "properties": {
            "sites": [
                {
                    "siteId": "xxxxxxx",
                    "siteName": "UserCustomTestSite",
                    "key": "xxxxxxx",
                    "key2": "xxxxxx",
                    "isEnabled": true,
                    "isV1Enabled": true,
                    "isV3Enabled": true,
                    "isSecureSiteEnabled": false,
                    "isBlockUserUploadEnabled": false,
                    "trustedOrigins": []
                },
                {
                    "siteId": "xxxxx",
                    "siteName": "Default Site",
                    "key": "xxxxx",
                    "key2": "xxxxxx",
                    "isEnabled": true,
                    "isV1Enabled": true,
                    "isV3Enabled": true,
                    "isSecureSiteEnabled": false,
                    "isBlockUserUploadEnabled": false
                }
            ]
        },
        "etag": "W/\"xxxx/27/2021 11:23:47 PM\"",
        "channelName": "DirectLineChannel",
        "location": "global"
    },
    "setting": {
        "extensionKey1": "xxxxxx",
        "extensionKey2": "xxxxxx",
        "sites": [
            {
                "siteId": "xxxxxx",
                "siteName": "UserCustomTestSite",
                "key": "xxxxx",
                "key2": "xxxxx",
                "isEnabled": true,
                "isV1Enabled": true,
                "isV3Enabled": true,
                "isWebchatPreviewEnabled": false,
                "isSecureSiteEnabled": false,
                "isBlockUserUploadEnabled": false,
                "trustedOrigins": [],
                "eTag": "\"xxxx-0000-1800-0000-610093470000\""
            },
            {
                "siteId": "xxxxxx",
                "siteName": "Default Site",
                "key": "xxxxx",
                "key2": "xxxx",
                "isEnabled": true,
                "isV1Enabled": true,
                "isV3Enabled": true,
                "isWebchatPreviewEnabled": false,
                "isSecureSiteEnabled": false,
                "isBlockUserUploadEnabled": false,
                "eTag": "\"xxxx-0000-1800-0000-610093470000\""
            }
        ],
        "channelId": "directline",
        "channelDisplayName": "Direct Line",
        "botId": "xxxx",
        "botIconUrl": "https://docs.botframework.com/static/devportal/client/images/bot-framework-default.png",
        "isEnabled": true,
        "isIsolated": false
    },
    "id": "/subscriptions/xxxxx/resourceGroups/xxxx/providers/Microsoft.BotService/botServices/xxxx/channels/DirectLineChannel",
    "location": "global",
    "properties": {
        "properties": {
            "DirectLineEmbedCode": null,
            "sites": [
                {
                    "siteId": "xxxxxx",
                    "siteName": "UserCustomTestSite",
                    "key": "xxxxx",
                    "key2": "xxxxx",
                    "isEnabled": true,
                    "isV1Enabled": true,
                    "isV3Enabled": true,
                    "isSecureSiteEnabled": false,
                    "isBlockUserUploadEnabled": false,
                    "trustedOrigins": []
                },
                {
                    "siteId": "xxxx",
                    "siteName": "Default Site",
                    "key": "Xxxxx",
                    "key2": "xxxxx",
                    "isEnabled": true,
                    "isV1Enabled": true,
                    "isV3Enabled": true,
                    "isSecureSiteEnabled": false,
                    "isBlockUserUploadEnabled": false,
                    "trustedOrigins": null
                }
            ]
        },
        "etag": "W/\"xxx/27/2021 11:23:47 PM\"",
        "channelName": "DirectLineChannel",
        "location": "global"
    },
    "provisioningState": "Accepted",
    "entityTag": "W/\"xxx/27/2021 11:23:47 PM\"",
    "changedTime": "xxx-01-01T00:00:00Z"
}

extensionKey1 and extensionKey2 exist in api response when ListWithKeysSender function is executed: image

extensionKey1 and extensionKey2 don't exist in result when ListWithKeysResponder function is executed: image

ghost commented 3 years ago

Thanks for the feedback! We are routing this to the appropriate team for follow-up. cc @sgellock.

Issue Details
After tested, seems the directline channel on Azure Portal would use [ListWithKeys rest api](https://github.com/Azure/azure-rest-api-specs/blob/472ed65c628500835be420732be07728118d3563/specification/botservice/resource-manager/Microsoft.BotService/stable/2021-03-01/botservice.json#L559) to retrieve and show extensionKey1 and extensionKey2. ![image](https://user-images.githubusercontent.com/19754191/127247301-d2b711f1-05b4-4a2d-a927-4a4c385eed1e.png) So I also tried to use [ListWithKeys API](https://github.com/Azure/azure-sdk-for-go/blob/f9fe78145f1e7e761d15cd839de37b5eaf3e8b44/services/botservice/mgmt/2021-03-01/botservice/channels.go#L449) in GO sdk client to retrieve extensionKey1 and extensionKey2 but seems they would be omitted by [ListWithKeysResponder function](https://github.com/Azure/azure-sdk-for-go/blob/f9fe78145f1e7e761d15cd839de37b5eaf3e8b44/services/botservice/mgmt/2021-03-01/botservice/channels.go#L485). Actually, [api response](https://github.com/Azure/azure-sdk-for-go/blob/f9fe78145f1e7e761d15cd839de37b5eaf3e8b44/services/botservice/mgmt/2021-03-01/botservice/channels.go#L478) which is returned by service side includes extensionKey1 and extensionKey2 but they aren't in the properties section of API response after [ListWithKeysSender function](https://github.com/Azure/azure-sdk-for-go/blob/f9fe78145f1e7e761d15cd839de37b5eaf3e8b44/services/botservice/mgmt/2021-03-01/botservice/channels.go#L478) is executed. May I ask is it expected? API response body returned by ListWithKeysSender function: ``` { "resource": { "properties": { "sites": [ { "siteId": "xxxxxxx", "siteName": "UserCustomTestSite", "key": "xxxxxxx", "key2": "xxxxxx", "isEnabled": true, "isV1Enabled": true, "isV3Enabled": true, "isSecureSiteEnabled": false, "isBlockUserUploadEnabled": false, "trustedOrigins": [] }, { "siteId": "xxxxx", "siteName": "Default Site", "key": "xxxxx", "key2": "xxxxxx", "isEnabled": true, "isV1Enabled": true, "isV3Enabled": true, "isSecureSiteEnabled": false, "isBlockUserUploadEnabled": false } ] }, "etag": "W/\"xxxx/27/2021 11:23:47 PM\"", "channelName": "DirectLineChannel", "location": "global" }, "setting": { "extensionKey1": "xxxxxx", "extensionKey2": "xxxxxx", "sites": [ { "siteId": "xxxxxx", "siteName": "UserCustomTestSite", "key": "xxxxx", "key2": "xxxxx", "isEnabled": true, "isV1Enabled": true, "isV3Enabled": true, "isWebchatPreviewEnabled": false, "isSecureSiteEnabled": false, "isBlockUserUploadEnabled": false, "trustedOrigins": [], "eTag": "\"xxxx-0000-1800-0000-610093470000\"" }, { "siteId": "xxxxxx", "siteName": "Default Site", "key": "xxxxx", "key2": "xxxx", "isEnabled": true, "isV1Enabled": true, "isV3Enabled": true, "isWebchatPreviewEnabled": false, "isSecureSiteEnabled": false, "isBlockUserUploadEnabled": false, "eTag": "\"xxxx-0000-1800-0000-610093470000\"" } ], "channelId": "directline", "channelDisplayName": "Direct Line", "botId": "xxxx", "botIconUrl": "https://docs.botframework.com/static/devportal/client/images/bot-framework-default.png", "isEnabled": true, "isIsolated": false }, "id": "/subscriptions/xxxxx/resourceGroups/xxxx/providers/Microsoft.BotService/botServices/xxxx/channels/DirectLineChannel", "location": "global", "properties": { "properties": { "DirectLineEmbedCode": null, "sites": [ { "siteId": "xxxxxx", "siteName": "UserCustomTestSite", "key": "xxxxx", "key2": "xxxxx", "isEnabled": true, "isV1Enabled": true, "isV3Enabled": true, "isSecureSiteEnabled": false, "isBlockUserUploadEnabled": false, "trustedOrigins": [] }, { "siteId": "xxxx", "siteName": "Default Site", "key": "Xxxxx", "key2": "xxxxx", "isEnabled": true, "isV1Enabled": true, "isV3Enabled": true, "isSecureSiteEnabled": false, "isBlockUserUploadEnabled": false, "trustedOrigins": null } ] }, "etag": "W/\"xxx/27/2021 11:23:47 PM\"", "channelName": "DirectLineChannel", "location": "global" }, "provisioningState": "Accepted", "entityTag": "W/\"xxx/27/2021 11:23:47 PM\"", "changedTime": "xxx-01-01T00:00:00Z" } ``` extensionKey1 and extensionKey2 exist in api response when ListWithKeysSender function is executed: ![image](https://user-images.githubusercontent.com/19754191/127247927-039f8405-ceff-4c41-a4ad-d3a59e712f65.png) extensionKey1 and extensionKey2 don't exist in result when ListWithKeysResponder function is executed: ![image](https://user-images.githubusercontent.com/19754191/127248079-0faa49e9-49f9-4be1-8d3b-76b495684866.png)
Author: neil-yechenwei
Assignees: ruowan
Labels: `Bot Service`, `Service Attention`, `needs-triage`
Milestone: -