0

I can't find any documentation on how to choose which AAD to create the service principal in. Basically, I can't find out if there is even a way to add the SP to the local AAD.

So we have a default Global AD which covers all of our enrollment and below that all subscriptions. I'm using Powershell derived from the many many examples on the net to create a SP in the default AD. Then I permission that SP against the subscription it is going to be working in.

At this point I've run into the following problem. I'm rolling out a Key Vault, this works.

New-AzureRmKeyVault -VaultName $VaultName -EnabledForDeployment -EnabledForTemplateDeployment -ResourceGroupName $ResourceGroupName -Location $Location -Verbose

I need to add the first secret into it as part of the deployment. This bit fails because the SP doesn't have access to the KV.

# Set-AzureRmKeyVaultAccessPolicy -VaultName $VaultName -ResourceGroupName $ResourceGroupName -PermissionsToSecrets get,set -ServicePrincipalName $ServicePrincipalName

This is the result of that command.

Set-AzureRmKeyVaultAccessPolicy : Cannot find the Active Directory object 
'Service-Principal-Name' in tenant '6166a717-xxxx-xxxxx-b0e8-6b7288c1f7ec'. 
Please make sure that the user or application service principal you are
authorizing is registered in the current subscription's Azure Active 
directory. 

Reading into this, its not possible to set the Global AD Service Principal to have get/set on the local Keyvault. it would have to be a local Service Principal. However, we dont have one of them and nowhere can I work out how to create one of them.

Anyone else feeling this pain and know how to resolve it?

4

1 回答 1

0

在旧门户 (manage.windowsazure.com) 的设置部分,您会找到所有订阅的列表。第四列(目录)显示与每个订阅关联的默认目录。无论如何,您都必须在与该特定订阅关联的目录中创建服务主体。请查看链接以了解订阅和 AAD 之间的关系。

于 2016-10-14T14:47:20.203 回答