Describe the bug
To be honest, I'm not sure if this is a bug or intended change in behavior between the older ms-rest-azure and this newer package. As part of my application logic, I perform some checks around the subscriptions associated with the principal that authenticated. When using the ms-rest-azure, authentication and getting the list of associated subscriptions could be accomplished by using the loginWithServicePrincipalSecretWithAuthResponse function.
Since the ms-rest-azure package is on a path to deprecation, I upgraded my application to use this library instead which has the same function. However, in any authentication response the list of subscriptions returned is always empty. I checked the source code and there appears to be a difference in logic on whether the subscriptions property should be populated:
Package Version: 2.0.0
Describe the bug To be honest, I'm not sure if this is a bug or intended change in behavior between the older
ms-rest-azure
and this newer package. As part of my application logic, I perform some checks around the subscriptions associated with the principal that authenticated. When using thems-rest-azure
, authentication and getting the list of associated subscriptions could be accomplished by using theloginWithServicePrincipalSecretWithAuthResponse
function.Since the
ms-rest-azure
package is on a path to deprecation, I upgraded my application to use this library instead which has the same function. However, in any authentication response the list of subscriptions returned is always empty. I checked the source code and there appears to be a difference in logic on whether thesubscriptions
property should be populated:ms-rest-azure: https://github.com/Azure/azure-sdk-for-node/blob/8691046c2ca738552d815f6967f5f54b04840276/runtime/ms-rest-azure/lib/login.js#L440 ms-rest-nodeauth: https://github.com/Azure/ms-rest-nodeauth/blob/master/lib/login.ts#L165
To Reproduce I have a gist with a short script to reproduce this behavior: https://gist.github.com/dwalleck/4d049d3515e82bb4b687fe95a1da194d
loginWithServicePrincipalSecretWithAuthResponse
function of@azure/ms-rest-nodeauth
with service principal credentials.subscriptions
property is an empty listExpected behavior The
subscriptions
property should be propagated with any subscriptions associated with the user.Additional context
The output I'm currently getting from my test script shows the difference in behavior: