0

Summary: I'm trying to create a python program to run Powershell scripts in Azure Windows VMs. But I can't find good documentation about which libraries of the SDK I can use.

Detailed: In order to automate certain administrative tasks, a python program should run, authenticate into Azure and then run Powershell scripts in certain Windows VMs. I think I have the auth part thanks to azure.identity, but I can't find any library to interact with a running VM. Sure, lots for creating or modifying a VM in Azure, but nothing to interact with it. Neither in the SDK or in the API browser. I know it can be done with Azure CLI, but id like to use the SDK, if possible at all.

1 Answer 1

1

My understanding is that you would like to run PowerShell remotely using the Python SDK.

AFAIK, I don't think there is a provision within the Azure Python SDK to run remote PS scripts.

Workaround :

(But please note that this outside the Azure Python SDK.)

You could create Azure Windows WinRM VM template and you could execute ps commands from the Python code using the winrm library like discussed in this thread.

Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.