The ultimate Microsoft Fabric, Power BI, Azure AI & SQL learning event! Join us in Las Vegas from March 26-28, 2024. Use code MSCUST for a $100 discount. Register Now
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 🙂
Join us at our first-ever Microsoft Fabric Community Conference, March 26-28, 2024 in Las Vegas with 100+ sessions by community experts and Microsoft engineering.
User | Count |
---|---|
17 | |
2 | |
2 | |
2 | |
1 |
User | Count |
---|---|
19 | |
10 | |
5 | |
4 | |
3 |