Skip to main content
cancel
Showing results for 
Search instead for 
Did you mean: 

Register now to learn Fabric in free live sessions led by the best Microsoft experts. From Apr 16 to May 9, in English and Spanish.

Reply
Anonymous
Not applicable

Cluster API from azure marketplace

 

When trying to consume Cluster API from data marketplace azure api I receive an error below. Please could you advice>

 

 

Unexpected error: Exception of type 'Microsoft.Mashup.Engine1.Library.OData.V3.ODataFoldingException' was thrown.
Details:
    Microsoft.Mashup.Evaluator.Interface.ErrorException: Exception of type 'Microsoft.Mashup.Engine1.Library.OData.V3.ODataFoldingException' was thrown. ---> Microsoft.Mashup.Engine1.Library.OData.V3.ODataFoldingException: Exception of type 'Microsoft.Mashup.Engine1.Library.OData.V3.ODataFoldingException' was thrown. ---> Microsoft.Mashup.Engine1.Library.OData.V3.ODataFoldingException: Exception of type 'Microsoft.Mashup.Engine1.Library.OData.V3.ODataFoldingException' was thrown. ---> Microsoft.Mashup.Engine1.Runtime.ValueException: [DataSource.Error] The query on the OData source is too long to fold into a valid OData query URI.
   --- End of inner exception stack trace ---
   at Microsoft.Mashup.Engine1.Library.OData.V3.ODataValueBuilder.get_RequestUris()
   at Microsoft.Mashup.Engine1.Library.OData.V3.ODataValueBuilder.CreateEnumeratorListValue(ODataQueryPlan queryPlan)
   at Microsoft.Mashup.Engine1.Library.OData.V3.ODataValueBuilder.GetEnumerator()
   at Microsoft.Mashup.Engine1.Library.OData.V3.ODataValueBuilder.GetSingleValue()
   at Microsoft.Mashup.Engine1.Library.Common.ExternalQueryProcessor.ApplyFunction(Query originalQuery, QueryResultFunctionValue functionValue, IList`1 arguments)
   at Microsoft.Mashup.Engine1.Library.Common.ExternalQueryProcessor.Invoke(Query originalQuery, IExpression expression)
   at Microsoft.Mashup.Engine1.Library.Common.QueryResultFunctionValue.AnyResultFunctionValue.InvokeN(Value[] args)
   at Microsoft.Mashup.Engine1.Runtime.TransformValueReference.get_Value()
   at Microsoft.Mashup.Engine1.Runtime.RecordValue.ReferenceArrayRecordValue.get_Item(Int32 index)
   at Microsoft.Mashup.Evaluator.Services.ValueSerializer.<>c__DisplayClass25.<WritePreviewFieldValue>b__24()
   at Microsoft.Mashup.Evaluator.Services.ValueSerializer.HandleErrors(Action action, Action`1 handler)
   at Microsoft.Mashup.Evaluator.Services.ValueSerializer.<>c__DisplayClass1d.<>c__DisplayClass1f.<>c__DisplayClass22.<WritePreviewTable>b__1a()
   at Microsoft.Mashup.Evaluator.Services.ValueSerializer.HandleErrors(Action action, Action`1 handler)
   at Microsoft.Mashup.Evaluator.Services.ValueSerializer.<>c__DisplayClass1d.<>c__DisplayClass1f.<WritePreviewTable>b__19()
   at Microsoft.Mashup.Evaluator.Services.ValueSerializer.HandleErrors(Action action, Action`1 handler)
   at Microsoft.Mashup.Evaluator.Services.ValueSerializer.HandleErrors(Action action, Action`1 handler)
   at Microsoft.Mashup.Evaluator.Services.ValueSerializer.WritePreviewTable(IValue value)
   at Microsoft.Mashup.Evaluator.Services.ValueSerializer.<>c__DisplayClass4.<WritePreviewValue>b__0()
   at Microsoft.Mashup.Evaluator.Services.ValueSerializer.HandleErrors(Action action, Action`1 handler)
   at Microsoft.Mashup.Evaluator.Services.ValueSerializer.WritePreviewValue(IValue value, Int32 serializeStructuredValueDepth)
   at Microsoft.Mashup.Evaluator.Services.ValueSerializer.SerializePreviewValue(IEngine engine, IValue value, Action`2 rowCountCallback)
   at Microsoft.Mashup.Evaluator.SimpleDocumentEvaluator.ValuePreviewValueSource.TableValuePreviewValueSource.SerializeRows(Int32 count)
   at Microsoft.Mashup.Evaluator.SimpleDocumentEvaluator.ValuePreviewValueSource.TableValuePreviewValueSource.get_SmallValue()
   at Microsoft.Mashup.Evaluator.Interface.TracingPreviewValueSource.get_SmallValue()
   at Microsoft.Mashup.Evaluator.RemotePreviewValueSource.<>c__DisplayClass5.<RunStub>b__3()
   at Microsoft.Mashup.Evaluator.EvaluationHost.ReportExceptions(IHostTrace trace, IEngineHost engineHost, IMessageChannel channel, Action action)
   --- End of inner exception stack trace ---
   at Microsoft.Mashup.Evaluator.EvaluationHost.<>c__DisplayClass7.<TryReportException>b__6()
   at Microsoft.Mashup.Common.SafeExceptions.IgnoreSafeExceptions(IHostTrace trace, Action action)
   at Microsoft.Mashup.Evaluator.EvaluationHost.TryReportException(IHostTrace trace, IEngineHost engineHost, IMessageChannel channel, Exception exception)
   at Microsoft.Mashup.Evaluator.EvaluationHost.ReportExceptions(IHostTrace trace, IEngineHost engineHost, IMessageChannel channel, Action action)
   at Microsoft.Mashup.Evaluator.RemotePreviewValueSource.RunStub(IEngineHost engineHost, IMessageChannel channel, Func`1 getPreviewValueSource)
   at Microsoft.Mashup.Evaluator.RemoteDocumentEvaluator.Service.<>c__DisplayClass1f`1.<OnBeginGetResult>b__1c()
   at Microsoft.Mashup.Evaluator.EvaluationHost.ReportExceptions(IHostTrace trace, IEngineHost engineHost, IMessageChannel channel, Action action)
   at Microsoft.Mashup.Evaluator.RemoteDocumentEvaluator.Service.OnBeginGetResult[T](IMessageChannel channel, BeginGetResultMessage message, Action`1 action)
   at Microsoft.Mashup.Evaluator.RemoteDocumentEvaluator.Service.OnBeginGetPreviewValueSource(IMessageChannel channel, BeginGetPreviewValueSourceMessage message)
   at Microsoft.Mashup.Evaluator.MessageHandlers.TryDispatch(IMessageChannel channel, Message message)
   at Microsoft.Mashup.Evaluator.ChannelMessenger.ChannelMessageHandlers.TryDispatch(IMessageChannel channel, Message message)
   at Microsoft.Mashup.Evaluator.MessageHandlers.Dispatch(IMessageChannel channel, Message message)
   at Microsoft.Mashup.Evaluator.ChannelMessenger.OnMessageWithUnknownChannel(IMessageChannel baseChannel, MessageWithUnknownChannel messageWithUnknownChannel)
   at Microsoft.Mashup.Evaluator.MessageHandlers.TryDispatch(IMessageChannel channel, Message message)
   at Microsoft.Mashup.Evaluator.ChannelMessenger.ChannelMessageHandlers.TryDispatch(IMessageChannel channel, Message message)
   at Microsoft.Mashup.Evaluator.MessageHandlers.Dispatch(IMessageChannel channel, Message message)
   at Microsoft.Mashup.Evaluator.EvaluationHost.Run()
   at Microsoft.Mashup.Evaluator.SafeThread2.<>c__DisplayClass15.<CreateAction>b__14(Object o)
   at Microsoft.Mashup.Container.EvaluationContainerMain.SafeRun(String[] args)
   at Microsoft.Mashup.Container.EvaluationContainerMain.Main(String[] args)
   --- End of inner exception stack trace ---
   at Microsoft.Mashup.Evaluator.EvaluationHost.OnException(IEngineHost engineHost, IMessageChannel channel, ExceptionMessage message)
   at Microsoft.Mashup.Evaluator.MessageHandlers.TryDispatch(IMessageChannel channel, Message message)
   at Microsoft.Mashup.Evaluator.MessageHandlers.Dispatch(IMessageChannel channel, Message message)
   at Microsoft.Mashup.Evaluator.ChannelMessenger.ChannelMessageHandlers.TryDispatch(IMessageChannel channel, Message message)
   at Microsoft.Mashup.Evaluator.MessageHandlers.Dispatch(IMessageChannel channel, Message message)
   at Microsoft.Mashup.Evaluator.Interface.IMessageChannelExtensions.WaitFor[T](IMessageChannel channel)
   at Microsoft.Mashup.Evaluator.RemotePreviewValueSource.PreviewValueSource.WaitFor(Func`1 condition, Boolean disposing)
   at Microsoft.Mashup.Evaluator.RemotePreviewValueSource.PreviewValueSource.get_SmallValue()
   at Microsoft.Mashup.Evaluator.Interface.TracingPreviewValueSource.get_SmallValue()
   at Microsoft.Mashup.Host.Document.Analysis.PackageDocumentAnalysisInfo.PackagePartitionAnalysisInfo.SetPreviewValue(EvaluationResult2`1 result, Func`1 getStaleSince, Func`1 getSampled)

