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
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#
add a comment |
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#
Hello, Has this posted answer resolved any questions for you?
– Rahul Ruikar
Mar 24 at 1:46
add a comment |
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#
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#
c#
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
add a comment |
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
add a comment |
1 Answer
1
active
oldest
votes
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

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

Here is the valid filtering example using Streaming Locator "name" tag.
NOTE : This is not an asset Tag

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.
add a comment |
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
);
);
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
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
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

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

Here is the valid filtering example using Streaming Locator "name" tag.
NOTE : This is not an asset Tag

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.
add a comment |
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

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

Here is the valid filtering example using Streaming Locator "name" tag.
NOTE : This is not an asset Tag

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.
add a comment |
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

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

Here is the valid filtering example using Streaming Locator "name" tag.
NOTE : This is not an asset Tag

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.
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

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

Here is the valid filtering example using Streaming Locator "name" tag.
NOTE : This is not an asset Tag

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.
answered Mar 21 at 15:13
Rahul RuikarRahul Ruikar
73127
73127
add a comment |
add a comment |
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.
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
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
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
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
Hello, Has this posted answer resolved any questions for you?
– Rahul Ruikar
Mar 24 at 1:46