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: sdk/iot/Azure.Iot.Hub.Service/tests/prerequisites/prerequisites.readme.md
+8Lines changed: 8 additions & 0 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -9,6 +9,14 @@
9
9
- If it isn't, update it
10
10
- Use this link to install [Azure CLI](https://docs.microsoft.com/en-us/cli/azure/install-azure-cli?view=azure-cli-latest])
11
11
12
+
### 2. Install the Iot extension
13
+
14
+
- Open powershell window in admin mode.
15
+
- Run `az extension list`
16
+
- If you see azure-iot extension, update the extension by running `az extension update --name azure-iot`
17
+
- If you don't see the azure-iot extension, install it by running `az extension add --name azure-iot`
18
+
- See the top-level IoT commands with `az iot -h`
19
+
12
20
## Maintenance
13
21
14
22
In order to maintain the functionality of the Setup.ps1 file, make sure this document stays updated with all the required changes if you run/alter this script.
if (-not (Test-Path$armTemplateFile-PathType leaf))
86
+
$hubExists= az iot hub list -g $ResourceGroup--query "[?name=='$IotHubName']"--output tsv --only-show-errors
87
+
if (-not$hubExists)
94
88
{
95
-
throw"`nARM template was not found. Please make sure you have an ARM template file named test-resources.json in the root of the service directory`n"
89
+
Write-Host"`nCreating IoT Hub $IotHubName`n"
90
+
az iot hub create -n $IotHubName-g $ResourceGroup--location $Region--output none --only-show-errors
96
91
}
97
-
98
-
# Deploy test-resources.json ARM template.
99
-
az deployment group create --resource-group $ResourceGroup--name $IotHubName--template-file $armTemplateFile--parameters `
100
-
baseName=$IotHubName`
101
-
testApplicationOid=$applicationOId`
102
-
location=$Region
103
-
104
-
# Even though the output variable names are all capital letters in the script, ARM turns them into a strange casing
105
-
# and we have to use that casing in order to get them from the deployment outputs.
106
-
$iotHubConnectionString= az deployment group show -g $ResourceGroup-n $IotHubName--query 'properties.outputs.ioT_HUB_CONNECTIONSTRING.value'--output tsv
107
-
$iotHubHostName= az deployment group show -g $ResourceGroup-n $IotHubName--query 'properties.outputs.ioT_HUB_ENDPOINT_URL.value'--output tsv
92
+
$iotHubHostName= az iot hub show -n $IotHubName-g $ResourceGroup--query 'properties.hostName'--output tsv --only-show-errors
108
93
109
94
Write-Host("Set a new client secret for $appId`n")
110
95
$appSecret= az ad app credential reset --id $appId--years 2--query 'password'--output tsv
@@ -115,14 +100,21 @@ Write-Host("Writing user config file - $fileName`n")
0 commit comments