Notifications
Announcements
No record found.
I am trying to leverage App Insights to get authenticated users for my Power Apps portal. Was setting up things as described by Psyionic here: https://www.dancingwithcrm.com/powerappsportals-tracking-using-azure-app-insights/.
That approach was working fine until Oct 12th when suddenly user_AuthenticatedId was not populated anymore. Did of course not change anything in the snippet nor any app insights settings. Would be great if anyone could help getting back on track ... Thanks!!
adding my code snippet below:
<script type="text/javascript"> var appInsights=window.appInsights||function(a){ function b(a) { c[a] = function () { var b = arguments; c.queue.push(function () { c[a].apply(c, b) }) } }var c={config:a},d=document,e=window;setTimeout(function(){var b=d.createElement("script");b.src=a.url||"">az416426.vo.msecnd.net/.../ai.0.js",d.getElementsByTagName("script")[0].parentNode.appendChild(b)});try{c.cookie = d.cookie}catch(a){ }c.queue=[];for(var f=["Event","Exception","Metric","PageView","Trace","Dependency"];f.length;)b("track"+f.pop());if(b("setAuthenticatedUserContext"),b("clearAuthenticatedUserContext"),b("startTrackEvent"),b("stopTrackEvent"),b("startTrackPage"),b("stopTrackPage"),b("flush"),!a.disableExceptionTracking){f = "onerror", b("_" + f);var g=e[f];e[f]=function(a,b,d,e,h){var i=g&&g(a,b,d,e,h);return!0!==i&&c["_"+f](a,b,d,e,h),i}}return c }({ instrumentationKey: "XXXXXXXXXXXXXXXXXXXXXXXXXXXX" }); window.appInsights=appInsights,appInsights.queue&&0===appInsights.queue.length&&appInsights.trackPageView(); {% if user %} appInsights.setAuthenticatedUserContext('{{ user.Id }}', '{{ user.parentcustomerid.Id }}'); {% else %} appInsights.clearAuthenticatedUserContext(); {% endif %} </script>
Hi schdaef,please refer the below reference code:- Thanks,Manoj.Please mark this as VERIFIED if it helps.
That is what I did and as I said, it was working initially but then suddenly authenticated user ID was not coming through anymore…
Under review
Thank you for your reply! To ensure a great experience for everyone, your content is awaiting approval by our Community Managers. Please check back later.
As AI tools become more common, we’re introducing a Responsible AI Use…
We are honored to recognize Neeraj Kumar as our Community Spotlight honoree for…
These are the community rock stars!
Stay up to date on forum activity by subscribing.
Tom_Gioielli 108 Super User 2025 Season 2
Jimmy Passeti 50 Most Valuable Professional
Gerardo RenterÃa Ga... 49 Most Valuable Professional