Share via

How to use direct method to deploy modules on devices and set environment variables and createOptions in java

Madanala, Jayashree 156 Reputation points
2022-03-21T13:13:04.01+00:00

Hi team,

What is the direct method to deploy custom modules and how to set environment variables and createOptions
Please give the examples and reference.

Also the below maven repo does not not have the direct method classes com.microsoft.azure.sdk.iot.service.methods

<dependency>
  <groupId>com.microsoft.azure.sdk.iot</groupId>
  <artifactId>iot-service-client</artifactId>
  <version>1.34.2</version>
</dependency>
Azure IoT Edge
Azure IoT Edge

An Azure service that is used to deploy cloud workloads to run on internet of things (IoT) edge devices via standard containers.

Azure IoT Hub
Azure IoT Hub

An Azure service that enables bidirectional communication between internet of things (IoT) devices and applications.

Azure IoT SDK
Azure IoT SDK

An Azure software development kit that facilitates building applications that connect to Azure IoT services.

0 comments No comments

1 answer

Sort by: Most helpful
  1. António Sérgio Azevedo 7,671 Reputation points Microsoft Employee Moderator
    2022-03-21T17:25:44.533+00:00

    Hello @Madanala, Jayashree ,
    You can Use Visual Studio Code to develop and debug modules for Azure IoT Edge - written in C#, Node.js, or Java.

    You will use a deployment manifest to tell your device which modules to install and how to configure them to work together. In that deployment manifest you can setup the createOptions and Environment variables values. See a Deployment manifest example.

    Then you Deploy Azure IoT Edge modules from the Azure portal.

    Also the below maven repo does not not have the direct method classes com.microsoft.azure.sdk.iot.service.methods

    This will be available in Java SDK v2 only. Use:

    <dependency>  
      <groupId>com.microsoft.azure.sdk.iot</groupId>  
      <artifactId>iot-service-client</artifactId>  
      <version>2.0.0-preview-002</version>  
    </dependency>  
    

    From Comments below:

    Also I need to deploy deployment manifest file through java code. can you provide the java code snippet.

    As far as I am aware, you can't do it using java service SDK. You can use Azure Portal, Azure CLI or Visual Studio Code.

    Thank you!

    Remember:

    • Please accept an answer if correct. Original posters help the community find answers faster by identifying the correct answer. Here is how.
    • Want a reminder to come back and check responses? Here is how to subscribe to a notification.

    Was this answer helpful?


Your answer

Answers can be marked as 'Accepted' by the question author and 'Recommended' by moderators, which helps users know the answer solved the author's problem.