Hi Team, I'm having some issues setting up an Azu...
# azure
i
Hi Team, I'm having some issues setting up an AzureAD app and giving it access to another app. (Basically, I want to allow an application client credentials access)
Copy code
var serverApp = new AzureAD.Application("my-app", new AzureAD.ApplicationArgs
        {
            DisplayName = "my-app",
            IdentifierUris =
            {
                $"<api://my-app>",
            },
            Owners =
            {
                current.Apply(current => current.ObjectId),
            },
            SignInAudience = "AzureADMyOrg",
            Tags = Tags.Select(x => x.Value).ToArray(),
            Api = new AzureAD.Inputs.ApplicationApiArgs
            {
                Oauth2PermissionScopes =
                {
                    new AzureAD.Inputs.ApplicationApiOauth2PermissionScopeArgs
                    {
                        AdminConsentDescription = "give access",
                        AdminConsentDisplayName = "give-access",
                        Id = "69550FBB-E70E-4D68-8849-B4C9A62AFEA1",
                        Enabled = true,
                        Type = "User",
                        Value = "access",
                    },
                },
            },
            
        }, new CustomResourceOptions()
        {
            IgnoreChanges = new List<string> { "owner", "owners" }
        });


        var clientApp = new AzureAD.Application("my-client", new AzureAD.ApplicationArgs
        {
            DisplayName = "my-client",
            Owners =
            {
                current.Apply(current => current.ObjectId),
            },
            SignInAudience = "AzureADMyOrg",
            Tags = Tags.Select(x => x.Value).ToArray()
        }, new CustomResourceOptions()
        {
            IgnoreChanges = new List<string> { "owner", "owners" }
        });

        //Give another application access to this API
       var apiPermission = new AzureAD.ApplicationApiAccess("api-access", new AzureAD.ApplicationApiAccessArgs
       {
           ApiClientId = serverApp.ApplicationId,
           ApplicationId = clientApp.Id,
           ScopeIds = serverApp.Oauth2PermissionScopeIds.Apply(x => x.Select(y => y.Value)),

       });
While this code doesn't fail, it also doesn't actually create the access in the Entra ID portal. Any thoughts as to what i'm doingn wrong?