
Hello Everyone, Welcome to the new blog of Azure today we learn about the service connection in Azure.
Introduction
Service Connection in Azure DevOps is used to provide the connection between external services
like Kubernetes, Docker, GitHub and many more.
It can be used to authenticate with these external services so that it can be utilised to create and update resources in the cloud of Azure.
Service Connection needs to have the proper permission to access the particular resource and perform the task.
Secure Service Connection
To achieve security in connections, we need to follow certain methods:
- User Permissions: It can be achieved by ensuring that only the right users have permission to create, update views and manage them,
- Pipeline level Permissions: This can be achieved by approving or permitting the Azure Pipelines to access the
connection. - Project Permissions: This can be achieved by configuring certain Azure DevOps
projects.
It is important to manage the connections by removing the connection after completion of the work so that it
doesn’t lead to security breaches.
Here, providing you with the example of a connections list so that we can delete them after the requirement is complete.
pool:
vmImage: ubuntu-latest
steps:
- task: AzureCLI@2
inputs:
azureSubscription: 'Name of Service Connection'
scriptType: 'pscore'
scriptLocation: 'inlineScript'
inlineScript: |
$resources = az resource list
foreach ($resource in $resources) {
az resource delete --ids $resource.id
}
Conclusion
Here comes to the end of this blog but stay tuned as we are going to come with more insights on this topic and creation through terraform modules.
As it is a huge topic to explain to you all the necessities required in the connection to perform we will continue this blog to the next one.
So, follow for more and stay connected by clicking here.