Why is the public ip range download blocked?

karolyi 0 Reputation points
2024-05-01T11:40:10.79+00:00

Hey,

I use a script to download the public ip ranges from azure (https://www.microsoft.com/en-us/download/details.aspx?id=56519).

If I view that URL in my browser, it displays and I am able to download the JSON.

However, if I run my script that would emulate a browser and thus download the ip range (because for some reason the public IP list isn't available under a stable URL), my script gets 404.

There seems no way to reach MS with this issue, so I'm trying the only available avenue which is this one. Does anyone have a clue what's going on here, and why is MS/Azure intentionally making the downloading their IP ranges harder?

Azure Data Factory
Azure Data Factory
An Azure service for ingesting, preparing, and transforming data at scale.
9,713 questions
0 comments No comments
{count} votes

3 answers

Sort by: Most helpful
  1. Ben Gimblett 3,580 Reputation points Microsoft Employee
    2024-05-01T16:02:58.44+00:00

    Hi Thanks for the question The Download link is open, for example in PS1 script (apologies a bit clunky - but it proves the point)

    $downloadPage= Invoke-WebRequest -uri "https://www.microsoft.com/en-us/download/confirmation.aspx?id=56519"

     ($downloadPage.Links | Where-Object {$_.href -Like "*download*" -and $_.href -Like "*ServiceTags_Public*" -and $_.href -Like "*.json"}).outerHTML[0]
    
    

    Would give you the anchor with "this months" download link As of just now that would be

    <a href="https://download.microsoft.com/download/7/1/D/71D86715-5596-4529-9B13-DA13A5DE5B63/ServiceTags_Public_20240422.json"><span class="loc" locid="b9cd6c93-1571-f3e9-5a11-d35e3d5b5cad" srcid="b9 cd6c93-1571-f3e9-5a11-d35e3d5b5cad">Click here</span></a>
    

    But a better solution is to use the API which is a lot easier than downloading and parsing the file https://learn.microsoft.com/en-us/azure/virtual-network/service-tags-overview#use-the-service-tag-discovery-api - documented caveats notwithstanding !


  2. karolyi 0 Reputation points
    2024-05-06T10:53:58.07+00:00

    Hello,

    using the confirmation.aspx link instead of details.aspx seems to work — for now.

    I'll open up another issue when it stops working. Thanks for your help.


  3. PRADEEPCHEEKATLA-MSFT 79,141 Reputation points Microsoft Employee
    2024-05-20T07:24:10.3466667+00:00

    @karolyi - I'm glad that you were able to resolve your issue and thank you for posting your solution so that others experiencing the same thing can easily reference this! Since the Microsoft Q&A community has a policy that "The question author cannot accept their own answer. They can only accept answers by others ", I'll repost your solution in case you'd like to accept the answer .

    Ask: Why is the public ip range download blocked?

    Solution: The issue is resolved using the confirmation.aspx link instead of details.aspx seems to work — for now.

    If I missed anything please let me know and I'd be happy to add it to my answer, or feel free to comment below with any additional information.

    If you have any other questions, please let me know. Thank you again for your time and patience throughout this issue.


    Please don’t forget to Accept Answer and Yes for "was this answer helpful" wherever the information provided helps you, this can be beneficial to other community members.

    0 comments No comments