开发者

Why does azure iotedge device can't run edge module image uri , which pulled from azure container registry?(IOTEDGE_WORKLOADURI is required)

Set up : Azure iot edge running on raspberry linux arm32v7. used raspberry pi 4 IoTedge version : iotedge 1.4.3 Signed in to the Azure container registry from the edge device. Built and pushed a custom module to the container registry.Pulled that module image from the Azure container registry and tried to run the module using the docker run <image> command. But it shows an error:

Unhandled exception. System.InvalidOperationException: Environment variable IOTEDGE_WORKLOADURI is required.
   at Microsoft.Azure.Devices.Client.Edge.EdgeModuleClientFactory.CreateInternalClientFromEnvironmentAsync()
   at SampleModuletest.ModuleBackgroundService.ExecuteAsync(CancellationToken cancellationToken) in /app/ModuleBackgroundService.cs:line 23
   at Microsoft.Extensions.Hosting.Internal.Host.StartAsync(CancellationToken cancellationToken)
   at Microsoft.Extensions.Hosting.HostingAbstractionsHostExtensions.RunAsync(IHost host, CancellationToken token)
   at Microsoft.Extensions.Hosting.HostingAbstractionsHostExtensions.RunAsync(IHost host, CancellationToken token)
   at Microsoft.Extensions.Hosting.HostingAbstractionsHostExtensions.Run(IHost host)
   at Program.<Main>$(String[] args) in /app/Program.cs:line 7

output screenshot

Found a post, but it's not the same problem I'm guessing. Outpus is different.

link I have some doubts and if anyone can clear it would be very helpful.

  1. What are the possible methods to deploy azure iot edge modules.

2.Is it possible to deploy a module from an edge device using a pulled module image from container registry? ?

Thanks in advance. Any suggestions would be appreciated.

Currently running edge modules:

NAME             STATUS           DESCRIPTION      Config
edgeAgent        running          Up an hour       mcr.microsoft.com/azureiotedge-agent:1.4
edgeHub          running          Up an hour       mcr.microsoft.com/azureiotedge-hub:1.4

Docker images: Docker images

iotedge check:


```
Configuration checks (aziot-identity-service)
---------------------------------------------
√ keyd configuration is well-formed - OK
√ certd configuration is well-formed - OK
√ tpmd configuration is well-formed - OK
√ identityd configuration is well-formed - OK
√ daemon configurations up-to-date with config.toml - OK
√ identityd config toml file specifies a valid hostname - OK
√ aziot-identity-service package is up-to-date - OK
√ host time is close to reference time - OK
√ preloaded certificates are valid - OK
√ keyd is running - OK
√ certd is running - OK
√ identityd is running - OK
√ read all preloaded certificates from the Certificates Service - OK
√ read all preloaded key pairs from the Keys Service - OK
√ check all EST server URLs utilize HTTPS - OK
√ ensure all preloaded certificates match preloaded private keys with the same ID - OK

Connectivity checks (aziot-identity-service)
--------------------------------------------
√ host can connect to and perform TLS handshake with iothub AMQP port - OK
√ host can connect to and perform TLS handshake with iothub HTTPS / WebSockets port - OK
√ host can connect to and perform TLS handshake with iothub MQTT port - OK

Configuration checks
--------------------
√ aziot-edged configuration is well-formed - OK
√ configuration up-to-date with config.toml - OK
√ container engine is installed and functional - OK
√ configuration has correct URIs for daemon mgmt endpoint - OK
√ aziot-edge package is up-to-date - OK
√ container time is close to host time - OK
√ DNS server - OK
‼ production readiness: logs policy - Warning
    Container engine is not configured to rotate module logs which may cause it run out of disk space.
    Please see https://aka.ms/iotedge-prod-checklist-logs for best practices.
    You can ignore this warning if you are setting log policy per module in the Edge deployment.
‼ production readiness: Edge Agent's storage directory is persisted on the host filesystem - Warning
    The edgeAgent module is not configured to persist its /tmp/edgeAgent directory on the host filesystem.
    Data might be lost if the module is deleted or updated.
    Please see https://aka.ms/iotedge-storage-host for best practices.
‼ production readiness: Edge Hub's storage directory is persisted on the host filesystem - Warning
    The edgeHub module is not configured to persist its /tmp/edgeHub directory on the host filesystem.
    Data might be lost if the module is deleted or updated.
    Please see https://aka.ms/iotedge-storage-host for best practices.
√ Agent image is valid and can be pulled from upstream - OK
√ proxy settings are consistent in aziot-edged, aziot-identityd, moby daemon and config.toml - OK

Connectivity checks
-------------------
√ container on the default network can connect to upstream AMQP port - OK
√ container on the default network can connect to upstream HTTPS / WebSockets port - OK
√ container on the IoT Edge module networ开发者_运维知识库k can connect to upstream AMQP port - OK
√ container on the IoT Edge module network can connect to upstream HTTPS / WebSockets port - OK
32 check(s) succeeded.
3 check(s) raised warnings. Re-run with --verbose for more details.
2 check(s) were skipped due to errors from other checks. Re-run with --verbose for more details.


When you execute the docker run <image> command, it will attempt to spin up your module with no additional configuration. However, you're using the Azure IoT Edge SDK, which requires additional settings. One of those is the IOTEDGE_WORKLOADURI environment variable.

To answer your questions directly:

What are the possible methods to deploy azure iot edge modules.

There's one way of doing this on an Azure IoT Edge device. It's by creating a deployment manifest in your IoT Hub. That deployment manifest will tell the Azure IoT Edge runtime on your device to pull the correct containers and set them up. You can learn how to do that here

Is it possible to deploy a module from an edge device using a pulled module image from container registry?

I'm going to assume you mean on an edge device, not from. You can execute a docker pull command to get the container, but deploying it really needs to happen with the beforementioned deployment manifest.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