2

I am using VSTS to created a release definition. I am in need to deploy .Net core app to an Azure app service.

I am login to VSTS from account abc@outlook.com while my azure account is linked with xyz@outlook.com

In this context, I am adding Service endpoint as Azure Resource Manager.

But not sure where I can get the details like:-

  • Service Principle Client Id
  • Service Principle Key
  • Tenant Id

Where I can get these details from Azure portal??

Thanks

huysmania
  • 1,054
  • 5
  • 11
Kgn-web
  • 7,047
  • 24
  • 95
  • 161
  • Do you solve this issue? – starian chen-MSFT May 21 '18 at 01:29
  • @starianchen-MSFT, not yet – Kgn-web May 21 '18 at 08:44
  • What's the detail issue now? – starian chen-MSFT May 21 '18 at 08:49
  • @starianchen-MSFT error - `At line:3 char:47 + [string] $subscriptionName = "Free Trial", + ~ Missing expression after ','. At line:3 char:47 + [string] $subscriptionName = "Free Trial", + ~ Missing closing ')' in expression. + CategoryInfo : ParserError: (:) [], ParentContainsErrorRecordException + FullyQualifiedErrorId : MissingExpressionAfterToken` – Kgn-web May 21 '18 at 09:28
  • @starianchen-MSFT Please refer ps script `( [Parameter(Mandatory = $true, HelpMessage = "Enter Azure Subscription name. You need to be Subscription Admin to execute the script")] [string] $subscriptionName = "Free Trial", [Parameter(Mandatory = $true, HelpMessage = "Provide a password for SPN application that you would create; this becomes the service principal's security key")] [securestring] $password = "Mypassword", [Parameter(Mandatory = $false, HelpMessage = "Provide a SPN role assignment")] [string] $spnRole = "owner", )` – Kgn-web May 21 '18 at 09:31
  • How do you download the script? Try to use this file instead: https://1drv.ms/u/s!AresBGZVYryjiGY3KFVamsROfPnM. On the other hand, you can get he subscription name in azure portal: Click All Resource, then check subscription name in the right panel: Subscriptions:xxx – Don't see a subscription? Switch directories – starian chen-MSFT May 21 '18 at 09:50
  • @starianchen-MSFT Yes my ps looks the same, please refer this `[string] $subscriptionName = "Free Trial", ` – Kgn-web May 21 '18 at 09:58
  • There isn't `,` at the end of the parameters, what's the result if you try it with my script? On the other hand, is subscription name `Free Trial`? – starian chen-MSFT May 22 '18 at 01:30
  • @starianchen-MSFT, yes the subscription name is "Free Trail" – Kgn-web May 22 '18 at 07:11
  • What's the result if you try it with my script file? – starian chen-MSFT May 22 '18 at 07:21
  • @starianchen-MSFT same error mentioned in the previous comment – Kgn-web May 22 '18 at 07:23
  • Try with these steps: 1. Add xyz@outlook.com account to your VSTS 2. Log on VSTS with xyz@outlook.com account 3. Create a new build definition 4. Add Azure App Service Deploy task 5. Choose item in Available Azure subscriptions in Azure Subscription input box 6. Click Authorize – starian chen-MSFT May 22 '18 at 07:37

5 Answers5

1

I've registered a test application to show you where to retrieve these values. You need to register your application in the Azure portal under Azure Active Directory > App Registrations > "New App Registration"

Client ID (The Application ID in the App Registration): Client ID

Service Principle Key - Go to "Settings" in the top left corner of the registered application. Then go to "Keys" and enter a description to generate the key (also called Client Secret). The Key will automatically be generated and you will need to copy and save that key.

Service Principal Key

Tenant ID Select your name in the top right corner of the Azure Portal. Then select "Switch Directory" and look for the number underneath your directory name. In order to register the app in your Active Directory you need to have a dedicated tenant with the app registered under that tenant.

enter image description here

See also: https://www.youtube.com/watch?v=MohaxN6fsDs&t=3s

Marilee Turscak - MSFT
  • 7,367
  • 3
  • 18
  • 28
0

The Service Principal Client Id is the AppId of the ServicePrincipal that has access to your Subscription / Resource. You can create the Principle Key on the "Key" Tab. The Tenant Id is the Id of your Azure Active Directory (you will find it on the Property Tab within your AAD).

You will find all these and furhter information here.

Also worth mentioning: Troubleshoot Azure Resource Manager service endpoints

Martin Brandl
  • 56,134
  • 13
  • 133
  • 172
0

Where I can get these details from Azure portal??

Some place refer to the Application ID as the client ID.

You could find them in the portal, please refer :

For more details, you could refer to this article.

Joy Wang
  • 39,905
  • 3
  • 30
  • 54
0

Follow the post below to manually configure Visual Studio Team Services

Download & run this PowerShell script in an Azure Powershell window to generate required data for Service Principal based Azure service connection. Running this script would prompt you for:

  • The name of your Azure Subscription name

  • A password that you would like to set for the Service Principal that is going to be created

  • Note: the script has been tested with Azure PowerShell latest version.

Once successful, the script would output the following details for the Azure Service Endpoint.

(Connection Name, Subscription Id, Subscription Name, Service Principal Client Id, Service Principal key, Tenant Id)

enter image description here

For more details, refer "To use the manual subscription definition dialog"

OR

Manual Register Application under Azure Active Directory:

How to generate key token on Azure portal?

CHEEKATLAPRADEEP
  • 12,191
  • 1
  • 19
  • 42
0

You also can refer to this blog to configure Azure RM endpoint manually (Manual Configuration section)

Automating Azure Resource Group deployment using a Service Principal in Visual Studio Online: Build/Release Management

starian chen-MSFT
  • 33,174
  • 2
  • 29
  • 53