GithubHelp home page GithubHelp logo

Comments (5)

YingXue avatar YingXue commented on May 29, 2024

This error looks like it is not able to find the verifiation certificate from the path provided. Can you try verify if the --path provided is valid maybe (.\ instead of ./ ) or try to provide a full path.
If you encountered futher errors, you can also try to verify the cert from the UI and see if works for comparison: https://docs.microsoft.com/en-us/azure/iot-dps/how-to-verify-certificates

from azure-iot-cli-extension.

mikermesh avatar mikermesh commented on May 29, 2024

@YingXue

Thanks for the reply. The verification via the Portal with the same certificate works successfully. However, I am trying to upload the verification cert programmatically using the azure cli.

If I enter an invalid path or filename, I get a different error "Errno 2] No such file or directory:". I've found that the "Operation returned an invalid status code 'Not Found'" is usually associated with an invalid eTag.

One thing I've noticed is that the create and generate-verification-code commands result in different eTags. Here is the process below.

  1. Issue az iot dps certificate create command and receive eTag.
  2. Issue az iot dps certificate generate-verification-code command with eTag from Step #1.
  3. This generates the Verification Code and an updated eTag.
  4. Issue az iot dps certificate verify with a.) Verification Cert signed up uploaded cert and b.) updated etag from Step #3.

from azure-iot-cli-extension.

YingXue avatar YingXue commented on May 29, 2024

Hi @mikermesh, the work flow that you've provided here is correct, though I also tried it myself, and find it working for me:

  1. az iot dps certificate create --dps-name yingtest -g yingtest --name testcert -p ./testcert.cer
    where i got etag AAAAAAAyIyo=
  2. az iot dps certificate generate-verification-code --dps-name yingtest -g yingtest --name testcert --etag AAAAAAAyIyo=
    where i got etag AAAAAAAyIzo=
  3. az iot dps certificate verify --dps-name yingtest -g yingtest --name testcert -p ./verify.cer --etag AAAAAAAyIzo=
    Not sure if you are doing anything different here?

For your reference, I have written some tests related to these command before, where you may find it helpful: https://github.com/Azure/azure-cli/blob/dev/src/command_modules/azure-cli-iot/azure/cli/command_modules/iot/tests/latest/test_iot_dps_commands.py (starting from line 87). There are several helper functions in the same folder, regarding to create testcert.cer and verify.cert

from azure-iot-cli-extension.

YingXue avatar YingXue commented on May 29, 2024

I guess the problem might be az iot dps certificate verify --dps-name "$dpsName" --resource-group "$resourceGroup" --name VerifyCert --path ./Verification.cer --etag AAAAAAAAAAA= where --name should be the name of the same name in the first step. I could be wrong, as I am purely guessing judging the name of the cert you provided here :)

from azure-iot-cli-extension.

mikermesh avatar mikermesh commented on May 29, 2024

@YingXue You are 100% right...my command wasn't passing in the same cert name as step#1. I updated my script and it is working now. I'm closing the issue. Thanks for your help!

from azure-iot-cli-extension.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.