Cannot use @azure/ms-rest-nodeauth loginWithServicePrincipalSecret for @azure/arm-sqlvirtualmachine
See original GitHub issue- Package Name: @azure/arm-sqlvirtualmachine
- Package Version: @azure/arm-sqlvirtualmachine@3.1.0, @azure/ms-rest-nodeauth@3.0.5
- Operating system: linux, macOS
- nodejs
- version: v12.17.0
- browser
- name/version:
- typescript
- version: v4.0.2
- Is the bug related to documentation in
- README.md
- source code documentation
- SDK API docs on https://docs.microsoft.com
Describe the bug A clear and concise description of what the bug is.
Repro Code:
import { loginWithServicePrincipalSecret } from "@azure/ms-rest-nodeauth";
import { SqlVirtualMachineManagementClient } from "@azure/arm-sqlvirtualmachine";
async function run() {
const creds = await loginWithServicePrincipalSecret(
"",
"",
""
);
const client = new SqlVirtualMachineManagementClient(creds, "");
}
Argument of type 'ApplicationTokenCredentials' is not assignable to parameter of type 'ServiceClientCredentials'.
Types of property 'signRequest' are incompatible.
Type '(webResource: import("/Users/hdavidzhu/azure-vm-test/node_modules/@azure/ms-rest-js/es/lib/webResource").WebResource) => Promise<import("/Users/hdavidzhu/azure-vm-test/node_modules/@azure/ms-rest-js/es/lib/webResource").WebResource>' is not assignable to type '(webResource: import("/Users/hdavidzhu/azure-vm-test/node_modules/@azure/arm-sqlvirtualmachine/node_modules/@azure/ms-rest-js/es/lib/webResource").WebResource) => Promise<import("/Users/hdavidzhu/azure-vm-test/node_modules/@azure/arm-sqlvirtualmachine/node_modules/@azure/ms-rest-js/es/lib/webResource").WebResource>'.
Types of parameters 'webResource' and 'webResource' are incompatible.
Type 'import("/Users/hdavidzhu/azure-vm-test/node_modules/@azure/arm-sqlvirtualmachine/node_modules/@azure/ms-rest-js/es/lib/webResource").WebResource' is not assignable to type 'import("/Users/hdavidzhu/azure-vm-test/node_modules/@azure/ms-rest-js/es/lib/webResource").WebResource'.
Types of property 'shouldDeserialize' are incompatible.
Type 'boolean | ((response: import("/Users/hdavidzhu/azure-vm-test/node_modules/@azure/arm-sqlvirtualmachine/node_modules/@azure/ms-rest-js/es/lib/httpOperationResponse").HttpOperationResponse) => boolean)' is not assignable to type 'boolean | ((response: import("/Users/hdavidzhu/azure-vm-test/node_modules/@azure/ms-rest-js/es/lib/httpOperationResponse").HttpOperationResponse) => boolean)'.
Type '(response: HttpOperationResponse) => boolean' is not assignable to type 'boolean | ((response: HttpOperationResponse) => boolean)'.
Type '(response: import("/Users/hdavidzhu/azure-vm-test/node_modules/@azure/arm-sqlvirtualmachine/node_modules/@azure/ms-rest-js/es/lib/httpOperationResponse").HttpOperationResponse) => boolean' is not assignable to type '(response: import("/Users/hdavidzhu/azure-vm-test/node_modules/@azure/ms-rest-js/es/lib/httpOperationResponse").HttpOperationResponse) => boolean'.
Types of parameters 'response' and 'response' are incompatible.
Type 'import("/Users/hdavidzhu/azure-vm-test/node_modules/@azure/ms-rest-js/es/lib/httpOperationResponse").HttpOperationResponse' is not assignable to type 'import("/Users/hdavidzhu/azure-vm-test/node_modules/@azure/arm-sqlvirtualmachine/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'.
To Reproduce Steps to reproduce the behavior:
- Install the above packages
- Try to use the creds in the client
Expected behavior A clear and concise description of what you expected to happen.
The client should accept the credentials.
Screenshots If applicable, add screenshots to help explain your problem.
Additional context Add any other context about the problem here.
From https://github.com/Azure/azure-sdk-for-js/issues/6368, it looks like @azure/arm-sqlvirtualmachine
works with @azure/ms-rest-nodeauth@2
, but I’m using v3 for all my other clients.
Issue Analytics
- State:
- Created 3 years ago
- Comments:5 (3 by maintainers)
Top Results From Across the Web
azurerm_mssql_virtual_machine | hashicorp/azurerm
This example provisions a brief Managed Microsoft SQL Virtual Machine. The detailed example of the azurerm_mssql_virtual_machine resource can be found in ...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
@ramya-rao-a Hi, I have a PR #11252 to fix this issue. Could you please help review it? Thanks
Thanks for reporting @hdavidzhu!
@qiaozha, Can we have the package re-generated using the latest v4 of the code generator to fix this?