Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

AADServicePrincipal: AppId is missing from configuration files and cannot be compiled #5549

Open
jdlagace opened this issue Dec 13, 2024 · 1 comment · May be fixed by #5605
Open

AADServicePrincipal: AppId is missing from configuration files and cannot be compiled #5549

jdlagace opened this issue Dec 13, 2024 · 1 comment · May be fixed by #5605

Comments

@jdlagace
Copy link
Contributor

Description of the issue

The AppId (not ApplicationId) is missing from the configuration files for the AADServicePrincipal resource. When we try to compile the configuration files we get an error message because the schema mof file is expecting an AppId to be present in the configuration file.

Microsoft 365 DSC Version

1.24.1211.1

Which workloads are affected

Azure Active Directory (Entra ID)

The DSC configuration

# Generated with Microsoft365DSC version 1.24.1211.1
# For additional information on how to use Microsoft365DSC, please visit https://aka.ms/M365DSC
param (
)

Configuration AADServicePrincipal
{
    param (
    )

    $OrganizationName = $ConfigurationData.NonNodeData.OrganizationName

    Import-DscResource -ModuleName 'Microsoft365DSC' -ModuleVersion '1.24.1211.1'

    Node localhost
    {

        # For information on how to use this resource, please refer to:
        # https://github.com/microsoft/Microsoft365DSC/wiki/AADServicePrincipal
        AADServicePrincipal "AADServicePrincipal-535"
        {
            AccountEnabled                     = $True;
            AlternativeNames                   = @();
            ApplicationId                      = $ConfigurationData.NonNodeData.ApplicationId;
            ApplicationSecret                  = New-Object System.Management.Automation.PSCredential ('ApplicationSecret', (ConvertTo-SecureString $ConfigurationData.NonNodeData.ApplicationSecret -AsPlainText -Force));
            AppRoleAssignedTo                  = @();
            AppRoleAssignmentRequired          = $False;
            CustomSecurityAttributes           = @();
            DelegatedPermissionClassifications = @();
            DisplayName                        = "test-webapi";
            Ensure                             = "Present";
            ObjectID                           = "e054bd7d-XXXX-XXXX-XXXX-XXXXXXXXXXXX";
            Owners                             = @();
            ReplyURLs                          = @("https://jwt.ms");
            ServicePrincipalNames              = @("https://mytenant.onmicrosoft.com/api","0caeaf54-XXXX-XXXX-XXXX-XXXXXXXXXXXX");
            ServicePrincipalType               = "Application";
            Tags                               = @("HideApp","WindowsAzureActiveDirectoryIntegratedApp");
            TenantId                           = $OrganizationName;
        }
    }
}

AADServicePrincipal -ConfigurationData .\ConfigurationData.psd1

Verbose logs showing the problem

At C:\temp\_m365dsc\OtherComponents\ToRestore\AADServicePrincipal.ps1:20 char:9
+         AADServicePrincipal "AADServicePrincipal-535"
+         ~~~~~~~~~~~~~~~~~~~
Resource 'AADServicePrincipal' requires that a value of type 'String' be provided for property 'AppId'.
    + CategoryInfo          : ParserError: (:) [], ParseException
    + FullyQualifiedErrorId : MissingValueForMandatoryProperty

Environment Information + PowerShell Version

@niwamo
Copy link

niwamo commented Jan 7, 2025

+1 (same issue)

I took a quick look at the relevant resource module, and it's a very simple fix. Opening a PR.

@niwamo niwamo linked a pull request Jan 7, 2025 that will close this issue
7 tasks
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants