Azure DevOps Interview Questions
Azure DevOps Interview Questions
Azure DevOps Interview Questions
Scenario: How does the Azure DevOps CI/CD Pipeline look in your organization?
Scenario: You need to securely store API keys and other secrets used in your pipeline
tasks. How would you ensure their protection while maintaining pipeline functionality?
Answer: Explain using Azure Key Vault to store secrets and access them using
managed identities or service connections with minimal privileges. Emphasize avoiding
hardcoding secrets in the pipeline script.
Scenario: Your application uses Docker containers. How would you integrate ACR with
Azure Pipelines for building, pushing, and deploying container images?
Answer: Describe the process of configuring Docker tasks in the pipeline to build
images, authenticate with ACR using service connections, push images to the registry,
and deploy them to specific environments.
Scenario: Your pipeline consistently fails at a specific stage. How would you approach
troubleshooting and identifying the root cause of the issue?
Answer: Highlight utilizing built-in debugging tools like logs, pipeline diagnostics, and
Azure Monitor, alongside manual code review and environment checks. Mention
potential causes like resource constraints, task configuration errors, or infrastructure
issues.
Scenario: You discover a critical bug in the recently deployed production environment.
How would you leverage Azure Pipelines for a rollback and ensure safe merging of a
fix?
Scenario: Your company has specific infrastructure requirements and needs to run
pipelines on self-hosted machines. How would you leverage Azure Runners for this
purpose?
Scenario: Your team has various roles with different access needs. How would you
configure RBAC within Azure Pipelines to ensure users have appropriate permissions?
Answer: Explain leveraging built-in roles and custom definitions to grant access to
pipelines, repositories, and resources. Highlight the importance of least privilege and
separation of duties principles.
Answer: Discuss using tasks like Azure Resource Manager or Terraform tasks to
manage infrastructure creation and deletion within the pipeline workflow. Mention
benefits like faster deployments and improved consistency.
Scenario: How would you ensure overall security within your Azure Pipelines throughout
the CI/CD process, from code building to deployment?
az vm create \
--resource-group learn-azure-cli \
--name vmName \
--image Ubuntu2204 \
--vnet-name default \
--subnet default \
--generate-ssh-keys \
--output json \
--verbose
Switch to the folder where you have the 01-storage-account.json or similar file
az deployment group create --resource-group vscode --template-file 01-storage-
account.json
01-storage-account.json
{
"$schema":
"https://schema.management.azure.com/schemas/2019-04-01/deploymentTemplate.jso
n#",
"contentVersion": "1.0.0.0",
"parameters": {},
"functions": [],
RESTRICTED
"variables": {},
"resources": [
{
"name": "abhioshekveeramalla11232",
"type": "Microsoft.Storage/storageAccounts",
"apiVersion": "2023-01-01",
"tags": {
"displayName": "abhioshekveeramalla11232"
},
"location": "[resourceGroup().location]",
"kind": "StorageV2",
"sku": {
"name": "Premium_LRS",
"tier": "Premium"
}
}
],
"outputs": {}
}
RESTRICTED
Azure CLI 2.0 cheatsheet for Login, Resources, VMs, Resource groups, Storage,
Batch, and Containers.
## Logging in
az login
```
az account list-locations
```
az resource list
```
```
## Managing VM's
### Start a VM
```
az vm start --resource-group myResourceGroup --name myVM
```
### Stop a VM
```
az vm stop --resource-group myResourceGroup --name myVM
```
### Deallocate a VM
```
### Restart a VM
```
```
### Redeploy a VM
```
RESTRICTED
### Delete a VM
```
az vm delete --resource-group myResourceGroup --name myVM
```
--name bootstrapper
```
RESTRICTED
We can now authenticate directly against the account for further CLI interaction.
```
az batch account login -g myresourcegroup -n mybatchaccount
```
```
### We can check the status of the pool to see when it has finished resizing.
```
### Create a new job to encapsulate the tasks that we want to add.
```
```
az batch task create --job-id myjob --task-id task1 --application-package-references
myapp#1.0
--command-line "/bin/<shell> -c /path/to/script.sh"
```
Now that all the tasks are added - we can update the job so that it will automatically be
marked as completed once all the tasks are finished.
```
az batch job set --job-id myjob --on-all-tasks-complete terminateJob
```
```
## Managing Containers
If you HAVE AN SSH run this to create an Azure Container Service Cluster (~10 mins)
```
If you DO NOT HAVE AN SSH run this to create an Azure Container Service Cluster
(~10 mins)
```
az acs create -n acs-cluster -g acsrg1 -d applink789 --generate-ssh-keys
```
```