Skip to content

Commit 21b17e0

Browse files
committed
Update script to use az login
1 parent 0bb4eff commit 21b17e0

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

articles/defender-for-iot/device-builders/quickstart-upload-firmware-using-python.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -57,7 +57,7 @@ client = IoTFirmwareDefenseMgmtClient(credential=DefaultAzureCredential(), subsc
5757
Copy the following Python script into a `.py` file and save it to the same directory as your firmware image. Replace the `subscription_id` variable with your Azure subscription ID, `resource_group_name` with the name of your Resource Group where you'd like to upload your firmware image, and `firmware_file` with the name of your firmware image, which is saved in the same directory as the Python script.
5858

5959
```python
60-
from azure.identity import DefaultAzureCredential
60+
from azure.identity import AzureCliCredential
6161
from azure.mgmt.iotfirmwaredefense import *
6262
from azure.mgmt.iotfirmwaredefense.models import *
6363
from azure.core.exceptions import *
@@ -80,8 +80,8 @@ def main():
8080

8181
def init_connections(firmware_id):
8282
spinner = Halo(text=f"Creating client for firmware {firmware_id}")
83-
default_credential = DefaultAzureCredential()
84-
client = IoTFirmwareDefenseMgmtClient(default_credential, subscription_id, 'https://management.azure.com')
83+
cli_credential = AzureCliCredential()
84+
client = IoTFirmwareDefenseMgmtClient(cli_credential, subscription_id, 'https://management.azure.com')
8585
spinner.succeed()
8686
return client
8787

0 commit comments

Comments
 (0)