IoT Edge : device can't download my module from Azure Container Registry but it can from dockerhub











up vote
0
down vote

favorite












I followed this azure example to develop my module connectedbarmodule in python for Azure IoT Edge. Then , I followed this link to deploy my module in my device (raspberry pi 3). However, my module can't be downloaded. Then, I executed the following command on my device :



sudo docker logs -f edgeAgent


I have the following error:



Error calling Create module ConnectedBarModule:
Get https://iotedgeregistery.azurecr.io/v2/connectedbarmodule/manifests/0.0.1-amd64:
unauthorized: authentication required)


This is an url regarding my Azure Container Registry where the image of my module is stored. I don't know how to get the credentials for iotedge to download my module.



I tested the case to pu the image not in the Azure Container Registry but in my dockerhub account and it works, my device can download the module.



If someone has an idea, this would be very kind.



Thank you in advance.










share|improve this question




























    up vote
    0
    down vote

    favorite












    I followed this azure example to develop my module connectedbarmodule in python for Azure IoT Edge. Then , I followed this link to deploy my module in my device (raspberry pi 3). However, my module can't be downloaded. Then, I executed the following command on my device :



    sudo docker logs -f edgeAgent


    I have the following error:



    Error calling Create module ConnectedBarModule:
    Get https://iotedgeregistery.azurecr.io/v2/connectedbarmodule/manifests/0.0.1-amd64:
    unauthorized: authentication required)


    This is an url regarding my Azure Container Registry where the image of my module is stored. I don't know how to get the credentials for iotedge to download my module.



    I tested the case to pu the image not in the Azure Container Registry but in my dockerhub account and it works, my device can download the module.



    If someone has an idea, this would be very kind.



    Thank you in advance.










    share|improve this question


























      up vote
      0
      down vote

      favorite









      up vote
      0
      down vote

      favorite











      I followed this azure example to develop my module connectedbarmodule in python for Azure IoT Edge. Then , I followed this link to deploy my module in my device (raspberry pi 3). However, my module can't be downloaded. Then, I executed the following command on my device :



      sudo docker logs -f edgeAgent


      I have the following error:



      Error calling Create module ConnectedBarModule:
      Get https://iotedgeregistery.azurecr.io/v2/connectedbarmodule/manifests/0.0.1-amd64:
      unauthorized: authentication required)


      This is an url regarding my Azure Container Registry where the image of my module is stored. I don't know how to get the credentials for iotedge to download my module.



      I tested the case to pu the image not in the Azure Container Registry but in my dockerhub account and it works, my device can download the module.



      If someone has an idea, this would be very kind.



      Thank you in advance.










      share|improve this question















      I followed this azure example to develop my module connectedbarmodule in python for Azure IoT Edge. Then , I followed this link to deploy my module in my device (raspberry pi 3). However, my module can't be downloaded. Then, I executed the following command on my device :



      sudo docker logs -f edgeAgent


      I have the following error:



      Error calling Create module ConnectedBarModule:
      Get https://iotedgeregistery.azurecr.io/v2/connectedbarmodule/manifests/0.0.1-amd64:
      unauthorized: authentication required)


      This is an url regarding my Azure Container Registry where the image of my module is stored. I don't know how to get the credentials for iotedge to download my module.



      I tested the case to pu the image not in the Azure Container Registry but in my dockerhub account and it works, my device can download the module.



      If someone has an idea, this would be very kind.



      Thank you in advance.







      azure-iot-edge azure-container-registry






      share|improve this question















      share|improve this question













      share|improve this question




      share|improve this question








      edited Nov 11 at 18:20

























      asked Nov 11 at 16:51









      Yassir S

      355519




      355519
























          2 Answers
          2






          active

          oldest

          votes

















          up vote
          1
          down vote



          accepted










          Your Azure Container Registry is private. Hence, you need to add the credentials for it in order for the edgeAgent to be download images from private registries:




          • Through the Azure Portal: In the first step of "Set Modules"
            enter image description here


          • When done through deployments in Visual Studio Code:




          "In the VS Code explorer, open the .env file. Update the fields with
          the username and password values that you copied from your Azure
          container registry." (https://docs.microsoft.com/en-us/azure/iot-edge/tutorial-c-module#add-your-registry-credentials)







          share|improve this answer




























            up vote
            1
            down vote













            For your issue, you can use the command docker login -u <ACR username> -p <ACR password> <ACR login server> which shows in the example you posted. About the authentication of Azure Container Registry, there are two ways you can choose.



            One is that use the user and password which shows in your ACR on the Azure portal.



            enter image description here



            Another is that you can use the Azure Service Principal, you can set the permission for the user. Follow document Azure Container Registry authentication with service principals. I would suggest this way much more than the first because it's safer.



            It's just an advice. Hope this will help you and if you need more help please show me the message.






            share|improve this answer





















              Your Answer






              StackExchange.ifUsing("editor", function () {
              StackExchange.using("externalEditor", function () {
              StackExchange.using("snippets", function () {
              StackExchange.snippets.init();
              });
              });
              }, "code-snippets");

              StackExchange.ready(function() {
              var channelOptions = {
              tags: "".split(" "),
              id: "1"
              };
              initTagRenderer("".split(" "), "".split(" "), channelOptions);

              StackExchange.using("externalEditor", function() {
              // Have to fire editor after snippets, if snippets enabled
              if (StackExchange.settings.snippets.snippetsEnabled) {
              StackExchange.using("snippets", function() {
              createEditor();
              });
              }
              else {
              createEditor();
              }
              });

              function createEditor() {
              StackExchange.prepareEditor({
              heartbeatType: 'answer',
              convertImagesToLinks: true,
              noModals: true,
              showLowRepImageUploadWarning: true,
              reputationToPostImages: 10,
              bindNavPrevention: true,
              postfix: "",
              imageUploader: {
              brandingHtml: "Powered by u003ca class="icon-imgur-white" href="https://imgur.com/"u003eu003c/au003e",
              contentPolicyHtml: "User contributions licensed under u003ca href="https://creativecommons.org/licenses/by-sa/3.0/"u003ecc by-sa 3.0 with attribution requiredu003c/au003e u003ca href="https://stackoverflow.com/legal/content-policy"u003e(content policy)u003c/au003e",
              allowUrls: true
              },
              onDemand: true,
              discardSelector: ".discard-answer"
              ,immediatelyShowMarkdownHelp:true
              });


              }
              });














              draft saved

              draft discarded


















              StackExchange.ready(
              function () {
              StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f53250990%2fiot-edge-device-cant-download-my-module-from-azure-container-registry-but-it%23new-answer', 'question_page');
              }
              );

              Post as a guest















              Required, but never shown

























              2 Answers
              2






              active

              oldest

              votes








              2 Answers
              2






              active

              oldest

              votes









              active

              oldest

              votes






              active

              oldest

              votes








              up vote
              1
              down vote



              accepted










              Your Azure Container Registry is private. Hence, you need to add the credentials for it in order for the edgeAgent to be download images from private registries:




              • Through the Azure Portal: In the first step of "Set Modules"
                enter image description here


              • When done through deployments in Visual Studio Code:




              "In the VS Code explorer, open the .env file. Update the fields with
              the username and password values that you copied from your Azure
              container registry." (https://docs.microsoft.com/en-us/azure/iot-edge/tutorial-c-module#add-your-registry-credentials)







              share|improve this answer

























                up vote
                1
                down vote



                accepted










                Your Azure Container Registry is private. Hence, you need to add the credentials for it in order for the edgeAgent to be download images from private registries:




                • Through the Azure Portal: In the first step of "Set Modules"
                  enter image description here


                • When done through deployments in Visual Studio Code:




                "In the VS Code explorer, open the .env file. Update the fields with
                the username and password values that you copied from your Azure
                container registry." (https://docs.microsoft.com/en-us/azure/iot-edge/tutorial-c-module#add-your-registry-credentials)







                share|improve this answer























                  up vote
                  1
                  down vote



                  accepted







                  up vote
                  1
                  down vote



                  accepted






                  Your Azure Container Registry is private. Hence, you need to add the credentials for it in order for the edgeAgent to be download images from private registries:




                  • Through the Azure Portal: In the first step of "Set Modules"
                    enter image description here


                  • When done through deployments in Visual Studio Code:




                  "In the VS Code explorer, open the .env file. Update the fields with
                  the username and password values that you copied from your Azure
                  container registry." (https://docs.microsoft.com/en-us/azure/iot-edge/tutorial-c-module#add-your-registry-credentials)







                  share|improve this answer












                  Your Azure Container Registry is private. Hence, you need to add the credentials for it in order for the edgeAgent to be download images from private registries:




                  • Through the Azure Portal: In the first step of "Set Modules"
                    enter image description here


                  • When done through deployments in Visual Studio Code:




                  "In the VS Code explorer, open the .env file. Update the fields with
                  the username and password values that you copied from your Azure
                  container registry." (https://docs.microsoft.com/en-us/azure/iot-edge/tutorial-c-module#add-your-registry-credentials)








                  share|improve this answer












                  share|improve this answer



                  share|improve this answer










                  answered Nov 12 at 8:37









                  silent

                  9561823




                  9561823
























                      up vote
                      1
                      down vote













                      For your issue, you can use the command docker login -u <ACR username> -p <ACR password> <ACR login server> which shows in the example you posted. About the authentication of Azure Container Registry, there are two ways you can choose.



                      One is that use the user and password which shows in your ACR on the Azure portal.



                      enter image description here



                      Another is that you can use the Azure Service Principal, you can set the permission for the user. Follow document Azure Container Registry authentication with service principals. I would suggest this way much more than the first because it's safer.



                      It's just an advice. Hope this will help you and if you need more help please show me the message.






                      share|improve this answer

























                        up vote
                        1
                        down vote













                        For your issue, you can use the command docker login -u <ACR username> -p <ACR password> <ACR login server> which shows in the example you posted. About the authentication of Azure Container Registry, there are two ways you can choose.



                        One is that use the user and password which shows in your ACR on the Azure portal.



                        enter image description here



                        Another is that you can use the Azure Service Principal, you can set the permission for the user. Follow document Azure Container Registry authentication with service principals. I would suggest this way much more than the first because it's safer.



                        It's just an advice. Hope this will help you and if you need more help please show me the message.






                        share|improve this answer























                          up vote
                          1
                          down vote










                          up vote
                          1
                          down vote









                          For your issue, you can use the command docker login -u <ACR username> -p <ACR password> <ACR login server> which shows in the example you posted. About the authentication of Azure Container Registry, there are two ways you can choose.



                          One is that use the user and password which shows in your ACR on the Azure portal.



                          enter image description here



                          Another is that you can use the Azure Service Principal, you can set the permission for the user. Follow document Azure Container Registry authentication with service principals. I would suggest this way much more than the first because it's safer.



                          It's just an advice. Hope this will help you and if you need more help please show me the message.






                          share|improve this answer












                          For your issue, you can use the command docker login -u <ACR username> -p <ACR password> <ACR login server> which shows in the example you posted. About the authentication of Azure Container Registry, there are two ways you can choose.



                          One is that use the user and password which shows in your ACR on the Azure portal.



                          enter image description here



                          Another is that you can use the Azure Service Principal, you can set the permission for the user. Follow document Azure Container Registry authentication with service principals. I would suggest this way much more than the first because it's safer.



                          It's just an advice. Hope this will help you and if you need more help please show me the message.







                          share|improve this answer












                          share|improve this answer



                          share|improve this answer










                          answered Nov 12 at 9:37









                          Charles Xu

                          2,988126




                          2,988126






























                              draft saved

                              draft discarded




















































                              Thanks for contributing an answer to Stack Overflow!


                              • Please be sure to answer the question. Provide details and share your research!

                              But avoid



                              • Asking for help, clarification, or responding to other answers.

                              • Making statements based on opinion; back them up with references or personal experience.


                              To learn more, see our tips on writing great answers.





                              Some of your past answers have not been well-received, and you're in danger of being blocked from answering.


                              Please pay close attention to the following guidance:


                              • Please be sure to answer the question. Provide details and share your research!

                              But avoid



                              • Asking for help, clarification, or responding to other answers.

                              • Making statements based on opinion; back them up with references or personal experience.


                              To learn more, see our tips on writing great answers.




                              draft saved


                              draft discarded














                              StackExchange.ready(
                              function () {
                              StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f53250990%2fiot-edge-device-cant-download-my-module-from-azure-container-registry-but-it%23new-answer', 'question_page');
                              }
                              );

                              Post as a guest















                              Required, but never shown





















































                              Required, but never shown














                              Required, but never shown












                              Required, but never shown







                              Required, but never shown

































                              Required, but never shown














                              Required, but never shown












                              Required, but never shown







                              Required, but never shown







                              Popular posts from this blog

                              The Sandy Post

                              Danny Elfman

                              Pages that link to "Head v. Amoskeag Manufacturing Co."