1 ACCEPTED SOLUTION

Hi @Anonymous,

 

You can use web.contents function call the api, for example:

 

let
    AzureMLJsonToTable = (
        WebServiceURI as text,
        WebServiceKey as text,
        TableToScore as table,
        optional Timeout as number
    ) as any => 
let
    WebTimeout = if Timeout = null then #duration(0,0,0,100) else #duration(0,0,0,Timeout) ,  

    WebServiceContent = ToAzureMLJson(TableToScore),

    WebResponse = Web.Contents(WebServiceURI,
        [Content = Text.ToBinary(WebServiceContent),
         Headers = [Authorization="Bearer " & WebServiceKey,
                    #"Content-Type"="application/json",
                    Accept="application/json"],
         Timeout = WebTimeout]),
    
    output = AzureMLJsonToTable(WebResponse)
in
    output 

in
    AzureMLJsonToTable

 

 

Notice: Webservice url is the api url, webservice key is the token of azure, you can input the parameters to "Headers" option.

 

Regards,

Xiaoxin Sheng

Community Support Team _ Xiaoxin
If this post helps, please consider accept as solution to help other members find it more quickly.

View solution in original post

3 REPLIES 3
v-shex-msft
Community Support
Community Support

Hi @Anonymous,

 

Does you test on a programming language or use query editor to connect the api ?

