Hey all. I'm trying to programmatically create app...
# dotnet
n
Hey all. I'm trying to programmatically create app registrations, API permissions. Specifically, I'm trying to add Microsoft Graph permissions to my app registration. According to the documentation (https://www.pulumi.com/registry/packages/azuread/api-docs/applicationapiaccess/#example-usage), the code should be written as followed:
Copy code
var wellKnown = AzureAD.GetApplicationPublishedAppIds.Invoke();
        var msGraph = AzureAD.GetServicePrincipal.Invoke(new()
        {
            ClientId = wellKnown.Apply(getApplicationPublishedAppIdsResult => 
                getApplicationPublishedAppIdsResult.Result?.MicrosoftGraph),
        });
However, it appears they
MicrosoftGraph
property is missing (as seen in the screen capture). I cannot build the application because of the missing property. I'm using the current version
v5.48.0
of
Pulumi.AzureAD
so that shouldn't be the issue. I spect the documentation is incorrect... Does anyone know the correct way to get the Microsoft Graph ClientID? Thank you.
The property
Result
is a
ImmutableDictionary<string, string>
so
wellKnown.Apply(x => x.Result["MicrosoftGraph"])
is the correct way to retrieve the value. With that out of the way...
AppRolesId
property doesn't exist for
public sealed class GetApplicationPublishedAppIdsResult
-- these issues remind me of a hallucinating AI model. Of course, not sure that's the case. Opening a proper ticket under the
pulumi/pulumi-azuread
repo.