【发布时间】:2023-03-30 15:09:01
【问题描述】:
我正在尝试将 azure 应用分配给 Azure AD 角色。
在 PowerShell 中我可以做到这一点
## Import-Module AzureAD
## The role to assign to your app
$directoryRole = '[Role Name]' # i.e. 'Administrator'
$AppId = "[Guid]"
## Find the ObjectID of Role Name
$RoleId = (Get-AzureADDirectoryRole | Where-Object { $_.displayname -eq $directoryRole }).ObjectId
## Add the service principal to the directory role
Add-AzureADDirectoryRoleMember -ObjectId $RoleId -RefObjectId $AppId -Verbose
如何使用 terraform 进行操作?
【问题讨论】:
标签: azure powershell terraform terraform-provider-azure