Looks like not possible to deploy workload identity with role microsoft.directory/applications/create in Bicep
@dkershaw10 がすでに取り組んでいます。
2024年7月12日 から。
評価
この issue はまだ評価されていません。
説明
Bicep version
az bicep version
Bicep CLI version 0.28.1 (ba1e9f8c1e)
Resource and API version
Which Microsoft.Graph resource and API version has the issue?
Microsoft.Graph/[email protected]
Auth flow
User signed to deploy a Bicep script from a command line using az deployment create ... .
Deployment details
I can provide if it makes sense.
Describe the bug
A clear and concise description of what the bug is vs what you expected to happen
I am using the new Bicep Graph module to create a workload identity that can then be assigned to e.g. GitHub to a certain repository. The purpose is to assign further workload identities from this repository that are defined in Bicep files there.
When I try to deploy a service principal with a role that I think has some of the right assignableScopes, I get an error
see https://aka.ms/arm-deployment-operations for usage details.","details":[{"code":"InvalidActionOrNotAction","message":"The resource provider referenced in the action 'microsoft.directory/applications/create' is not returned in the list of providers from Azure Resource Manager."}]}]}]}}
It feels to me I should be able do to this in Bicep and just put wrong assignableScopes. But on the other hand there's probably more into this. This may be related to https://github.com/microsoftgraph/msgraph-bicep-types/issues/134. I am not sure if this is a bug or would be a feature. It may also very well be I don't know just how to make this happen in Bicep. :)
To Reproduce
Additional context
The Bicep I use are like follows. I have permuted all kinds of things to assignableScopes, but as expected, the error message stays the same.
main.bicep:
resource azureRootManagementGroup 'Microsoft.Management/managementGroups@2023-04-01' existing = {
scope: tenant()
name: '<guid>'
}
var applicationIdentityRegistrationDisplayName = 'GitHub Actions Identity Application Deployer'
var applicationIdentityRegistrationName = 'root-appident-deployer'
var githubOIDCProvider = 'https://token.actions.githubusercontent.com'
var microsoftEntraAudience = 'api://AzureADTokenExchange'
var gitHubActionsFederatedIdentitySubject = 'repo:${gitHubOwner}/${gitHubRepo}:ref:refs/heads/main'
resource identityGithubActionsApplication 'Microsoft.Graph/[email protected]' = {
uniqueName: applicationIdentityRegistrationName
displayName: applicationIdentityRegistrationDisplayNamef
resource githubFederatedIdentityCredential '[email protected]' = {
name: '${identityGithubActionsApplication.uniqueName}/githubFederatedIdentityCredential'
audiences: [microsoftEntraAudience]
description: 'Identity for application to deploy the root identity infrastructure.'
issuer: githubOIDCProvider
subject: gitHubActionsFederatedIdentitySubject
}
}
resource gitHubIdentityActionsServicePrincipal 'Microsoft.Graph/[email protected]' = {
displayName: applicationIdentityRegistrationDisplayName
appId: identityGithubActionsApplication.appId
}
module companyIdentityPipelineRoleDefinitionAndAssignment './companyIdentityPipelineRoleDefinitionAndAssignment.bicep' = {
name: 'bootstrapIdentityRoleDeployment'
scope: tenant()
params: {
gitHubIdentityActionsServicePrincipalId: gitHubIdentityActionsServicePrincipal.id
azureRootManagementGroupId: azureRootManagementGroup.name
}
}
companyIdentityPipelineRoleDefinitionAndAssignment.bicep:
param azureRootManagementGroupName string
resource companyIdentityPipelineRoleDefinitionAndAssignment 'Microsoft.Authorization/roleDefinitions@2022-04-01' = {
name: guid(tenant().tenantId, 'CompanyIdentityPipelineRole')
properties: {
roleName: ' identity deployment role'
description: 'Grants rights to manage identity resources.'
type: 'CustomRole'
assignableScopes: [
/* Here e.g. slash, '/' won't work. */
'/providers/Microsoft.Management/managementGroups/${azureRootManagementGroupName}'
]
permissions: [
{
actions: [
'microsoft.directory/applications/create'
'microsoft.directory/applications/read'
'microsoft.directory/applications/credentials/update'
'microsoft.directory/servicePrincipals/create'
'microsoft.directory/servicePrincipals/read'
'microsoft.directory/servicePrincipals/credentials/update'
]
notActions: []
dataActions: []
notDataActions: []
}
]
}
}
- 主要言語
- TypeScript
- スター
- 80
- フォーク
- 15
- 平均マージ
- 1時間 21分
- マージ済み PR(30日)
- 3
環境構築
はじめの一歩
- issue を最後まで読み、次にプロジェクトのコントリビューションガイドを読みます。
- 着手することを issue にコメントします — 二人が同じ作業をするのを防げます。
- リポジトリをフォークし、ブランチを切って変更します。
- issue 番号を参照したプルリクエストを送ります。
microsoftgraph/msgraph-bicep-types のほかの issue
-
bug
難易度 4/5 3〜5日 初心者へのやさしさ 55/100
microsoftgraph/msgraph-bicep-types#311 · コメント 3 件 ·
-
enhancement new type
難易度 5/5 1週間以上 初心者へのやさしさ 45/100
-
enhancement
難易度 4/5 3〜5日 初心者へのやさしさ 35/100
microsoftgraph/msgraph-bicep-types#304 · コメント 3 件 · リアクション 1 件 ·
-
enhancement new type
難易度 4/5 3〜5日 初心者へのやさしさ 45/100
microsoftgraph/msgraph-bicep-types#296 · リアクション 2 件 ·
-
Issue with servicePrincipals and appRoleAssignedTo in some Entra Tenants再び着手できるかも @eketo-msft が 257 日前に担当しましたが、オープン中のプルリクエストはありません。 オープンbug
microsoftgraph/msgraph-bicep-types#275 · コメント 5 件 · 担当者 1 名 ·
microsoftgraph/msgraph-bicep-types の issue をすべて見る
似ている issue
-
docs
難易度 1/5 1時間未満 初心者へのやさしさ 68/100
remix-run/react-router#15558 ·
メンテナーはふだん 1 日以内に返信
-
難易度 2/5 1〜3時間 初心者へのやさしさ 78/100
solana-foundation/pay-kit#341 ·
メンテナーはふだん 1 日以内に返信
-
難易度 1/5 1〜3時間 初心者へのやさしさ 88/100
supabase/agent-skills#607 ·
-
enhancement
難易度 2/5 1〜3時間 初心者へのやさしさ 88/100
-
難易度 2/5 1〜3時間 初心者へのやさしさ 78/100
メンテナーはふだん 1 日以内に返信