export async function getResourceInfo()

in src/resources/ResourceInfo.ts [26:48]


export async function getResourceInfo(): Promise<ResourceInfo> {
    // NOTE: Using `AzureCliCredential` instead of `DefaultAzureCredential` to avoid "InvalidAuthenticationTokenTenant" error on 1es build agents
    // These creds automatically handle `additionallyAllowedTenantIds` for us, while not all other creds do
    const creds = new AzureCliCredential();

    const subscriptionId = await getSubscriptionId();
    const tenantId = await getTenantId();
    const userName = await getUserName();
    const objectId = await getObjectId(userName);

    const resourcePrefix = getResourcePrefix();

    return {
        creds,
        subscriptionId,
        tenantId,
        userName,
        objectId,
        resourcePrefix,
        resourceGroupName: resourcePrefix + 'group',
        location: 'westus',
    };
}