service-principal

Service principal privileges for app registration creation

自闭症网瘾萝莉.ら 提交于 2019-12-14 03:52:19
问题 I'm using service principal as login item for azure cli. The role of this service principal is "owner". I'm trying to run: az ad app list and az ad app create --display-name "Test application 2" and getting error: Directory permission is needed for the current user to register the application. For how to configure, please refer 'https://docs.microsoft.com/en-us/azure/azure-resource-manager/resource-group-create-service-principal-portal'. Original error: Insufficient privileges to complete the

Azure Active Directory: Add Service Principal to Directory Readers Role with PowerShell

此生再无相见时 提交于 2019-12-10 00:28:22
问题 The command (Get-AzureRmADUser -Mail $user).Id in a Azure PowerShell Task returned null when running on a self-hosted agent in VSTS The problem was that the Service Principal needs to have the permission to read from the Active Directory How can I give the the Service Principal the correct permissions to read from the Azure Active Directory? 回答1: Prerequisites Check if you have the proper permissions to get the object id from a Service Principal Check if you have the proper permissions to add

Azure - authenticating to KeyVault using Service Principle returns an Unauthorized exception

天大地大妈咪最大 提交于 2019-12-07 05:56:52
问题 I'm trying to access KeyVault from an .net Core console application, using a Service Principle (I have the App Id and App Secret ). Here's my code: var client = new KeyVaultClient(GetAccessToken); var secret = client.GetSecretAsync("https://{keyvaultName}.vault.azure.net", "MySecret").Result; Which calls back to this function: private static async Task<string> GetAccessToken(string authority, string resource, string scope) { var context = new AuthenticationContext(authority, TokenCache

Azure - authenticating to KeyVault using Service Principle returns an Unauthorized exception

Deadly 提交于 2019-12-05 10:10:17
I'm trying to access KeyVault from an .net Core console application, using a Service Principle (I have the App Id and App Secret ). Here's my code: var client = new KeyVaultClient(GetAccessToken); var secret = client.GetSecretAsync("https://{keyvaultName}.vault.azure.net", "MySecret").Result; Which calls back to this function: private static async Task<string> GetAccessToken(string authority, string resource, string scope) { var context = new AuthenticationContext(authority, TokenCache.DefaultShared); var credential = new ClientCredential(clientId: appId, clientSecret: appSecret); var

Azure Active Directory: Add Service Principal to Directory Readers Role with PowerShell

╄→尐↘猪︶ㄣ 提交于 2019-12-04 21:59:36
The command (Get-AzureRmADUser -Mail $user).Id in a Azure PowerShell Task returned null when running on a self-hosted agent in VSTS The problem was that the Service Principal needs to have the permission to read from the Active Directory How can I give the the Service Principal the correct permissions to read from the Azure Active Directory? Prerequisites Check if you have the proper permissions to get the object id from a Service Principal Check if you have the proper permissions to add the Service Principal to the "Directory Readers" role in the Azure Active Directory tenant (-> Admin) Steps

Create service principal programmatically in Azure Python API

被刻印的时光 ゝ 提交于 2019-12-02 10:24:06
How can I, using the Azure Python API, create a full set of credentials that can later be used to start and deallocate all VMs in a named resource group, without any other permissions? I have thoroughly researched the example code and both official and unofficial documentation, but I don't even know where to start... I know I will need a tenant ID, client ID, client secret and subscription ID. Which of those can I make using an API, and how would I go about assigning roles to allow for starting/deallocating VMs of an existing resource group? Sample code highly sought after, but will take any

How to log in to Azure service principal

一笑奈何 提交于 2019-11-29 12:53:27
Connect-AzureRMAccount doesn't work. I don't care. I don't want to run through the process of needing a PhD to understand why PowerShell never wants to work. So I'm going to use Login-AzureRMAccount I've followed the docs. Of course it's inadequate so here I am. https://docs.microsoft.com/en-us/powershell/azure/authenticate-azureps?view=azurermps-6.6.0 "In order to get the service principal's credentials as the appropriate object, use the Get-Credential cmdlet. This cmdlet will display a dialog box to enter the service principal user ID and password into." Where do I even find my userID? I

Azure Provisioning - Without manual login

允我心安 提交于 2019-11-28 11:47:55
问题 I have a Powershell script which runs to set up Azure web apps, databases, etc. but before running the script, I have to do the following: PS C:/> Login-AzureRmAccount This pops up a GUI in which I have to manually add in my user, password, and my 2-factor authentication code. I eventually want to use that script as a part of a part of a build/deployment automation script. I gleaned the following from a few articles about using a "service principal". First I do: PS C:\> Add-AzureRmAccount In

How to log in to Azure service principal

你说的曾经没有我的故事 提交于 2019-11-28 06:51:29
问题 Connect-AzureRMAccount doesn't work. I don't care. I don't want to run through the process of needing a PhD to understand why PowerShell never wants to work. So I'm going to use Login-AzureRMAccount I've followed the docs. Of course it's inadequate so here I am. https://docs.microsoft.com/en-us/powershell/azure/authenticate-azureps?view=azurermps-6.6.0 "In order to get the service principal's credentials as the appropriate object, use the Get-Credential cmdlet. This cmdlet will display a