Azure Media Services, GetLocators with V3 api and ODataQueryAzure media service asset managementWindows Azure Media servicesStreaming with Azure media servicesComplete Sample of video Creation and on demand token issuance in Azure Media ServicesUsing Azure data factory with Odata source from Microsoft Dynamics MarketingAzure Media Services DRM Integration With 3rd Party Unified Streaming ServerAzure Media Services Status DisconnectedSitecore 9 Azure Paas deploymentAzure HDInsight with ADL created by REST APIAzure Media Service REST API error MissingApiVersionParameter

How to install cross-compiler on Ubuntu 18.04?

Rotate ASCII Art by 45 Degrees

How exploitable/balanced is this homebrew spell: Spell Permanency?

How could indestructible materials be used in power generation?

Getting extremely large arrows with tikzcd

How can I deal with my CEO asking me to hire someone with a higher salary than me, a co-founder?

How to travel to Japan while expressing milk?

How to coordinate airplane tickets?

Is it possible to create a QR code using text?

Can I hook these wires up to find the connection to a dead outlet?

Calculate the Mean mean of two numbers

How obscure is the use of 令 in 令和?

Is it "common practice in Fourier transform spectroscopy to multiply the measured interferogram by an apodizing function"? If so, why?

Am I breaking OOP practice with this architecture?

Is this draw by repetition?

How to show a landlord what we have in savings?

How do I exit BASH while loop using modulus operator?

Pact of Blade Warlock with Dancing Blade

How badly should I try to prevent a user from XSSing themselves?

Why was Sir Cadogan fired?

Send out email when Apex Queueable fails and test it

Forgetting the musical notes while performing in concert

Why do I get negative height?

What is a Samsaran Word™?



Azure Media Services, GetLocators with V3 api and ODataQuery


Azure media service asset managementWindows Azure Media servicesStreaming with Azure media servicesComplete Sample of video Creation and on demand token issuance in Azure Media ServicesUsing Azure data factory with Odata source from Microsoft Dynamics MarketingAzure Media Services DRM Integration With 3rd Party Unified Streaming ServerAzure Media Services Status DisconnectedSitecore 9 Azure Paas deploymentAzure HDInsight with ADL created by REST APIAzure Media Service REST API error MissingApiVersionParameter













2















I am trying to get all the streaming locators for a given asset using the v3 API and the Microsoft.Azure.Management.Media package but I am getting a bad request error using Odata Queries:



It fails on this line: var locator = client.StreamingLocators.List("webinars", "webinars", new ODataQuery<StreamingLocator>(x=>x.AssetName == assetId));



Microsoft.Azure.Management.Media.Models.ApiErrorException: Operation returned an invalid status code 'BadRequest'


When I use it without the ODataQuery, it returns fine.



public IList<string> GetLocatorForAsset() 
var assetId = "bb4953cf-4793-4b3c-aed8-ae1bec88a339";
IList<string> streamingUrls = new List<string>();

var locator = client.StreamingLocators.List("webinars", "webinars", new ODataQuery<StreamingLocator>(x=>x.AssetName == assetId));
ListPathsResponse paths = client.StreamingLocators.ListPaths("webinars", "webinars", locator.FirstOrDefault().Name);

foreach (StreamingPath path in paths.StreamingPaths)
UriBuilder uriBuilder = new UriBuilder();
uriBuilder.Scheme = "https";
uriBuilder.Host = "webinars-use2.streaming.media.azure.net";

uriBuilder.Path = path.Paths[0];
streamingUrls.Add(uriBuilder.ToString());


return streamingUrls;


}









share|improve this question
























  • Hello, Has this posted answer resolved any questions for you?

    – Rahul Ruikar
    Mar 24 at 1:46















2















I am trying to get all the streaming locators for a given asset using the v3 API and the Microsoft.Azure.Management.Media package but I am getting a bad request error using Odata Queries:



It fails on this line: var locator = client.StreamingLocators.List("webinars", "webinars", new ODataQuery<StreamingLocator>(x=>x.AssetName == assetId));



Microsoft.Azure.Management.Media.Models.ApiErrorException: Operation returned an invalid status code 'BadRequest'


When I use it without the ODataQuery, it returns fine.



public IList<string> GetLocatorForAsset() 
var assetId = "bb4953cf-4793-4b3c-aed8-ae1bec88a339";
IList<string> streamingUrls = new List<string>();

var locator = client.StreamingLocators.List("webinars", "webinars", new ODataQuery<StreamingLocator>(x=>x.AssetName == assetId));
ListPathsResponse paths = client.StreamingLocators.ListPaths("webinars", "webinars", locator.FirstOrDefault().Name);

