Create a cloud deployment for test
Cloud-based deployment delivers an application through a deployment assigned to a device group within the target product. Testing deployment is an important part of the application development process; Azure Sphere provides a Field Test device group that can be used for this purpose.
Prerequisites
- Your Azure Sphere device is connected to your computer and to the internet.
- You have built a high-level or real-time capable application and retained the image package for the application.
- You have a target product.
Enable cloud-based deployment for your device
Before you test the cloud-based deployment process, your Azure Sphere device must be ready to accept cloud-based application updates. Use the azsphere device enable-cloud-test command to prepare your device:
azsphere device enable-cloud-test --product "MyProduct"
This command:
- Identifies the device as the MyProduct model.
- Assigns the device to the Field Test device group, which enables cloud-based application updates.
- Disables the ability for the SDK to load applications onto the device, so that only cloud-based applications can be loaded.
The Azure Sphere Security Service uses the device group and the product to determine whether to update the application on a device.
Create the deployment
A deployment is a set of images that can be deployed from the Azure Sphere cloud service to the devices within a particular device group.
To create a deployment:
Upload the image package:
azsphere image add --image <path-to-image>Create a new deployment for a device group:
azsphere device-group deployment create --device-group <device-group-ID> --images <image-ID>or
azsphere device-group deployment create --device-group '<product-name>/<device-group-name>' --images <image-ID>
To provide multiple values for --images enter a list of values separated by spaces.
The --device-group parameter identifies the device group. The device group ID supplies a GUID, which uniquely identifies the device group across all products. Alternatively, you can use the product name and device group name pair in the <product-name>/<device-group-name> format. This pair of names uniquely identifies a device group for a particular product.
Specify the Field Test device group and the name of the target product.
Replace <image-ID> with the image ID of the image package. See azsphere device-group deployment create for information on getting the image ID.
To verify that the deployment is set up, use the azsphere device image list-targeted command.
Trigger the deployment
The previous steps set up all the required deployment elements. To trigger the download immediately, press the Reset button on the Azure Sphere device. The application should download and start within several minutes.
To verify that the application was installed on your device, use the azsphere device image list-installed command. You may not see the results of the deployment immediately. If the deployment is not listed when you run the command, try again in a few minutes.
Reenable development and debugging
As you continue to develop and test applications, you will probably want to sideload them until you're ready to deploy them more broadly. To reverse the azsphere device enable-cloud-test command and enable the device for development and debugging, use azsphere device enable-development:
azsphere device enable-development
This command assigns the device to the default Development device group for its product and adds the device capability to accept applications for debugging. The Development device group does not enable cloud-loading of applications.
الملاحظات
إرسال الملاحظات وعرضها المتعلقة بـ