I like to share similarities and differences of two scripts – an Azure PowerShell script and a Python script using the Azure SDK. These two scripts achieve the same azure management result. Hope this article sheds some technical insights by comparing these scripts.
The scripts connect to an Azure subscription, create a storage account into an existing resource group and list the resources in the resource group.
PowerShell script:

Console output:

Python script:

Console output:

Resource Group in Azure Portal:

| Code Step | Azure PowerShell | Azure SDK & Python |
| 1 | There is no import or include lines as the Azure PowerShell modules are already installed. | The import statements are required to make use of Azure SDK management and client library modules. |
| 2 | Connecting or logging into the Azure tenant and subscription. | Connecting or logging into the Azure tenant and subscription. No big differences. |
| 3 | Creating a storage account using using a command and a set of arguments. This is more of a “declarative” style and is easy to work with. | With the storage client object, the programming is very much imperative with passing in functional arguments and any objects. |
| 4 | To get an existing resource group object, it is simply calling the Az PowerShell command. No need to deal with client objects. | Need to create a client object for resource group and query for the resource group. |
| 5 | Iterating through resources and adding each key-value in a hashtable | Iterating through resources and adding each key-value in a dictionary. Syntax is quite similar to each other. |
| 6 | Printing the hasthable of resources | Printing the dictionary of resources |
Conclusion
There you have it! Simple comparison to understand the programming, syntax, style and objects in managing Azure resources. Hope this helps you decide which language suits your style and requirements.