Azure SDK for python
- Refer Here for official docs
- Python code to get list of resource groups
import os
from azure.identity import AzureCliCredential
from azure.mgmt.resource import ResourceManagementClient
def resource_group_list():
"""This method prints the resource groups
"""
# in my machine there is already an environmental variable `ARM_SUBSCRIPTION_ID`
subscription_id = os.getenv('ARM_SUBSCRIPTION_ID')
credential = AzureCliCredential()
resource_client = ResourceManagementClient(credential,subscription_id)
names = list()
for group in resource_client.resource_groups.list():
names.append(group.name)
print(names)
if __name__ == "__main__":
#list resource groups
resource_group_list()
Azure Functions
- Refer Here for docs
- Refer Here for API Management