Can you share some detail information about this issue?(e.g. the connect tools, api version, screenshots, detail operation steps...).

 

Regards,

Xiaoxin Sheng

Community Support Team _ Xiaoxin
If this post helps, please consider accept as solution to help other members find it more quickly.
Anonymous
Not applicable

HI there

Thanks for getting back to me.

Basically I subscribed to a Cluster API service (cortana analytics). This is the sample application as per Microsoft Machine Learning site

http://microsoftazuremachinelearning.azurewebsites.net/ClusterModel.aspx

 

As you could see there are 2 arguments to be passed on

Input

K

 

Where input could be 10;5;2,18;1;6,7;5;5,22;3;4,12;2;1,10;3;4 (each row is separated by semi colon)

And K is cluster number: 5 (for example)

 

So to consume this API I use PowerBI Edit Query,

 

So go to Get Data > More > Azure > Microsoft Data MarketPlace, I can see the list of APIs I subscribed to, one of them is the one I referred to in the link above.

 

So I load that as Function lets called it "Score"

 

Then I got energy table which I loaded in from a csv file, I want to cluster energy consumption into 5 clusters.

 

So my data layout is

 

Year   Energy

2001   6.28213

2002  14.12845

2003   5.55851

 

and so on, lets say I got 100 rows of the data.

 

So I tried to pass "6.28213;14.12845;5.55851", "5" to Score function but I dont know how to

1. Convert my table into records

2. pass 2 argument records and constant value 5 as K.

 

Hope this makes sense.

 

Please help! 🙂

Thank you in advance.

 

Hi @Anonymous,

 

You can use web.contents function call the api, for example:

 

let
    AzureMLJsonToTable = (
        WebServiceURI as text,
        WebServiceKey as text,
        TableToScore as table,
        optional Timeout as number
    ) as any => 
let
    WebTimeout = if Timeout = null then #duration(0,0,0,100) else #duration(0,0,0,Timeout) ,  

    WebServiceContent = ToAzureMLJson(TableToScore),

    WebResponse = Web.Contents(WebServiceURI,
        [Content = Text.ToBinary(WebServiceContent),
         Headers = [Authorization="Bearer " & WebServiceKey,
                    #"Content-Type"="application/json",
                    Accept="application/json"],
         Timeout = WebTimeout]),
    
    output = AzureMLJsonToTable(WebResponse)
in
    output 

in
    AzureMLJsonToTable

 

 

Notice: Webservice url is the api url, webservice key is the token of azure, you can input the parameters to "Headers" option.

 

Regards,

Xiaoxin Sheng

Community Support Team _ Xiaoxin
If this post helps, please consider accept as solution to help other members find it more quickly.

Helpful resources

Announcements
Microsoft Fabric Learn Together

Microsoft Fabric Learn Together

Covering the world! 9:00-10:30 AM Sydney, 4:00-5:30 PM CET (Paris/Berlin), 7:00-8:30 PM Mexico City

PBI_APRIL_CAROUSEL1

Power BI Monthly Update - April 2024

Check out the April 2024 Power BI update to learn about new features.

April Fabric Community Update

Fabric Community Update - April 2024

Find out what's new and trending in the Fabric Community.