microsoftgraph / microsoftgraph/msgraph-bicep-types

Deploy sp referencing app reg within module errors out

Open
#311 3 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

bug
Dominant language
TypeScript
Stars
80
Forks
15
Avg merge
1h 21m
Merged PRs (30d)
3

Description

Bicep version
N/a, using AzureResourceManagerTemplateDeployment@3 in Azure DevOps Server 25H2 (on-premise)

Resource and API version
Microsoft.Graph/servicePrincipals@v1.0 combined with Microsoft.Graph/applications@v1.0

Auth flow
Automated. Service connection authenticates with/via app registration using a certificate towards Azure.

Deployment details
Correlation id: e48512ff-cb2c-4d2b-8fe8-5bd8f673b61f
Start time: 18-8-2026, 14:48:50

Describe the bug
When deploying, both defined in a seperate file/module, an app registration and service principal referencing the app registration's appId, it fails with: The language expression property 'appId' doesn't exist, available properties are 'displayName, uniqueName, identifierUris, api, appRoles, owners'.
When they are defined in a directly deployed bicep, all goes well.

To Reproduce
deploy.bicep:

// Left params out since not relevant.
module appRegistration './app-registration.bicep' = {
  name: 'appRegistrationDeployment-${depName}'
  params: {
    name: appRegistrationName
  }
}

app-registration.bicep:

// Left params out since not relevant.
resource appRegistration 'Microsoft.Graph/applications@v1.0' = {
  displayName: name
  uniqueName: name
}

resource servicePrincipal 'Microsoft.Graph/servicePrincipals@v1.0' = {
  appId: appRegistration.appId
}

Additional context
It seems like it has something to do with it being in a module. Using another name for the resource does not help either, tried that to be sure it was not related to that.

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Reproduce the failure with deploy.bicep and app-registration.bicep using the Microsoft.Graph applications and servicePrincipals resources. Start by tracing how the application resource's appId is exposed and resolved across the module boundary. Done means the module-based deployment succeeds and the service principal receives the application appId.

Written by the indexing model from the issue text.

Assessment

Tech stack
azure
Domain
cloud, infrastructure
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Quiet
Clarity
Mostly clear
Newbie friendliness
55/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.