Code deployment consists of pushing compiled code into previously deployed compute resources.
NOTE:For the next steps you will need to download the following two files:
DIstech.CloudRelay.API zip file
DIstech.CloudRelay.Functions zip file
Do not extract either file. They will be deployed as zip files. For the purposes of this example they will be placed on the desktop of the user in a folder named Distech-AzureIOT.
Navigate to the directory named Distech-AzureIOT
in the folder structure on your Desktop using powershell.
Example Request:
cd ..\..\
Example Response:
PS C:\Users\dcts0859\Desktop\Distech-AzureIOT\relay-arm\Compute> cd ..\..\
PS C:\Users\dcts0859\Desktop\Distech-AzureIOT>
Verify that the files needed for this step in the deployment are present in the directory by running the follow command
Example Request:
ls
Example Response:
PS C:\Users\dcts0859\Desktop\Distech-AzureIOT> ls
Directory: C:\Users\dcts0859\Desktop\Distech-AzureIOT
Mode LastWriteTime Length Name
---- ------------- ------ ----
d----- 11/28/2020 4:36 PM relay-arm
-a---- 11/28/2020 8:28 PM 2342100 Distech.CloudRelay.API.zip
-a---- 11/28/2020 8:28 PM 3603438 Distech.CloudRelay.Functions.zip
-a---- 11/28/2020 4:36 PM 8135 relay-arm.zip
If your response looks like the one above then move on to the next step.
Replace <webSiteName>
below with the CloudRelayWebsite you recorded earlier.
Example Request:
az webapp deployment source config-zip `
--resource-group rg-cloudrelaycompute `
--name dctsdemowebsite `
--src Distech.CloudRelay.API.zip
Example Response:
PS C:\Users\dcts0859\Desktop\Distech-AzureIOT> az webapp deployment source config-zip `
>> --resource-group rg-cloudrelaycompute `
>> --name dctsdemowebsite `
>> --src Distech.CloudRelay.API.zip
Getting scm site credentials for zip deployment
Starting zip deployment. This operation can take a while to complete ...
Deployment endpoint responded with status code 202
{
"active": true,
"author": "N/A",
"author_email": "N/A",
"complete": true,
"deployer": "ZipDeploy",
"end_time": "2020-11-29T01:40:27.331422Z",
"id": "ce169123456789123456789123456789",
"is_readonly": true,
"is_temp": false,
"last_success_end_time": "2020-11-29T01:40:27.331422Z",
"log_url": "https://dctsdemowebsite.scm.azurewebsites.net/api/deployments/latest/log",
"message": "Created via a push deployment",
"progress": "",
"provisioningState": null,
"received_time": "2020-11-29T01:40:20.096497Z",
"site_name": "dctsdemowebsite",
"start_time": "2020-11-29T01:40:25.5513117Z",
"status": 4,
"status_text": "",
"url": "https://dctsdemowebsite.scm.azurewebsites.net/api/deployments/latest"
}
Replace <functionAppName>
below with the CloudRelayFunction you recorded earlier.
Example Request:
az functionapp deployment source config-zip `
--resource-group rg-cloudrelaycompute `
--name <functionAppName> `
--src Distech.CloudRelay.Functions.zip
Example Response:
PS C:\Users\dcts0859\Desktop\Distech-AzureIOT> az functionapp deployment source config-zip `
>> --resource-group rg-cloudrelaycompute `
>> --name dctsdemofunction `
>> --src Distech.CloudRelay.Functions.zip
Setting SCM_DO_BUILD_DURING_DEPLOYMENT to false
Waiting SCM site to be updated with the latest app settings
Getting scm site credentials for zip deployment
Starting zip deployment. This operation can take a while to complete ...
Deployment endpoint responded with status code 202
{
"active": true,
"author": "N/A",
"author_email": "N/A",
"complete": true,
"deployer": "ZipDeploy",
"end_time": "2020-11-29T01:45:59.0317335Z",
"id": "b4238123456789123456789123456789",
"is_readonly": true,
"is_temp": false,
"last_success_end_time": "2020-11-29T01:45:59.0317335Z",
"log_url": "https://dctsdemofunction.scm.azurewebsites.net/api/deployments/latest/log",
"message": "Created via a push deployment",
"progress": "",
"provisioningState": null,
"received_time": "2020-11-29T01:45:52.7079794Z",
"site_name": "dctsdemofunction",
"start_time": "2020-11-29T01:45:53.5986934Z",
"status": 4,
"status_text": "",
"url": "https://dctsdemofunction.scm.azurewebsites.net/api/deployments/latest"
}
The deployent of Distech Controls Cloud Realy to Azure IOT Hub is now complete. Please check back at the wiki or Distech Controls GitHub for updates to the Cloud Relay. Please review Step5-Usage for further information.