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

[BUG] Not able to create VirtualMachineScaleSetVM instance for unit test. Ambiguous constructor call for Azure compute SDK > 47.0 #23359

Closed
KalpeshChavan12 opened this issue Aug 17, 2021 · 9 comments
Assignees
Labels
Compute - VMSS issue-addressed Workflow: The Azure SDK team believes it to be addressed and ready to close. Mgmt This issue is related to a management-plane library. Service Attention Workflow: This issue is responsible by Azure service team.

Comments

@KalpeshChavan12
Copy link
Contributor

KalpeshChavan12 commented Aug 17, 2021

Describe the bug
Compilation error while creating instance of VirtualMachineScaleSetVM class instance for unit test.

Expected behavior
Following should compile

 var vmssVm = new VirtualMachineScaleSetVM(location: "",
                                                    sku: new Sku() { Name = "xyz" },
                                                    storageProfile: new StorageProfile()
                                                    {
                                                        OsDisk = new OSDisk()
                                                        {
                                                            OsType = OperatingSystemTypes.Linux
                                                        }
                                                    });

Actual behavior (include Exception or Stack Trace)
What is the actual behavior?
Compilation error, ambiguous call


Program.cs(46,30,46,54): error CS0121: The call is ambiguous between the following methods or properties: 'VirtualMachineScaleSetVM.VirtualMachineScaleSetVM(string, string, string, string, IDictionary<string, string>, string, Sku, bool?, string, VirtualMachineScaleSetVMInstanceView, HardwareProfile, StorageProfile, AdditionalCapabilities, OSProfile, SecurityProfile, NetworkProfile, VirtualMachineScaleSetVMNetworkProfileConfiguration, DiagnosticsProfile, SubResource, string, string, string, VirtualMachineScaleSetVMProtectionPolicy, Plan, IList<VirtualMachineExtension>, IList<string>)' and 'VirtualMachineScaleSetVM.VirtualMachineScaleSetVM(string, string, string, string, IDictionary<string, string>, string, Sku, bool?, string, VirtualMachineScaleSetVMInstanceView, HardwareProfile, StorageProfile, AdditionalCapabilities, OSProfile, SecurityProfile, NetworkProfile, VirtualMachineScaleSetVMNetworkProfileConfiguration, DiagnosticsProfile, SubResource, string, string, string, VirtualMachineScaleSetVMProtectionPolicy, Plan, IList<VirtualMachineExtension>)'

To Reproduce
Steps to reproduce the behavior (include a code snippet, screenshot, or any additional information that might help us reproduce the issue)

  1. Create new project and create class as mentioned in issue.
  2. Use https://www.nuget.org/packages/Microsoft.Azure.Management.Compute >= 47.0
  3. Build project

Note: Build successful version <= 46.0.0

Environment:

  • Name and version of the Library package used: [e.g. Azure.Storage.Blobs 12.2.0]
  • Hosting platform or OS and .NET runtime version (dotnet --info output for .NET Core projects): [e.g. Azure AppService or Windows 10 .NET Framework 4.8]
  • IDE and version :: Visual Studio 19
@ghost ghost added the needs-triage Workflow: This is a new issue that needs to be triaged to the appropriate team. label Aug 17, 2021
@jsquire jsquire added Compute - VMSS Mgmt This issue is related to a management-plane library. needs-team-attention Workflow: This issue needs attention from Azure service team or SDK team labels Aug 17, 2021
@ghost ghost removed the needs-triage Workflow: This is a new issue that needs to be triaged to the appropriate team. label Aug 17, 2021
@jsquire
Copy link
Member

jsquire commented Aug 17, 2021

Thank you for your feedback. Tagging and routing to the team member best able to assist.

@yungezz yungezz added Service Attention Workflow: This issue is responsible by Azure service team. and removed needs-team-attention Workflow: This issue needs attention from Azure service team or SDK team labels Aug 23, 2021
@ghost
Copy link

ghost commented Aug 23, 2021

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

Issue Details

Describe the bug
Compilation error while creating instance of VirtualMachineScaleSetVM class instance for unit test.

