none
403 Forbidden status for preview URL RRS feed

  • Question

  • Hello.

    I am trying to create a Live Event using api v3. I am following this tutorial: docs.microsoft.com/en-us/azure/media-services/latest/stream-live-tutorial-with-api, but I am using the Postman collection.

    When I get to the last step to create the Streaming Locator, I go back to use the preview URL. When I try to access the URL I get the following XML:

    <serverError>
      <status>403</status>
      <code>Forbidden</code>
      <activityId>00000000-0000-0000-0000-000000000000</activityId>
      <serviceId>id...</serviceId>
    </serverError>

    When I try to create the live streaming using the portal, all works fine. But I need to use api v3, because I need to use RTMPS for my application.

    Thanks,


    Monday, July 15, 2019 1:42 PM

Answers

  • Looks like it could be an IP restriction setting on the Preview endpoint. 

    Can you check your accessControl settings on the Preview in your LiveEvent:

    The default looks like this: 

      "accessControl": {
                "ip": {
                  "allow": [
                    {
                      "name": "AllowAll",
                      "address": "0.0.0.0",
                      "subnetPrefixLength": 0
                    }
                  ]
                }
              }

    Monday, July 15, 2019 5:17 PM

All replies

  • Looks like it could be an IP restriction setting on the Preview endpoint. 

    Can you check your accessControl settings on the Preview in your LiveEvent:

    The default looks like this: 

      "accessControl": {
                "ip": {
                  "allow": [
                    {
                      "name": "AllowAll",
                      "address": "0.0.0.0",
                      "subnetPrefixLength": 0
                    }
                  ]
                }
              }

    Monday, July 15, 2019 5:17 PM
  • Hi.

    I allow all to connect. I use the PUT endpoint: 

    https://management.azure.com/subscriptions/:subscriptionId/resourceGroups/:resourceGroupName/providers/Microsoft.Media/mediaservices/:accountName/liveEvents/:liveEventName?api-version={{api-version}}&autoStart={{autoStart}}

    I send:

    {
        "location": "{{location}}",
        "properties": {
            "description": "Simple Live Event using RTMP with 2-second keyframe interval and no ip restriction",
            "vanityUrl": true,
            "streamOptions": [
                "LowLatency"
            ],
            "input": {
                "streamingProtocol": "RTMP",
                "accessToken": "3075cc04-62ab-4b37-9a4e-70fdb4521458",
                "keyFrameIntervalDuration": "PT2S",
                "accessControl": {
                    "ip": {
                        "allow": [{
                            "name": "AllowAll",
                            "address": "0.0.0.0",
                            "subnetPrefixLength": 0
                        }]
                    }
                }
            },
            "preview": {
                "accessControl": {
                    "ip": {
                        "allow": [{
                            "name": "AllowAll",
                            "address": "0.0.0.0"
                        }]
                    }
                }
            },
            "encoding": {
                "encodingType": "None",
                "presetName": ""
            }
        }
    }

    Tuesday, July 16, 2019 1:20 AM
  • Hello John.

    I checked again your answer and I see that I missed the "subnetPrefixLength" inside the accessControl of the preview key. When I set this, the video started to play using RTMPS as the api v3 says.

    Thank you for your help.

    Friday, July 19, 2019 9:54 PM
  • Fantastic! Thanks Juan!

    Let me know if you need any more support.  Thanks for using Azure!

    -John D

    Friday, July 19, 2019 9:57 PM