Exercise - set up service connections
This exercise demonstrates service connection configuration and implementation within Azure DevOps pipelines.
Note
Prerequisites include an active Azure subscription with a provisioned storage account for demonstration purposes.
Steps
Service connections establish secure, authenticated communication channels between deployment pipelines and target environments through credential management and authorization frameworks.
Service connections enable secure resource access across distributed systems and external service integrations while maintaining centralized authentication management.
Azure Resource Manager service connections provide authenticated access to Azure resources, demonstrated through Azure storage integration scenarios.
From the main menu in the Parts Unlimited project, click Project settings at the bottom of the screen.
In the Project Settings pane, from the Pipelines section, click Service Connections. Click the drop-down beside +New service connection.
Multiple service connection types support diverse integration scenarios:
- Apple App Store integration for mobile application deployment
- Docker Registry authentication for container image management
- Bitbucket source control integration for repository access
- Azure Service Bus connectivity for messaging services
Azure resource deployment requires Azure Resource Manager service connection configuration for authenticated resource access.
Click Azure Resource Manager to add a new service connection.
Set the Connection name to Azure Resource Manager Service Connection, click on an Azure Subscription, then select an existing Resource Group.
Note
You might be prompted to sign-in Azure at this point. If so, sign-in first.
Service connection creation establishes a Service Principal for Azure authentication. Managed Identity Authentication provides an alternative authentication mechanism available through the interface configuration.
Service Principals function as service accounts with scoped permissions limited to specific subscriptions and resource groups, implementing principle of least privilege for secure pipeline authentication.
Important
Azure service connection creation assigns Contributor role permissions to the service principal at subscription or resource group scope. Blob storage operations require additional Storage Blob Data Contributor role assignment for the service principal. Insufficient permissions result in authorization failures during release execution.
Click OK to create it. It will then be shown in the list.
Click Pipelines, Releases, and Edit in the main Parts Unlimited menu to see the release pipeline. Click the link to View stage tasks.
The task inventory displays current stage configuration. Empty template initialization results in no pre-configured tasks. Each stage supports multiple parallel and sequential task execution.
Click the + sign to the right of the Agent job to add a new task. See the available list of task types.
In the Search box, enter the word storage and see the list of storage-related tasks. These include standard tasks and tasks available from the Marketplace.
Azure File Copy task implementation enables automated file transfer from build artifacts to Azure Storage containers.
Hover over the Azure file copy task type and click Add when it appears. The task will be added to the stage but requires further configuration.
Click the File Copy task to see the required settings. Select the latest task version.
Set the Display Name to Backup website zip file, click the ellipsis beside Source, locate the file as follows, and click OK to select it.
Azure subscription connectivity requires authentication configuration. Service connection implementation provides secure, centralized credential management for pipeline tasks.
Find and select the Azure Resource Manager Service Connection we created from the Azure Subscription drop-down list.
From the Destination Type drop-down list, select Azure Blob, and from the RM Storage Account and Container Name, select the storage account, enter the container's name, then click Save at the top of the screen, OK.
To test the task, click Create release, and in the Create a new release pane, click Create.
Click the new release to view the details.
On the release page, approve the release so that it can continue.
Once the Development stage has been completed, you should see the file in the Azure storage account.
Service connections provide centralized credential management within project settings, eliminating distributed authentication configuration across individual pipeline tasks and ensuring consistent security practices.