Not getting a usable URL from curl -X POST cmdlet

Wesley Sherwood 50 Reputation points
2024-02-08T22:29:18.1933333+00:00

So I am working through "AZ-104: Implement and manage storage in Azure," and I am stuck on the exercise portion of the "Control access to Azure Storage with shared access signatures" module.

I've run all the commands and setup the JSON as directed, but when I run the "curl -X POST http://localhost:8888/openPort/8000;" cmdlet I only get cd sasopen","url":"https://ux.console.azure.com//proxy/8000/" as a result.

I am unable to progress through the next section after running the "cd sas dotnet run" cmdlet since I don't have a proper url.

I was getting a "there are no credentials provided in your command" when creating a storage container and blob. Would that be why I'm having this issue? How do I correct this issue to finish the section?

Azure Azure Training
{count} votes

Accepted answer
  1. TP 124.7K Reputation points Volunteer Moderator
    2024-02-14T02:16:17.5+00:00

    Hi Wesley,

    Unfortunately Web Preview for Azure Cloud Shell (this is underlying feature for step #10) seems to be broken. I tested it using method in the exercise as well as using the GUI, using sandbox as well as paid subscription, and it doesn't work in any case. I've tested several times over multiple days since you asked your question.

    If you would like you could use ngrok (third party tool that does same thing) instead. To sign up for their free level account you only need to give name, email, and then confirm email account by clicking link. To use it instead of Web Preview it takes about 10-30 seconds to install in Cloud Shell and then you would be ready to use it for Step#10 of the exercise.

    I'm putting together steps/screenshots to use ngrok instead of Web Preview as a substitute for step#10 until Web Preview functionality is fixed.

    If you don't want to use third party tool then I recommend reading over the exercise and making sure you understand what each step is supposed to do for learning purposes. If you have any questions in this regard add a comment below and I would be happy to explain what is going on.

    Please click Accept Answer and upvote if the above was helpful. Please add a comment if anything is unclear.

    Thanks.

    -TP

    6 people found this answer helpful.

4 additional answers

Sort by: Most helpful
  1. Reen Ahmed Aboelanain 5 Reputation points
    2024-03-26T11:30:01.2733333+00:00

    I can't choose the answer please help me

    1 person found this answer helpful.

  2. Govindan Kutty L R 10 Reputation points
    2024-08-16T12:46:29.9233333+00:00

    Thanks for the inputs to try the exercise with ngrok and could get through. The steps i followed is as below from Step 10 of the instructions:

    a) download ngrok - wget https://bin.equinox.io/c/bNyj1mQVY4c/ngrok-v3-stable-linux-amd64.tgz

    b) extract - tar xvzf ngrok-v3-stable-linux-amd64.tgz

    c) you have to signup for an account in ngrok.com - https://dashboard.ngrok.com/signup

    d) Login and collect your authtoken, copy the same and execute on your cloudshell prompt - ngrok config add-authtoken $YOUR_AUTHTOKEN

    e) execute ./ngrok http 8000 and note the URL mentioned against "Forwarding"

    f) in another cloudshell you need to run the code as mentioned in Step 11 - ./dotnet run

    g) Open a browser window and paste the URL as in the step (e) above

    This worked for me.

    1 person found this answer helpful.
    0 comments No comments

  3. Rajesh Mulapulli 0 Reputation points
    2024-02-09T20:33:07.7166667+00:00

    I am working through the same in the az104 learning path - 'Exercise - Use shared access signatures to delegate access to Azure Storage'. I get the same error as mentioned by Wesley. Below are the details.
    When i issue the command 'curl -X POST http://localhost:8888/openPort/8000;', I get the below response. {"message":"Port 8000 is open","url":"https://ux.console.azure.com//proxy/8000/"} This url is not reachable (using browser) after starting the web application using the command dotnet run


  4. AmaranS 7,270 Reputation points Microsoft External Staff
    2024-02-12T07:57:34.9366667+00:00

    Hi Wesley Sherwood,

    Thank you for reaching out to Microsoft Q&A forum.

    It seems like you're trying to create a Shared Access Signature (SAS) for an Azure Storage resource and access it locally using a port forwarding mechanism.   

    Let's break down the steps and see if we can identify the issue:  

    1.Check your SAS token creation to ensure it's done correctly and has the necessary permissions.

    2.Confirm your port forwarding setup to make sure it's directing traffic to your Azure service, not a proxy.

    3.If you're getting a credential error, double-check that you're logged into Azure and have the right permissions.

    4.Retry your commands and pay attention to any error messages for clues.

    Please inform us if the problem persists, and we'll be happy to offer further assistance.

    If the provided solution has helped in resolving the issue, please consider accepting it by clicking on the "Accept answer" button to enhance visibility of this question for other members of the Microsoft Q&A community.

    Thank you.


Your answer

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