Code calls Microsoft Cloud's PowerBI interface error

Shen Jian, CIH-2-7 0 Reputation points
2025-06-20T03:38:27.2433333+00:00

代码如下:

	InetSocketAddress addr = new InetSocketAddress("proxy.cn.ali.cloud.bmw", 8080);

	Proxy proxy = new Proxy(Proxy.Type.HTTP, addr);

	if (powerBIConfig.getServicePrincipal().tenantId.isEmpty()) {

		throw new RuntimeException("Tenant Id is empty");

	}

	// Build Confidential Client App

	ConfidentialClientApplication app = ConfidentialClientApplication.builder(

					powerBIConfig.clientId,

					ClientCredentialFactory.createFromSecret(powerBIConfig.getServicePrincipal().appSecret)).proxy(proxy)

			.authority(powerBIConfig.authorityUrl + powerBIConfig.getServicePrincipal().tenantId)

			.build();

		ClientCredentialParameters clientCreds = ClientCredentialParameters.builder(

						Collections.singleton(powerBIConfig.scopeBase))

				.build();

		IAuthenticationResult result = app.acquireToken(clientCreds).get();

报错如下:

get token is failed : java.lang.IllegalArgumentException: argument "content" is null

content:2025-06-20 11:27:08.116 [TID:N/A] |-ERROR [Thread-25] com.microsoft.aad.msal4j.ConfidentialClientApplication [145] -| [Correlation ID: d067df8f-e5b1-4f09-bb73-33a6864a49a5]

Execution of class com.microsoft.aad.msal4j.AcquireTokenByAuthorizationGrantSupplier failed.

content:2025-06-20 11:27:08.112 [TID:N/A] |-INFO [Thread-25] com.microsoft.aad.msal4j.HttpHelper [212] -| [Correlation ID: d067df8f-e5b1-4f09-bb73-33a6864a49a5] Sent (d067df8f-e5b1-4f09-bb73-33a6864a49a5) Correlation Id is not same as received (null).

Community Center Not monitored
0 comments No comments
{count} votes

2 answers

Sort by: Most helpful
  1. simo-k 10,415 Reputation points Volunteer Moderator
    2025-06-26T21:22:12.4433333+00:00

    Microsoft Q&A(en-us) does not support Fabric.
    Please ask your question in the community below.
    Fabric Community
     ├ Power BI
     ├ Data Engineering
     ├ Data Warehouse
     ├ Data Science
     ├ Data Factory
     ├ Real-Time Intelligence
     ├ Databases
     └ Fabric platform

    0 comments No comments

  2. Saideep Anchuri 9,425 Reputation points Microsoft External Staff Moderator
    2025-06-27T01:15:40.15+00:00

    Please note that Microsoft Fabric is not supported in this community. To get help and support with Microsoft Fabric, please post in their community here: https://community.fabric.microsoft.com/t5/General-Discussion/bd-p/ac_generaldiscussion

    As this is a question that isn't supported, I am going to update the tag to not monitored.

    0 comments No comments

Your answer

Answers can be marked as Accepted Answers by the question author, which helps users to know the answer solved the author's problem.