foreach (StreamingPath path in paths.StreamingPaths)
UriBuilder uriBuilder = new UriBuilder();
uriBuilder.Scheme = "https";
uriBuilder.Host = "webinars-use2.streaming.media.azure.net";

uriBuilder.Path = path.Paths[0];
streamingUrls.Add(uriBuilder.ToString());


return streamingUrls;


}









share|improve this question
























  • Hello, Has this posted answer resolved any questions for you?

    – Rahul Ruikar
    Mar 24 at 1:46













2












2








2








I am trying to get all the streaming locators for a given asset using the v3 API and the Microsoft.Azure.Management.Media package but I am getting a bad request error using Odata Queries:



It fails on this line: var locator = client.StreamingLocators.List("webinars", "webinars", new ODataQuery<StreamingLocator>(x=>x.AssetName == assetId));



Microsoft.Azure.Management.Media.Models.ApiErrorException: Operation returned an invalid status code 'BadRequest'


When I use it without the ODataQuery, it returns fine.



public IList<string> GetLocatorForAsset() 
var assetId = "bb4953cf-4793-4b3c-aed8-ae1bec88a339";
IList<string> streamingUrls = new List<string>();

var locator = client.StreamingLocators.List("webinars", "webinars", new ODataQuery<StreamingLocator>(x=>x.AssetName == assetId));
ListPathsResponse paths = client.StreamingLocators.ListPaths("webinars", "webinars", locator.FirstOrDefault().Name);

foreach (StreamingPath path in paths.StreamingPaths)
UriBuilder uriBuilder = new UriBuilder();
uriBuilder.Scheme = "https";
uriBuilder.Host = "webinars-use2.streaming.media.azure.net";

uriBuilder.Path = path.Paths[0];
streamingUrls.Add(uriBuilder.ToString());


return streamingUrls;


}









share|improve this question
















I am trying to get all the streaming locators for a given asset using the v3 API and the Microsoft.Azure.Management.Media package but I am getting a bad request error using Odata Queries:



It fails on this line: var locator = client.StreamingLocators.List("webinars", "webinars", new ODataQuery<StreamingLocator>(x=>x.AssetName == assetId));



Microsoft.Azure.Management.Media.Models.ApiErrorException: Operation returned an invalid status code 'BadRequest'


When I use it without the ODataQuery, it returns fine.



public IList<string> GetLocatorForAsset() 
var assetId = "bb4953cf-4793-4b3c-aed8-ae1bec88a339";
IList<string> streamingUrls = new List<string>();

var locator = client.StreamingLocators.List("webinars", "webinars", new ODataQuery<StreamingLocator>(x=>x.AssetName == assetId));
ListPathsResponse paths = client.StreamingLocators.ListPaths("webinars", "webinars", locator.FirstOrDefault().Name);

foreach (StreamingPath path in paths.StreamingPaths)
UriBuilder uriBuilder = new UriBuilder();
uriBuilder.Scheme = "https";
uriBuilder.Host = "webinars-use2.streaming.media.azure.net";

uriBuilder.Path = path.Paths[0];
streamingUrls.Add(uriBuilder.ToString());


return streamingUrls;


}






c# azure azure-media-services






share|improve this question















share|improve this question













share|improve this question




share|improve this question








edited Mar 7 at 22:00







Chris Kooken

















asked Mar 7 at 21:02









Chris KookenChris Kooken

22.6k1172106




22.6k1172106












  • Hello, Has this posted answer resolved any questions for you?

    – Rahul Ruikar
    Mar 24 at 1:46

















  • Hello, Has this posted answer resolved any questions for you?

    – Rahul Ruikar
    Mar 24 at 1:46
















Hello, Has this posted answer resolved any questions for you?

– Rahul Ruikar
Mar 24 at 1:46





Hello, Has this posted answer resolved any questions for you?

– Rahul Ruikar
Mar 24 at 1:46












1 Answer
1






active

oldest

votes


















1





+100









As per media services filtering documentation, user can filter "Streaming Locators" only by "name", "properties.created" and "properties.endTime".



https://docs.microsoft.com/en-us/azure/media-services/latest/entities-overview#streaming-locators



enter image description here



In your example, you are trying to filter using assetId/assetName which is not supported. hence 400 Bad request error. see detailed error example in postman



enter image description here



Here is the valid filtering example using Streaming Locator "name" tag.



NOTE : This is not an asset Tag



enter image description here



C# example used to successfully filter streaming locator using "name"



 try

// GUID need to be specified in single quote. using OData v 3.0
var odataquery = new ODataQuery<StreamingLocator>("name eq '65a1cb0d-ce7c-4470-93ac-fedf66450ea0'");
IPage<StreamingLocator> locators = client.StreamingLocators.List("mediatest", "mymediatestaccount", odataquery);

