azure-sdk-for-js: beginListActiveSessionsAndWait() does not return Sessions even though the api called by the sdk does return Sessions
- Package Name: @azure/arm-network
- Package Version: 30.2.0
- Operating system: Windows
- nodejs
- version: 16.15.0
- browser
- name/version: Chrome/112.0.5615.138
- typescript
- version: 4.9.5
- Is the bug related to documentation in
- README.md
- source code documentation
- SDK API docs on https://docs.microsoft.com
Describe the bug
When using “beginListActiveSessionsAndWait” of the networkclient as described in Microsoft Docs or azure-sdk-for-js sample file i do not get back any sessions as a result, even though in the networking tab the sessions do appear.
-> I have also tried it when more than one session was active at the bastion - still the function of the sdk returned an empty array
Also in the Azure portal the sessions are displayed:
To Reproduce Steps to reproduce the behavior:
- implement
returnsAListOfCurrentlyActiveSessionsOnTheBastion()
function as described in the docs - create a bastion
- create vm
- connect to vm via bastion
- run the implemented
returnsAListOfCurrentlyActiveSessionsOnTheBastion()
Expected behavior The SDK function should return the same result as the API returns
Screenshots
Additional context Add any other context about the problem here.
About this issue
- Original URL
- State: open
- Created a year ago
- Reactions: 2
- Comments: 23 (11 by maintainers)
@abhi7860 Will take a look into it thanks for the heads up.
However a library native approach is preferred for obvious reasons - so keep me posted on the status of the fix.
@MichaMican, The raw response is unicode encoded. And the response mey be not match with the response defined in swagger.That’s why we got unexpected value: [].
Hi @qiaozha i am a bit confused why this should be a backed issue? As shown in the screenshots the backend returns the correct values, and the azure portal frontend also can deal with it correctly - So I would be very suprised if this is not fixable within the SDK
@MichaMican , In swagger https://github.com/Azure/azure-rest-api-specs/blob/efd49b89cbc6b44f81056affc40cb7b96b520474/specification/network/resource-manager/Microsoft.Network/stable/2022-11-01/bastionHost.json#L874 the resonse should contains “value” and “nextlink” , and in “value”, it contains your expected behavior:https://github.com/Azure/azure-rest-api-specs/blob/efd49b89cbc6b44f81056affc40cb7b96b520474/specification/network/resource-manager/Microsoft.Network/stable/2022-11-01/bastionHost.json#L806
see the example response in swagger:https://github.com/Azure/azure-rest-api-specs/blob/efd49b89cbc6b44f81056affc40cb7b96b520474/specification/network/resource-manager/Microsoft.Network/stable/2022-11-01/examples/BastionSessionsList.json#L10
but actually, the response body doesn’t follow this chema which doesn’t have nextlink parameter, I think this bug is caused by this
I can reproduce the result of your issue and am looking for the cause
Thank you @MichaMican for such a nicely detailed issue description.