question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

[QUESTION] How to use .WithWinRM() ?

See original GitHub issue

Question I have a question about the WithWinRM method for the VirtualMachine creation using the .NET Azure SDK. I’m using this call to create a VM:

var vm = await azure.VirtualMachines.Define("testVM")
                       .WithRegion("East US")
                       .WithExistingResourceGroup("TestRg")
                       .WithExistingPrimaryNetworkInterface("testVM_nic")
                       .WithWindowsCustomImage(customImage.Id)
                       .WithAdminUsername("Testuser")
                       .WithAdminPassword("Test12345678")
                       .WithWinRM(new WinRMListener(ProtocolTypes.Https, certificateUrl))
                       .WithComputerName("testVM")                       
                       .WithSize(VirtualMachineSizeTypes.StandardDS3V2)
                       .CreateAsync();

After running this I get an error:

Certificate https://xxx.vault.azure.net/secrets/xxx/db1baf0c860f456ks4nckh06d86e1ec8594 specified in WinRM configuration is not defined in the VM model secrets.

How can I specify the OsProfile.Secrets option with the fluent API?

Why is this not a Bug or a feature Request? Not sure if I’m using it correctly, even though I found nothing in the documentation about this.

Setup (please complete the following information if applicable):

  • OS: Windows
  • IDE : Visual Studio 2019
  • Microsoft.Azure.Management.Fluent 1.26.1

Information Checklist Kindly make sure that you have added all the following information above and checkoff the required fields otherwise we will treat the issuer as an incomplete report

  • [x ] Query Added
  • [x ] Setup information Added

Issue Analytics

  • State:closed
  • Created 4 years ago
  • Comments:5 (4 by maintainers)

github_iconTop GitHub Comments

1reaction
weidongxu-microsoftcommented, May 6, 2020

@Mishu

Would you please upgrade to 1.30.0 or later? Latest is 1.33.0. Related PR https://github.com/Azure/azure-libraries-for-net/pull/926 Related doc https://docs.microsoft.com/en-us/azure/virtual-machines/windows/winrm

It would have an additional API WithVaultSecret to set up keyvault setting.

0reactions
weidongxu-microsoftcommented, May 6, 2020

I assume upgrading to 1.30.0+ would solve the problem (as in PR mentioned).

Reopen it if you still find issue.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Understanding and troubleshooting WinRM connection and ...
This is the first question I ask. If winrm is not listening for requests, then there is nothing to connect to. There are...
Read more >
Configure and listen successfully using WinRM in powershell
To determine which group policy is configuring your WinRM you can run the following from an administrative command prompt:
Read more >
How to test WinRM connectivity using PowerShell
We need to use Test- WS command for it. Test-WSMan -ComputerName Test1-Win2k12. If you get the below response, then the WinRM connection is ......
Read more >
Winrm - Windows CMD
Secure communication with local and remote computers using web services. ... WinRM is the Microsoft implementation of WS-Management Protocol, a standard Simple ...
Read more >
Compromising Yourself with WinRM's “AllowUnencrypted = ...
The tool is using 'Authorization: Basic', as you can see from the top. The rest of the red is the content of the...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found