Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

error when create a ApplicationInsightsManagementClient instance #10045

Closed
3 of 6 tasks
VanyLaw opened this issue Jul 14, 2020 · 15 comments
Closed
3 of 6 tasks

error when create a ApplicationInsightsManagementClient instance #10045

VanyLaw opened this issue Jul 14, 2020 · 15 comments
Assignees
Labels
Bot Service bug This issue requires a change to an existing behavior in the product in order to be resolved. customer-reported Issues that are reported by GitHub users external to the Azure organization. Mgmt This issue is related to a management-plane library. Monitor - ApplicationInsights Service Attention Workflow: This issue is responsible by Azure service team.

Comments

@VanyLaw
Copy link

VanyLaw commented Jul 14, 2020

  • Package Name: @azure/arm-appinsights ; @azure/arm-botservice
  • Package Version: newest in npm
  • Operating system: window
  • nodejs
    • version:
  • browser
    • name/version:
  • typescript
    • version:
  • Is the bug related to documentation in

Describe the bug
I can not new a ApplicationInsightsManagementClient instance(come from @azure/arm-appinsights) and AzureBotService instance (come from @azure/arm-botservice) if I only have a accessToken.

I create a TokenCredentials instance with accessToken, which is implement the ServiceClientCredentials, and try to use this as the parameter to create ApplicationInsightsManagementClient and AzureBotService, but failed. I guess it's because the version of @azure/ms-rest-js package which is dependency in @azure/arm-appinsights and @azure/arm-botservice is out of dated.

Could anyone can update the dependency package version of @azure/arm-appinsights and @azure/arm-botservice? Or could you tell me how to create those two types of instances just by accessToken?

To Reproduce
Steps to reproduce the behavior:

  1. const token = new TokenCredentials(accessToken);
  2. new ApplicationInsightsManagementClient(token ````); // error parameter.

Expected behavior
A clear and concise description of what you expected to happen.

Screenshots
If applicable, add screenshots to help explain your problem.

Additional context
Add any other context about the problem here.

@ghost ghost added needs-triage Workflow: This is a new issue that needs to be triaged to the appropriate team. customer-reported Issues that are reported by GitHub users external to the Azure organization. question The issue doesn't require a change to the product in order to be resolved. Most issues start as that labels Jul 14, 2020
@ramya-rao-a ramya-rao-a added Mgmt This issue is related to a management-plane library. Monitor - ApplicationInsights labels Jul 14, 2020
@ghost ghost removed the needs-triage Workflow: This is a new issue that needs to be triaged to the appropriate team. label Jul 14, 2020
@qiaozha
Copy link
Member

qiaozha commented Jul 15, 2020

@changlong-liu Can you please take a look at this issue? Thanks

@VanyLaw
Copy link
Author

VanyLaw commented Jul 15, 2020

FYI. Error messages are:
error TS2345: Argument of type 'import("/Composer/plugins/node_modules/@azure/ms-rest-js/es/lib/credentials/serviceClientCredentials").ServiceClientCredentials' is not assignable to parameter of type 'import("/Composer/plugins/node_modules/@azure/arm-appinsights/node_modules/@azure/ms-rest-js/es/lib/credentials/serviceClientCredentials").ServiceClientCredentials'.
Types of property 'signRequest' are incompatible.
Type '(webResource: WebResourceLike) => Promise' is not assignable to type '(webResource: WebResource) => Promise'.
Types of parameters 'webResource' and 'webResource' are incompatible.
Type 'WebResource' is not assignable to type 'WebResourceLike'.
Types of property 'shouldDeserialize' are incompatible.
Type 'boolean | ((response: import("Composer/plugins/node_modules/@azure/arm-appinsights/node_modules/@azure/ms-rest-js/es/lib/httpOperationResponse").HttpOperationResponse) => boolean) | undefined' is not assignable to type 'boolean | ((response: import("/Composer/plugins/node_modules/@azure/ms-rest-js/es/lib/httpOperationResponse").HttpOperationResponse) => boolean) | undefined'.
Type '(response: HttpOperationResponse) => boolean' is not assignable to type 'boolean | ((response: HttpOperationResponse) => boolean) | undefined'.
Type '(response: import("/Composer/plugins/node_modules/@azure/arm-appinsights/node_modules/@azure/ms-rest-js/es/lib/httpOperationResponse").HttpOperationResponse) => boolean' is not assignable to type '(response: import("/Composer/plugins/node_modules/@azure/ms-rest-js/es/lib/httpOperationResponse").HttpOperationResponse) => boolean'.
Types of parameters 'response' and 'response' are incompatible.
Type 'import("/Composer/plugins/node_modules/@azure/ms-rest-js/es/lib/httpOperationResponse").HttpOperationResponse' is not assignable to type 'import("/Composer/plugins/node_modules/@azure/arm-appinsights/node_modules/@azure/ms-rest-js/es/lib/httpOperationResponse").HttpOperationResponse'.
The types of 'request.headers' are incompatible between these types.
Property '_headersMap' is missing in type 'HttpHeadersLike' but required in type 'HttpHeaders'.

