Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Custom Policies and application insights

Tags:

azure-ad-b2c

I'm trying to make App Insights work so I can debug my policies, using this:

https://learn.microsoft.com/en-us/azure/active-directory-b2c/active-directory-b2c-troubleshoot-custom

And based on this project: https://github.com/Azure-Samples/active-directory-b2c-custom-policy-starterpack/tree/master/LocalAccounts

Made the proper modifications:

<TrustFrameworkPolicy
    xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
    xmlns:xsd="http://www.w3.org/2001/XMLSchema"
    xmlns="http://schemas.microsoft.com/online/cpim/schemas/2013/06"
    PolicySchemaVersion="0.3.0.0"
    TenantId="B2CPruebaProteccion.onmicrosoft.com"
    PolicyId="B2C_1A_PasswordReset"
    PublicPolicyUri="http://B2CPruebaProteccion.onmicrosoft.com/B2C_1A_PasswordReset
    UserJourneyRecorderEndpoint="urn:journeyrecorder:applicationinsights">

    <BasePolicy>
        <TenantId>B2CPruebaProteccion.onmicrosoft.com</TenantId>
        <PolicyId>B2C_1A_TrustFrameworkExtensions</PolicyId>
    </BasePolicy>

    <RelyingParty>
        <DefaultUserJourney ReferenceId="PasswordReset" />
        <UserJourneyBehaviors>
            <JourneyInsights TelemetryEngine="ApplicationInsights" InstrumentationKey="00000000-0000-0000-0000-000000000000" DeveloperMode="true" ClientEnabled="false" ServerEnabled="true" TelemetryVersion="1.0.0" />
        </UserJourneyBehaviors>
        <TechnicalProfile Id="PolicyProfile">
        ...
</TrustFrameworkPolicy>

My data is not showing up in App Insights. How can I validate/repair this error?

like image 864
ChrisHUM ChrisHum Avatar asked Nov 07 '22 16:11

ChrisHUM ChrisHum


1 Answers

You must also add the DeploymentMode="Development" attribute to the TrustFrameworkPolicy element.

For example:

<TrustFrameworkPolicy
  PolicySchemaVersion="0.3.0.0"
  TenantId="contoso.onmicrosoft.com"
  PolicyId="B2C_1A_sign_up_sign_in"
  PublicPolicyUri="http://contoso.onmicrosoft.com"
  DeploymentMode="Development"
  UserJourneyRecorderEndpoint="urn:journeyrecorder:applicationinsights"
  xmlns="http://schemas.microsoft.com/online/cpim/schemas/2013/06"
  xmlns:xsd="http://www.w3.org/2001/XMLSchema"
  xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
    ...
</TrustFrameworkPolicy>
like image 175
Chris Padgett Avatar answered Dec 08 '22 22:12

Chris Padgett