Skip to content

Commit 1022b12

Browse files
committed
fix example
1 parent 5e06aaa commit 1022b12

File tree

1 file changed

+9
-0
lines changed

1 file changed

+9
-0
lines changed

articles/azure-resource-manager/management/lock-resources.md

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -474,6 +474,15 @@ You lock deployed resources with Python by using the [ManagementLockClient.manag
474474
To lock a resource, provide the name of the resource, its resource type, and its resource group name.
475475

476476
```python
477+
import os
478+
from azure.identity import AzureCliCredential
479+
from azure.mgmt.resource import ManagementLockClient
480+
481+
credential = AzureCliCredential()
482+
subscription_id = os.environ["AZURE_SUBSCRIPTION_ID"]
483+
484+
lock_client = ManagementLockClient(credential, subscription_id)
485+
477486
lock_result = lock_client.management_locks.create_or_update_at_resource_level(
478487
"exampleGroup",
479488
"Microsoft.Web",

0 commit comments

Comments
 (0)