Is making a python wrapper for the Azure-PowerShell SDK a stupid idea?
<p>My opinion of the Azure-Python SDK is not high for Azure RM. What takes 1 line in PowerShell takes 10 in Python. That is the opposite of what python is supposed to do.</p>

<p>So, my idea is to create python package which comes with a directory containing a few template .ps1 scripts. You would define a few variables like vmname, resourcegroup, location, etc... inject these into the .ps1 templates, then call commands from the REPL. </p>

<p>Right now I'm having trouble using the subprocess module to keep PS open until I tell it to close. As it stands now, I need to include</p>

<pre><code>login-azurerm
</code></pre>

<p>and authenticate before running <strong>any</strong> command. This won't do. I'd like to fix this, but frankly right now I'm wondering whether or not the premise is a good idea to start with.</p>

<p>Any input is much appreciated!</p>

<p>@RobTruxal, It seems that a feasible way to call PowerShell in Python is using the module <code>subprocess</code>, such as the code below as reference.</p>

<pre><code>import subprocess
subprocess.call(["C:\\WINDOWS\\system32\\WindowsPowerShell\\v1.0\\powershell.exe", "your-script.ps1", "arguments"])
</code></pre>

<p>You need to write your powershell script which includes <code>login-azurerm</code> command, and interaction with cmd that running python script.</p>

<p>Or you can choose the AzureCLI for cross platform in node.js as the command line tool for managing Azure Resoure.</p>

<p>Hope it helps.</p>

python powershell azure