The ultimate Fabric, Power BI, SQL, and AI community-led learning event. Save €200 with code FABCOMM.
Get registeredEnhance your career with this limited time 50% discount on Fabric and Power BI exams. Ends September 15. Request your voucher.
Hi All,
I ran into a very strange problem, I‘ve registered an application (service principal) on Azure, set PBI permissions, get Application ID and tenant ID and applicationSecret, I used this service principal to generate an AAD token, and then take this AAD token to request the PBI embed token, currently work, but after a period of time, the AAD token request PBI embed token cannot be obtained, I need to register a new one(APP Register) on Azure, and then take this new service principal to request that can work again, what is the problem? Is the AAD token expired. Thanks.
My code is C# code, refer to the following project:
具体代码如下截图:
Solved! Go to Solution.
Hi @simonlxd ,
AAD token does have expiration (default is 1h). Do you renew it before calling the Power BI API?
What is the error you're getting when the request to generate an embed token fails? Did you check if the response body contains information regarding the reason of the failure?
Hi @AmosHersch
Thanks for your response. Based on your idea, I checked it again. I found that trial AAD token generate is limited.
https://learn.microsoft.com/en-us/power-bi/developer/embedded/move-to-production
it says: "The number of embed trial tokens a Power BI service principal or master user (master account) can generate is limited." BTW, if i always create new service principal to generate embed token when it limited, is that work? 😂
I don't know if the limit of free tokens is per user or per tenant.
AFAIU customers are expected to use trial tokens when testing their embedded solution, and later when moving to production purchase dedicated capacity so they will get unlimited number of tokens.
Hi @simonlxd ,
AAD token does have expiration (default is 1h). Do you renew it before calling the Power BI API?
What is the error you're getting when the request to generate an embed token fails? Did you check if the response body contains information regarding the reason of the failure?