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,
I have written a fairly simple .NET application to POST rows continually to a dataset. This works absolutely fine and I couldn't be happier with the performance of the API either. However, I have an annoying issue where after 60 minutes I start to continually get 403 forbidden responses to my requests. This must be due to my access token expiring, but 1 hour seems like an awfully short period of time for this to start happening. Is this expected behaviour? I've seen other people mentioning needing to retrieve a new token every few days, but no one suggesting they have to do so every hour!
Thanks
CB
Solved! Go to Solution.
The token expiration is an AAD behavior and 60 minutes seems by default. Check Configurable Token Lifetimes in Azure Active Directory. For further question on AAD, you'd get better response from the dedicated forum.
By the way, how did you call the REST API to push data? Can you send the request with a new generated token always?
The token expiration is an AAD behavior and 60 minutes seems by default. Check Configurable Token Lifetimes in Azure Active Directory. For further question on AAD, you'd get better response from the dedicated forum.
By the way, how did you call the REST API to push data? Can you send the request with a new generated token always?
ah, yes. thank you! So simple.
To answer your question, my application starts up and calls a method to get the token once at the start and then passes that into each subsequent request. I could change this to generate a token each time, but I'm trying post data ~once every 2 seconds and that seems like a lot of unnecessary overhead. Also, this is just a dev solution at the moment ad so the account I'm using has MFA enabled. We could extend the lifetime default to a day, but either way just rewrite the code to catch the forbidden exception and generate a new token. Thanks for your help 🙂