airflow: Unable to create a WinRM Connection with apache-airflow-providers-microsoft-winrm installed

Apache Airflow Provider(s)

microsoft-winrm

Versions of Apache Airflow Providers

2021-11-22_11h00_15

Apache Airflow version

2.2.2 (latest released)

Operating System

Windows Docker WSL2

Deployment

Docker-Compose

Deployment details

airflow.zip

What happened

Unable to create a WinRM Connection Provider is installed and viewable on dashboard 2021-11-22_11h00_15

What you expected to happen

We should be able to create a WinRM Connection on “Admin -> Connections”

image

How to reproduce

  1. Unzip the sample provided on deployment detail part
  2. Run docker-compose up airflow-init
  3. Run docker-compose up
  4. Go on http://localhost:8080/connection/add => There isn’t WinRM connection available on connection template

Anything else

No response

Are you willing to submit PR?

  • Yes I am willing to submit a PR!

Code of Conduct

About this issue

  • Original URL
  • State: open
  • Created 3 years ago
  • Comments: 31 (20 by maintainers)

Most upvoted comments

@sksirajbasha I haven’t used Rundeck personally, but perhaps you can try first to use the built-in remoting command from Windows.

Something like this:

$ Invoke-Command -ComputerName 10.0.0.22 -ScriptBlock { Get-ChildItem C:\ } -credential batman

I’m assuming that your system is Windows system running the default setup. You’re then supposed to be able to log into an administrator account using a username/password combination.

For some more background information, see https://www.maltheborch.com/2022/02/powershell-remoting-on-windows-using-airflow.html.

But rest assured, lots of people have been successfully using this operator – and of course the underlying Python package, https://pypi.org/project/pypsrp/.

If you have further questions, perhaps open a new issue with a complete bug report because this issue right here is about something else.

No rush just wanted to make sure it wasn’t forgotten

@potiuk Please assign it to me, I can work on this.

Test button only works for connections that support it - in this case It tries to run “HTTP” request - this is one of the reasons why you might want to

a) implement test functionaliy in WinRMConnection and make it works in customized WinRm connection b) implement Generic connection - then the test buttom will not appear there.

It should be basically as easy as adding new connection type here (and possibly adding/fixing some tests). https://github.com/apache/airflow/blob/56bdfe7a840c25360d596ca94fd11d2ccfadb4ba/airflow/www/views.py#L3290

In that case why don’t we name a new connection called “generic connection”. Maybe it could improve understanding on when we can use it (and improve documentation of providers that don’t need custom conenction

That’s a good feature to add. Can you add another feature request for it please ? Or maybe even straight add PR - for that - that’s a simple feature to add, no need to raise an issue for it.