TO CREATE A CONNECTION BEWTEEN AZURE AND DEVOPS
Create Active Directiry in Azure
- Searc Azure Active Directory or "Microsoft Entra ID"
- Create New Active Directory
- Reigster your Application for DevOps Connection
- App registrations > New registration
- Name: DevOpsServiceConnection
- Redirect URI: Leave blank (not needed here)
- Create
- App registrations > New registration
- Once created, note the Application (client) ID
- Click Certificates & secrets
- Clilck Tab ‘Federated credentials (1)’
- Click Add Credentails
- Provide name to your credential and click Add
- Click newly crated Certificated for more detail
- Provide following inforamtion
- Issuer (will get while creating sevice connection in devOps **)
- subject (will get while creating sevice connection in devOps **)
- Name (Any Unique name)
Create Service Connnector in DevOps
- Create a Service Connection in Azure DevOps:
- Project Settings > Service connections
- Click on New service connection and select Azure Resource Manager.
- Click Next
- Copy Issuer and Subject from here and user while creating Federated credentials above **
- Verify and save
- New Connection with Azure Account and is reflecting in Service Connection listing
Assign Role and Permissino to our subscriptino at Azure to make communication with DevOps
- Verify Service Principal Permission usind Azure CLI
az role assignment list --assignee <your-client-ID> - Refresh Credentials – If permissions were recently updated, log out and back in or refresh your credentials by running:
az account clear
az login
Permission to Application
- If No Role is assigned so for, Assigned At least Reader
az role assignment create --assignee <your-client-ID> --role "Reader" --scope "/subscriptions/<subscriptionid>" - For writing or creating create role for contributor
az role assignment create --assignee <your-client-ID> --role "Contributor" --scope "/subscriptions/<subscriptionid>" - After assing check once more by runing
az role assignment list --assignee <your-client-ID>
Test Service Connection at DevOps
- At second step while creating Service connection at devOps click ‘Verify and save’
- This time its varifield and you can see new service connection in the list or Service Connection at DevOps