Trying to access the `principalId` from the `ident...
# typescript
s
Trying to access the
principalId
from the
identity
property of API Management service:
export const dump = service.identity.principalId
However, it seems that accessing properties of
identity
is not doable for some reason:
error TS2339: Property 'principalId' does not exist on type 'Output<ServiceIdentity | undefined>'.
Property 'principalId' does not exist on type 'OutputInstance<ServiceIdentity | undefined> & LiftedObject<undefined, never>'.
But the outputs of apimanagement say it should be possible
Copy code
interface ServiceIdentity {
        /**
         * The Principal ID associated with this Managed Service Identity.
         */
        principalId: string;
        /**
         * The Tenant ID associated with this Managed Service Identity.
         */
        tenantId: string;
        type: string;
    }
Am I missing anything? …. Forgot to mention that outputting the
identity
object works as expected
Copy code
~ dump: {
      + dump: {
          + principalId: "9f9e1f60-933e-49b5-b6a3-7c416e2b542a"
          + tenantId   : "152e4c75-3657-4284-bb2c-0d825873d72b"
          + type       : "SystemAssigned"
        }
    }