How to Setup an Azure Resource Manager Endpoint - geeklearningio/gl-vsts-tasks-azure GitHub Wiki
New improved user experience to setup Azure Resource Manager based service connection in VSTS
Follow the post below to configure Visual Studio Team Services to communicate with Azure in order to provision or deploy Azure Resource Manager resources such as virtual machines
- To setup Azure Service end point in VSTS, from your Visual Studio Account, navigate to your Team Project and click on gear icon.
- Click Services tab and click on ‘New Service Endpoint’ in the left pane.
- From the drop-down, select ‘Azure Resource Manager’ option.
Now, setting up an Azure Service endpoint is easy, you just need to select the subscription on which to create a service endpoint, and you are ready to deploy to Azure.
Note
A new Azure Service Principal will be created and assigned with the ‘Contributor’ role. The default role assignment will have access to all the resources in the selected subscription. You can modify the Service Principal access from Azure portal > Subscriptions > Users > Roles.
Prerequisites
- The VSTS account should be backed by an Azure Active Directory. For more info, see the Visual Studio article Team Services: Access with Azure Active Directory (Azure AD).
- Note only Azure subscriptions that are linked with the Active Directory are listed.
If your subscription is not listed or to specify an existing service principal, click the link in the dialog, which will switch to manual entry mode.
Manual configuration
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 version 1.0.2.
- 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
To setup Azure Service end point in VSTS, from your Visual Studio Account, navigate to your Team Project and click on gear icon.
- Click Services tab and click on ‘New Service Endpoint’ in the left pane.
- From the drop-down, select ‘Azure Resource Manager’ option. In the dialog, click the link at end of the text “If your subscription is not listed or to specify an existing service principal, click here”, which will switch to manual entry mode. You can always switch back to “Auto creation of SPN mode” by clicking the link in the manual mode dialog.
- Enter the input values that you generated from the PowerShell
- Click ‘OK’. We now have established a connection to Azure from your VSTS account.