File tree Expand file tree Collapse file tree 1 file changed +20
-0
lines changed Expand file tree Collapse file tree 1 file changed +20
-0
lines changed Original file line number Diff line number Diff line change
1
+ from azure .identity import DefaultAzureCredential
2
+ from azure .mgmt .containerregistry import ContainerRegistryManagementClient
3
+
4
+ # Set your Azure subscription ID
5
+ subscription_id = "<your-subscription-id>"
6
+
7
+ # Initialize credentials and ACR client
8
+ credential = DefaultAzureCredential ()
9
+ acr_client = ContainerRegistryManagementClient (credential , subscription_id )
10
+
11
+ # List all container registries in the subscription
12
+ registries = acr_client .registries .list ()
13
+
14
+ for registry in registries :
15
+ print ("Registry Name:" , registry .name )
16
+ print ("Location:" , registry .location )
17
+ print ("SKU:" , registry .sku .name )
18
+ print ("Login Server:" , registry .login_server )
19
+ print ("Admin User Enabled:" , registry .admin_user_enabled )
20
+ print ("-" * 40 )
You can’t perform that action at this time.
0 commit comments