Azure-sdk-for-js: Argument of type 'MSIAppServiceTokenCredentials' is not assignable to parameter of type 'ServiceClientCredentials'.

Created on 16 Jul 2020  路  9Comments  路  Source: Azure/azure-sdk-for-js

  • Package Name and Version:
    "@azure/arm-containerinstance": "^5.4.0"
    "@azure/ms-rest-nodeauth": "^3.0.5"

  • Operating system:
    Linux

  • [x] nodejs

    • version: v10.18.0

  • [x] typescript

    • version: ^3.9.6

Describe the bug
Typescript gives warning when I try to use loginWithAppServiceMSI in "@azure/ms-rest-nodeauth" to authenticate ContainerInstanceManagementClient in "@azure/arm-containerinstance". Error message is "Argument of type 'MSIAppServiceTokenCredentials' is not assignable to parameter of type 'ServiceClientCredentials'."

Expected behavior
"ms-rest-nodeauth" should work with "@azure/arm-containerinstance" according to https://github.com/Azure/azure-sdk-for-js/tree/master/sdk/containerinstance/arm-containerinstance#sample-code.

Screenshots
Screenshot 2020-07-16 at 2 33 53 PM

Container Service Mgmt Service Attention bug customer-reported

Most helpful comment

@stingray111 Looks like 4 days ago, an update was released via #10253. So, the latest version i.e. 6.0.0 should work as expected.

All 9 comments

@stingray111

You are using a very old version of the @azure/arm-containerinstance package which is not compatible with the latest version of the @azure/ms-rest-nodeauth package.

You have one of two options to move forward:

  • Either change the version of @azure/ms-rest-nodeauth from v3 to v2
  • Or change the version of @azure/arm-containerinstance to v9 or above

@ramya-rao-a

Thank you for your response. I would like to update the @azure/arm-containerinstance but the latest I can search for is 5.4.0 ( https://www.npmjs.com/package/@azure/arm-containerinstance). Can you give me some pointer on how to get a v9 library for that?

@stingray111 My apologies, I misunderstood and assumed that you were using @azure/arm-containerservices.

@changlong-liu, This would need us to re-generate the @azure/arm-containerinstance using the latest v4 code generator and release an update.

Thanks @ramya-rao-a .

And I see the swagger for containerinstance has been changed greatly since last release, a regeneration will involve these changes, including some breaking changes. So add service team to advise whether we need to release new package based on latest swagger.

Thanks for the feedback! We are routing this to the appropriate team for follow-up. cc @qike-ms, @jwilder, @thomas1206, @seanmck.

Hi service team, would you help to confirm the swagger for containerinstance are ready for release, and send sdk-release-request if it does. Thank you!

@ramya-rao-a

May I know if there is ETA regarding this issue? We would like update on library asap as we recently faced a fatal error on Azure Function with the old libraries. The Azure Support we contacted suggested us to update the library.

@stingray111 Looks like 4 days ago, an update was released via #10253. So, the latest version i.e. 6.0.0 should work as expected.

Please use the latest version and drop in a comment if you see any other issues

Thanks for reporting!

Was this page helpful?
0 / 5 - 0 ratings