Expected behavior
Following should compile

 var vmssVm = new VirtualMachineScaleSetVM(location: "",
                                                    sku: new Sku() { Name = "xyz" },
                                                    storageProfile: new StorageProfile()
                                                    {
                                                        OsDisk = new OSDisk()
                                                        {
                                                            OsType = OperatingSystemTypes.Linux
                                                        }
                                                    });

Actual behavior (include Exception or Stack Trace)
What is the actual behavior?
Compilation error, ambiguous call


Program.cs(46,30,46,54): error CS0121: The call is ambiguous between the following methods or properties: 'VirtualMachineScaleSetVM.VirtualMachineScaleSetVM(string, string, string, string, IDictionary<string, string>, string, Sku, bool?, string, VirtualMachineScaleSetVMInstanceView, HardwareProfile, StorageProfile, AdditionalCapabilities, OSProfile, SecurityProfile, NetworkProfile, VirtualMachineScaleSetVMNetworkProfileConfiguration, DiagnosticsProfile, SubResource, string, string, string, VirtualMachineScaleSetVMProtectionPolicy, Plan, IList<VirtualMachineExtension>, IList<string>)' and 'VirtualMachineScaleSetVM.VirtualMachineScaleSetVM(string, string, string, string, IDictionary<string, string>, string, Sku, bool?, string, VirtualMachineScaleSetVMInstanceView, HardwareProfile, StorageProfile, AdditionalCapabilities, OSProfile, SecurityProfile, NetworkProfile, VirtualMachineScaleSetVMNetworkProfileConfiguration, DiagnosticsProfile, SubResource, string, string, string, VirtualMachineScaleSetVMProtectionPolicy, Plan, IList<VirtualMachineExtension>)'

To Reproduce
Steps to reproduce the behavior (include a code snippet, screenshot, or any additional information that might help us reproduce the issue)

  1. Create new project and create class as mentioned in issue.
  2. Use https://www.nuget.org/packages/Microsoft.Azure.Management.Compute >= 47.0
  3. Build project

Note: Build successful version <= 46.0.0

Environment:

  • Name and version of the Library package used: [e.g. Azure.Storage.Blobs 12.2.0]
  • Hosting platform or OS and .NET runtime version (dotnet --info output for .NET Core projects): [e.g. Azure AppService or Windows 10 .NET Framework 4.8]
  • IDE and version :: Visual Studio 19
Author: KalpeshChavan12
Assignees: allenjzhang
Labels:

Compute - VMSS, Service Attention, Mgmt

Milestone: -

@yungezz
Copy link
Member

yungezz commented Aug 23, 2021

route to service team to have a look

@amjads1
Copy link

amjads1 commented Aug 24, 2021

@avirishuv Could you please look into the issue?

@avirishuv
Copy link

hi @yungezz is this an issue in the SDK layer, would you mind investigating?

@yungezz
Copy link
Member

yungezz commented Sep 10, 2021

hi @HarveyLink could you help to take a look? thanks

@HarveyLink
Copy link
Member

Hi @KalpeshChavan12 , this issue has been fixed in version 49.1.0, would you mind update to the latest version and try your code?

@HarveyLink HarveyLink added the issue-addressed Workflow: The Azure SDK team believes it to be addressed and ready to close. label Sep 14, 2021
@ghost
Copy link

ghost commented Sep 14, 2021

Hi @KalpeshChavan12. Thank you for opening this issue and giving us the opportunity to assist. We believe that this has been addressed. If you feel that further discussion is needed, please add a comment with the text “/unresolve” to remove the “issue-addressed” label and continue the conversation.

@ghost
Copy link

ghost commented Sep 21, 2021

Hi @KalpeshChavan12, since you haven’t asked that we “/unresolve” the issue, we’ll close this out. If you believe further discussion is needed, please add a comment “/unresolve” to reopen the issue.

@ghost ghost closed this as completed Sep 21, 2021
@github-actions github-actions bot locked and limited conversation to collaborators Mar 27, 2023
This issue was closed.
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Compute - VMSS issue-addressed Workflow: The Azure SDK team believes it to be addressed and ready to close. Mgmt This issue is related to a management-plane library. Service Attention Workflow: This issue is responsible by Azure service team.
Projects
None yet
Development

No branches or pull requests

7 participants