818 const appinsightsClient = new ApplicationInsightsManagementClient(tokenCredential, this.subId);
~~~~~~~~~~~~~~~

../../node_modules/@azure/arm-appinsights/node_modules/@azure/ms-rest-js/es/lib/httpHeaders.d.ts:24:22
24 private readonly _headersMap;
~~~~~~~~~~~
'_headersMap' is declared here.

src/botProjectDeploy.ts:853:54 - error TS2345: Argument of type 'import("/Composer/plugins/node_modules/@azure/ms-rest-js/es/lib/credentials/serviceClientCredentials").ServiceClientCredentials' is not assignable to parameter of type 'import("/Composer/plugins/node_modules/@azure/arm-appinsights/node_modules/@azure/ms-rest-js/es/lib/credentials/serviceClientCredentials").ServiceClientCredentials'.

853 const botServiceClient = new AzureBotService(tokenCredential, this.subId);
~~~~~~~~~~~~~~~

Found 2 errors.

@changlong-liu changlong-liu added the Service Attention Workflow: This issue is responsible by Azure service team. label Jul 16, 2020
@ghost
Copy link

ghost commented Jul 16, 2020

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

@changlong-liu
Copy link
Member

Hi applicationinsights service team, the JS SDK is using a old version of ms-rest, would you confirm we need to release a new SDK based on latest swagger? Thank you.

@ramya-rao-a
Copy link
Contributor

@changlong-liu The last update to @azure/arm-appinsights was almost a year ago. Since then, the swagger spec has been updated multiple times and corresponding automated PRs have been opened in this repo as well, but none were merged. See https://github.com/Azure/azure-sdk-for-js/pulls?q=is%3Apr+appinsights+is%3Aclosed+in%3Atitle

I would take that as an indication that the service team has been making the swagger updates assuming that the automation would take care of updating the packages.

So, I would highly recommend updating the package and not only unblock the customer, but also allow them to use the new features.

cc @tofriedl and @majastrz, the last two people to update the swagger for confirmation

@ramya-rao-a ramya-rao-a added bug This issue requires a change to an existing behavior in the product in order to be resolved. and removed question The issue doesn't require a change to the product in order to be resolved. Most issues start as that labels Jul 19, 2020
@changlong-liu
Copy link
Member

Hi @ramya-rao-a , thanks for comments. I'll involve you in the mail thread we discussing this with the issue submitter and ApplicationInsights service team.

The reasons we didn't release new package by ourselves are:

  1. the swagger has changed a lot since last release, we don't know whether they are ready in service side.
  2. has breaking changes
  3. the current swagger has definition issues, it's hard to say that it's ready for release.

@ghost
Copy link

ghost commented Jul 20, 2020

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

@changlong-liu
Copy link
Member

Update for current status:
Appinsights: swagger issue is fixed(Azure/azure-rest-api-specs#10228). The service team is fixing issues in service side, and we can expect to release sdk after service is ready.
Botservice: don’t get response from service side yet.

@qiaozha qiaozha added this to the Backlog milestone Jul 31, 2020
@luhan2017
Copy link

@stevengum , Hi, could you please help submit a release request for bot service?

@stevengum
Copy link

@luhan2017 @VanyLaw @changlong-liu, sorry for the delay the release request has been filed.

@changlong-liu
Copy link
Member

Hi @stevengum , @VanyLaw , the botservice JS package is available here: https://microsoft.sharepoint.com/:u:/t/AzureManagementExperience/EesAOwtz9LZPsOex0y0AI54BegRKJUFDa5Oz4zNPqiYQcQ?e=TDGtYM

Would you verify it before public release? Thank you!

@VanyLaw
Copy link
Author

VanyLaw commented Oct 12, 2020

Hi @changlong-liu , it can work in my site. Thanks!

@changlong-liu
Copy link
Member

Hi @VanyLaw , the botservice is released here: https://www.npmjs.com/package/@azure/arm-botservice/v/2.0.0

@changlong-liu
Copy link
Member

Hi @VanyLaw , shall I know whether have any issue on the packages, shall we close this issue?

@ramya-rao-a
Copy link
Contributor

Closing this issue as both the @azure/arm-appinsights and @azure/arm-botservice have been updated appropriately

@xirzec xirzec removed this from the Backlog milestone May 17, 2022
@github-actions github-actions bot locked and limited conversation to collaborators Apr 12, 2023
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Bot Service bug This issue requires a change to an existing behavior in the product in order to be resolved. customer-reported Issues that are reported by GitHub users external to the Azure organization. Mgmt This issue is related to a management-plane library. Monitor - ApplicationInsights Service Attention Workflow: This issue is responsible by Azure service team.
Projects
None yet
Development

No branches or pull requests

7 participants