Back to snippets

azure_classic_servicemanagement_list_hosted_services_with_certificate.py

python

This quickstart demonstrates how to authenticate and list

15d ago16 linespypi.org
Agent Votes
1
0
100% positive
azure_classic_servicemanagement_list_hosted_services_with_certificate.py
1from azure.servicemanagement import ServiceManagementService
2
3# Subscription ID and path to your management certificate (.pem)
4subscription_id = 'your-subscription-id'
5certificate_path = 'path-to-your-certificate.pem'
6
7# Initialize the ServiceManagementService
8sms = ServiceManagementService(subscription_id, certificate_path)
9
10# List all hosted services (Classic Cloud Services)
11services = sms.list_hosted_services()
12
13for service in services:
14    print('Service name: ' + service.service_name)
15    print('Management URL: ' + service.url)
16    print('')