You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: articles/defender-for-iot/device-builders/quickstart-upload-firmware-using-python.md
+26-6Lines changed: 26 additions & 6 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -20,9 +20,32 @@ This quickstart assumes a basic understanding of Defender for IoT Firmware Analy
20
20
21
21
### Prepare your environment
22
22
23
-
* Ensure that your client has the necessary permissions to upload firmware images to Defender for IoT Firmware Analysis. You must be an Owner, Contributor, Security Admin, or Firmware Analysis Admin at the Subscription or Resource Group level to upload firmware images. For more information, visit [Defender for IoT Firmware Analysis Roles, Scopes, and Capabilities](/azure/defender-for-iot/device-builders/defender-iot-firmware-analysis-rbac#defender-for-iot-firmware-analysis-roles-scopes-and-capabilities).
24
-
* Make note of your subscription ID, the name of your Resource Group where you'd like to upload your images, your workspace name, and the name of the firmware image that you'd like to upload.
23
+
* Python version 3.8+ is required to use this package. Run the command `python --version` to check your Python version. If's not the latest, please update to the latest Python version
24
+
* Make note of your Azure subscription ID, the name of your Resource Group where you'd like to upload your images, your workspace name, and the name of the firmware image that you'd like to upload
25
+
* Ensure that your Azure account has the necessary permissions to upload firmware images to Defender for IoT Firmware Analysis for your Azure subscription. You must be an Owner, Contributor, Security Admin, or Firmware Analysis Admin at the Subscription or Resource Group level to upload firmware images. For more information, visit [Defender for IoT Firmware Analysis Roles, Scopes, and Capabilities](/azure/defender-for-iot/device-builders/defender-iot-firmware-analysis-rbac#defender-for-iot-firmware-analysis-roles-scopes-and-capabilities)
25
26
* Ensure that your firmware image is stored in the same directory as the following code
27
+
* Install the packages needed to run this script:
28
+
```python
29
+
pip install azure-mgmt-iotfirmwaredefense
30
+
pip install azure-identity
31
+
```
32
+
* [Configure](/azure/azure-web-pubsub/howto-authorize-from-application) the following environment variables:
33
+
*`AZURE_CLIENT_ID`for Azure client ID
34
+
*`AZURE_TENANT_ID`for Azure tenant ID
35
+
*`AZURE_CLIENT_SECRET`for Azure client secret
36
+
37
+
In addition, the Azure subscription ID can be configured with the environment variable `AZURE_SUBSCRIPTION_ID`.
38
+
39
+
Once you've configured your environment variables, the client can be authenticated by the following code:
40
+
41
+
```python
42
+
from azure.identity import DefaultAzureCredential
43
+
from azure.mgmt.iotfirmwaredefense import IoTFirmwareDefenseMgmtClient
0 commit comments