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/firmware-analysis/quickstart-upload-firmware-using-azure-command-line-interface.md
+26-17Lines changed: 26 additions & 17 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -49,32 +49,37 @@ The output of this command includes a `name` property, which is your firmware ID
49
49
2. Generate a SAS URL, which you'll use in the next step to send your firmware image to Azure Storage. Replace `sampleFirmwareID` with the firmware ID that you saved from the previous step. You can store the SAS URL in a variable for easier access for future commands:
set subscription=123e4567-e89b-12d3-a456-426614174000
54
+
set workspace=default
55
+
set firmwareID=sampleFirmwareID
56
+
57
+
for /f "tokens=*" %i in ('az firmwareanalysis workspace generate-upload-url --resource-group %resourceGroup% --subscription %subscription% --workspace-name %workspace% --firmware-id %firmwareID% --query "url"') do set sasURL=%i
53
58
```
54
59
55
60
3. Upload your firmware image to Azure Storage. Replace `pathToFile` with the path to your firmware image on your local machine.
56
61
57
62
```azurecli
58
-
az storage blob upload -f pathToFile --blob-url $sasURL
63
+
az storage blob upload -f pathToFile --blob-url %sasURL%
59
64
```
60
65
61
66
Here's an example workflow of how you could use these commands to create and upload a firmware image. To learn more about using variables in CLI commands, visit [How to use variables in Azure CLI commands](/cli/azure/azure-cli-variables?tabs=bash):
for /f "tokens=*" %i in ('az firmwareanalysis workspace generate-upload-url --resource-group %resourceGroup% --workspace-name %workspace% --firmware-id %FWID% --query "url"') do set URL=%i
az storage blob upload -f %filePath% --blob-url %URL%
78
83
```
79
84
80
85
## Retrieve firmware analysis results
@@ -92,15 +97,19 @@ If you would like to automate the process of checking your analysis's status, yo
92
97
The `az resource wait` command has a `--timeout` parameter, which is the time in seconds that the analysis will end if "status" does not reach "Ready" within the timeout frame. The default timeout is 3600, which is one hour. Large images may take longer to analyze, so you can set the timeout using the `--timeout` parameter according to your needs. Here's an example of how you can use the `az resource wait` command with the `--timeout` parameter to automate checking your analysis's status, assuming that you have already created a firmware and stored the firmware ID in a variable named `$FWID`:
for /f "tokens=*" %i in ('az firmwareanalysis firmware show --resource-group %resourceGroup% --workspace-name %workspace% --firmware-id %FWID% --query "id"') do set ID=%i
96
105
97
-
Write-Host (‘Successfully created a firmware image with the firmware ID of ‘ + $FWID + ‘, recognized in Azure by this resource ID: ‘ + $ID + ‘.’)
106
+
echo Successfully created a firmware image with the firmware ID of %FWID%, recognized in Azure by this resource ID: %ID%.
0 commit comments