Foramkumar Parekh
Foramkumar Parekh

Reputation: 541

Power BI integration with Azure AD B2C

I have an application running with Azure AD B2B where the front end is App service (SPA - Angular 11) and the backend is Azure Function app (java). I have Power BI Pro user accounts. I have integrated the Power BI reports into our application.

For Power BI integration, I have referred to the official documentation here and the java code to get the tokens and the embed URL, from here

This seems to work fine. (I am using master user and pass to access the reports)

I am now planning to switch to Azure AD B2C. I am using the same application working with B2C. The only thing that does not work is Power BI reports.

I get the below error in the function app, while trying to get the embedded URL of the reports. The method in the sample code can be found in the java code here

2021-06-29T09:46:06.998 [Error] Executed 'Functions.PowerBIEmbeddedToken' (Failed, Id=<id>, Duration=7019ms)
Result: Failure
Exception: NoSuchMethodError: org.springframework.util.Assert.noNullElements(Ljava/util/Collection;Ljava/lang/String;)V
Stack: java.lang.reflect.InvocationTargetException
    at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
    at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
    at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
    at java.lang.reflect.Method.invoke(Method.java:498)
    at com.microsoft.azure.functions.worker.broker.JavaMethodInvokeInfo.invoke(JavaMethodInvokeInfo.java:22)
    at com.microsoft.azure.functions.worker.broker.JavaMethodExecutorImpl.execute(JavaMethodExecutorImpl.java:54)
    at com.microsoft.azure.functions.worker.broker.JavaFunctionBroker.invokeMethod(JavaFunctionBroker.java:57)
    at com.microsoft.azure.functions.worker.handler.InvocationRequestHandler.execute(InvocationRequestHandler.java:33)
    at com.microsoft.azure.functions.worker.handler.InvocationRequestHandler.execute(InvocationRequestHandler.java:10)
    at com.microsoft.azure.functions.worker.handler.MessageHandler.handle(MessageHandler.java:45)
    at com.microsoft.azure.functions.worker.JavaWorkerClient$StreamingMessagePeer.lambda$onNext$0(JavaWorkerClient.java:92)
    at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:511)
    at java.util.concurrent.FutureTask.run(FutureTask.java:266)
    at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1149)
    at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:624)
    at java.lang.Thread.run(Thread.java:748)
Caused by: java.lang.NoSuchMethodError: org.springframework.util.Assert.noNullElements(Ljava/util/Collection;Ljava/lang/String;)V
    at org.springframework.web.client.HttpMessageConverterExtractor.<init>(HttpMessageConverterExtractor.java:78)
    at org.springframework.web.client.RestTemplate$ResponseEntityResponseExtractor.<init>(RestTemplate.java:988)
    at org.springframework.web.client.RestTemplate.responseEntityExtractor(RestTemplate.java:819)
    at org.springframework.web.client.RestTemplate.exchange(RestTemplate.java:582)
    at net.com.techman.service.PowerBIService.getEmbedConfig(PowerBIService.java:81)
    at net.com.techman.service.PowerBIEmbeddedService.fetchEmbeddedToken(PowerBIEmbeddedService.java:45)
    at net.com.techman.function.PowerBIEmbeddedTokenFunction.run(PowerBIEmbeddedTokenFunction.java:44)
    ... 16 more

Upvotes: 0

Views: 543

Answers (1)

James_Hamil-MSFT
James_Hamil-MSFT

Reputation: 191

This is an issue with Spring. Update Spring and its dependencies to fix the problem.

Upvotes: 1

Related Questions