Console.WriteLine(locators.FirstOrDefault().Name);
Console.WriteLine(locators.FirstOrDefault().StreamingLocatorId);
Console.WriteLine(locators.FirstOrDefault().Id);

ListPathsResponse paths = client.StreamingLocators.ListPaths("mediatest", "mymediatestaccount", locators.FirstOrDefault().Name);

foreach (StreamingPath path in paths.StreamingPaths)

UriBuilder uriBuilder = new UriBuilder();
uriBuilder.Scheme = "https";
uriBuilder.Host = "webinars-use2.streaming.media.azure.net";

uriBuilder.Path = path.Paths[0];
Console.WriteLine(uriBuilder.ToString());


catch (Exception ex)

Console.WriteLine(ex.ToString());



I hope this helps.






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',
    autoActivateHeartbeat: false,
    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%2f55052728%2fazure-media-services-getlocators-with-v3-api-and-odataquery%23new-answer', 'question_page');

    );

    Post as a guest















    Required, but never shown

























    1 Answer
    1






    active

    oldest

    votes








    1 Answer
    1






    active

    oldest

    votes









    active

    oldest

    votes






    active

    oldest

    votes









    1





    +100









    As per media services filtering documentation, user can filter "Streaming Locators" only by "name", "properties.created" and "properties.endTime".



    https://docs.microsoft.com/en-us/azure/media-services/latest/entities-overview#streaming-locators



    enter image description here



    In your example, you are trying to filter using assetId/assetName which is not supported. hence 400 Bad request error. see detailed error example in postman



    enter image description here



    Here is the valid filtering example using Streaming Locator "name" tag.



    NOTE : This is not an asset Tag



    enter image description here



    C# example used to successfully filter streaming locator using "name"



     try

    // GUID need to be specified in single quote. using OData v 3.0
    var odataquery = new ODataQuery<StreamingLocator>("name eq '65a1cb0d-ce7c-4470-93ac-fedf66450ea0'");
    IPage<StreamingLocator> locators = client.StreamingLocators.List("mediatest", "mymediatestaccount", odataquery);

    Console.WriteLine(locators.FirstOrDefault().Name);
    Console.WriteLine(locators.FirstOrDefault().StreamingLocatorId);
    Console.WriteLine(locators.FirstOrDefault().Id);

    ListPathsResponse paths = client.StreamingLocators.ListPaths("mediatest", "mymediatestaccount", locators.FirstOrDefault().Name);

    foreach (StreamingPath path in paths.StreamingPaths)

    UriBuilder uriBuilder = new UriBuilder();
    uriBuilder.Scheme = "https";
    uriBuilder.Host = "webinars-use2.streaming.media.azure.net";

    uriBuilder.Path = path.Paths[0];
    Console.WriteLine(uriBuilder.ToString());


    catch (Exception ex)

    Console.WriteLine(ex.ToString());



    I hope this helps.






    share|improve this answer



























      1





      +100









      As per media services filtering documentation, user can filter "Streaming Locators" only by "name", "properties.created" and "properties.endTime".



      https://docs.microsoft.com/en-us/azure/media-services/latest/entities-overview#streaming-locators



      enter image description here



      In your example, you are trying to filter using assetId/assetName which is not supported. hence 400 Bad request error. see detailed error example in postman



      enter image description here



      Here is the valid filtering example using Streaming Locator "name" tag.



      NOTE : This is not an asset Tag



      enter image description here



      C# example used to successfully filter streaming locator using "name"



       try

      // GUID need to be specified in single quote. using OData v 3.0
      var odataquery = new ODataQuery<StreamingLocator>("name eq '65a1cb0d-ce7c-4470-93ac-fedf66450ea0'");
      IPage<StreamingLocator> locators = client.StreamingLocators.List("mediatest", "mymediatestaccount", odataquery);

      Console.WriteLine(locators.FirstOrDefault().Name);
      Console.WriteLine(locators.FirstOrDefault().StreamingLocatorId);
      Console.WriteLine(locators.FirstOrDefault().Id);

      ListPathsResponse paths = client.StreamingLocators.ListPaths("mediatest", "mymediatestaccount", locators.FirstOrDefault().Name);

      foreach (StreamingPath path in paths.StreamingPaths)

      UriBuilder uriBuilder = new UriBuilder();
      uriBuilder.Scheme = "https";
      uriBuilder.Host = "webinars-use2.streaming.media.azure.net";

      uriBuilder.Path = path.Paths[0];
      Console.WriteLine(uriBuilder.ToString());


      catch (Exception ex)

      Console.WriteLine(ex.ToString());



      I hope this helps.






      share|improve this answer

























        1





        +100







        1





        +100



        1




        +100





        As per media services filtering documentation, user can filter "Streaming Locators" only by "name", "properties.created" and "properties.endTime".



        https://docs.microsoft.com/en-us/azure/media-services/latest/entities-overview#streaming-locators



        enter image description here



        In your example, you are trying to filter using assetId/assetName which is not supported. hence 400 Bad request error. see detailed error example in postman



        enter image description here



        Here is the valid filtering example using Streaming Locator "name" tag.



        NOTE : This is not an asset Tag



        enter image description here



        C# example used to successfully filter streaming locator using "name"



         try

        // GUID need to be specified in single quote. using OData v 3.0
        var odataquery = new ODataQuery<StreamingLocator>("name eq '65a1cb0d-ce7c-4470-93ac-fedf66450ea0'");
        IPage<StreamingLocator> locators = client.StreamingLocators.List("mediatest", "mymediatestaccount", odataquery);

        Console.WriteLine(locators.FirstOrDefault().Name);
        Console.WriteLine(locators.FirstOrDefault().StreamingLocatorId);
        Console.WriteLine(locators.FirstOrDefault().Id);

        ListPathsResponse paths = client.StreamingLocators.ListPaths("mediatest", "mymediatestaccount", locators.FirstOrDefault().Name);

        foreach (StreamingPath path in paths.StreamingPaths)

        UriBuilder uriBuilder = new UriBuilder();
        uriBuilder.Scheme = "https";
        uriBuilder.Host = "webinars-use2.streaming.media.azure.net";

        uriBuilder.Path = path.Paths[0];
        Console.WriteLine(uriBuilder.ToString());


        catch (Exception ex)

        Console.WriteLine(ex.ToString());



        I hope this helps.






        share|improve this answer













        As per media services filtering documentation, user can filter "Streaming Locators" only by "name", "properties.created" and "properties.endTime".



        https://docs.microsoft.com/en-us/azure/media-services/latest/entities-overview#streaming-locators



        enter image description here



        In your example, you are trying to filter using assetId/assetName which is not supported. hence 400 Bad request error. see detailed error example in postman



        enter image description here



        Here is the valid filtering example using Streaming Locator "name" tag.



        NOTE : This is not an asset Tag



        enter image description here



        C# example used to successfully filter streaming locator using "name"



         try

        // GUID need to be specified in single quote. using OData v 3.0
        var odataquery = new ODataQuery<StreamingLocator>("name eq '65a1cb0d-ce7c-4470-93ac-fedf66450ea0'");
        IPage<StreamingLocator> locators = client.StreamingLocators.List("mediatest", "mymediatestaccount", odataquery);

        Console.WriteLine(locators.FirstOrDefault().Name);
        Console.WriteLine(locators.FirstOrDefault().StreamingLocatorId);
        Console.WriteLine(locators.FirstOrDefault().Id);

        ListPathsResponse paths = client.StreamingLocators.ListPaths("mediatest", "mymediatestaccount", locators.FirstOrDefault().Name);

        foreach (StreamingPath path in paths.StreamingPaths)

        UriBuilder uriBuilder = new UriBuilder();
        uriBuilder.Scheme = "https";
        uriBuilder.Host = "webinars-use2.streaming.media.azure.net";

        uriBuilder.Path = path.Paths[0];
        Console.WriteLine(uriBuilder.ToString());


        catch (Exception ex)

        Console.WriteLine(ex.ToString());



        I hope this helps.







        share|improve this answer












        share|improve this answer



        share|improve this answer










        answered Mar 21 at 15:13









        Rahul RuikarRahul Ruikar

        73127




        73127





























            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.




            draft saved


            draft discarded














            StackExchange.ready(
            function ()
            StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f55052728%2fazure-media-services-getlocators-with-v3-api-and-odataquery%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

            AWS Lex not identifying response if by a variable The 2019 Stack Overflow Developer Survey Results Are In Announcing the arrival of Valued Associate #679: Cesar Manara Planned maintenance scheduled April 17/18, 2019 at 00:00UTC (8:00pm US/Eastern) The Ask Question Wizard is Live! Data science time! April 2019 and salary with experienceEnforcing custom enumeration in AWS LEX for slot valuesHow to give response based on user response in Amazon Lex?Intercepting AWS Lambda Response to a AWS Lex QueryLex chat bot error: Reached second execution of fulfillment lambda on the same utteranceamazon lex showing invalid responseLambda response send back to Lex slot?Response card in Amazon lexAmazon Lex - Lambda response return HTML to botHow can I solve 424 (Failed Dependency) (python) obtained from Amazon lex?

            Алба-Юлія

            Захаров Федір Захарович