CI/CD for ASP.NET apps using Azure or GitHub Actions MCQs ASP.NET

What is the primary purpose of Continuous Integration (CI) in software development?
A. To automate the deployment process
B. To automatically build and test code changes
C. To manage application configurations
D. To monitor application performance
Answer: B

Which Azure service is commonly used for CI/CD pipelines for ASP.NET applications?
A. Azure DevOps
B. Azure Key Vault
C. Azure Blob Storage
D. Azure Functions
Answer: A

What is the role of a build pipeline in Azure DevOps?
A. To compile code, run tests, and produce artifacts
B. To deploy applications to production
C. To manage application secrets
D. To monitor application health
Answer: A

Which file defines the CI/CD process in GitHub Actions?
A. main.yml
B. build.yml
C. azure-pipelines.yml
D. workflow.yml
Answer: D

In GitHub Actions, which action allows you to set up .NET Core in a pipeline?
A. actions/setup-dotnet
B. actions/setup-dotnetcore
C. dotnet/setup
D. dotnet-core/setup
Answer: A

What is a “pipeline” in Azure DevOps?
A. A set of automated steps to build, test, and deploy code
B. A tool for managing user access
C. A service for monitoring application performance
D. A feature for creating virtual machines
Answer: A

What is the purpose of the dotnet build command in a CI/CD pipeline?
A. To compile the application code
B. To run unit tests
C. To deploy the application
D. To restore NuGet packages
Answer: A

Which Azure DevOps service is used for tracking work items and bugs?
A. Azure Boards
B. Azure Repos
C. Azure Pipelines
D. Azure Test Plans
Answer: A

In GitHub Actions, how can you trigger a workflow manually?
A. By using the workflow_dispatch event
B. By creating a pull request
C. By pushing code to the repository
D. By using the push event
Answer: A

What is a “stage” in Azure Pipelines?
A. A logical grouping of jobs that run sequentially
B. A type of build agent
C. A specific environment for deployment
D. A version control branch
Answer: A

Which Azure service allows you to store and manage code repositories?
A. Azure Repos
B. Azure Artifacts
C. Azure DevTest Labs
D. Azure Logic Apps
Answer: A

In GitHub Actions, what is the purpose of the jobs key in a workflow file?
A. To define a set of steps that run sequentially or in parallel
B. To specify the build environment
C. To configure deployment settings
D. To define environment variables
Answer: A

What is the use of Azure Pipelines YAML in CI/CD?
A. To define build and release pipelines in a text-based format
B. To create Azure virtual machines
C. To manage database connections
D. To monitor application performance
Answer: A

How can you ensure that only tested code is deployed in a CI/CD pipeline?
A. By using automated tests as part of the build pipeline
B. By manually reviewing code before deployment
C. By using separate deployment scripts
D. By limiting the number of build agents
Answer: A

Which GitHub Actions event is triggered when code is pushed to a repository?
A. push
B. pull_request
C. workflow_dispatch
D. schedule
Answer: A

In Azure DevOps, what is a “build artifact”?
A. The output produced by a build process, such as binaries or packages
B. A file that stores build logs
C. A configuration file for the build pipeline
D. A container image
Answer: A

What is the purpose of the dotnet test command in a CI/CD pipeline?
A. To run unit tests for the application
B. To build the application code
C. To deploy the application
D. To restore NuGet packages
Answer: A

How can you deploy an ASP.NET application to Azure App Service using Azure Pipelines?
A. By configuring a deployment task in the pipeline
B. By using FTP
C. By manually uploading files via the Azure portal
D. By creating a new virtual machine
Answer: A

What is the matrix strategy used for in GitHub Actions?
A. To run multiple configurations of a job in parallel
B. To define environment variables
C. To manage job dependencies
D. To set up the build environment
Answer: A

Which Azure DevOps component helps you manage secrets and sensitive data?
A. Azure Key Vault
B. Azure Boards
C. Azure Artifacts
D. Azure Pipelines
Answer: A

How can you specify environment-specific configurations in a GitHub Actions workflow?
A. By using environment variables and secrets
B. By creating separate workflows for each environment
C. By modifying the Dockerfile
D. By setting build parameters in the pipeline
Answer: A

What is a “release pipeline” in Azure DevOps?
A. A set of automated steps to deploy code to various environments
B. A tool for tracking work items
C. A service for managing code repositories
D. A feature for monitoring application health
Answer: A

In GitHub Actions, what is the purpose of the actions/checkout action?
A. To check out the code from the repository
B. To set up the .NET Core environment
C. To build the Docker image
D. To deploy the application
Answer: A

Which Azure DevOps feature allows you to manage and share NuGet packages?
A. Azure Artifacts
B. Azure Boards
C. Azure Repos
D. Azure Pipelines
Answer: A

How can you set up continuous deployment (CD) in GitHub Actions?
A. By configuring a deployment job in the workflow file
B. By setting up webhooks in the repository
C. By manually deploying after successful builds
D. By using Azure DevOps for deployment
Answer: A

What is the purpose of the trigger section in a GitHub Actions workflow file?
A. To define when the workflow should be triggered
B. To specify the build environment
C. To configure deployment settings
D. To set up environment variables
Answer: A

How can you ensure that CI/CD pipelines run in a specific order using Azure Pipelines?
A. By defining dependencies between stages
B. By using parallel jobs
C. By manually starting each pipeline
D. By using separate build agents
Answer: A

Which Azure service can be used for managing release deployments and approvals?
A. Azure Pipelines
B. Azure Boards
C. Azure Repos
D. Azure Test Plans
Answer: A

In GitHub Actions, how can you limit the number of concurrent jobs?
A. By configuring the concurrency key in the workflow file
B. By setting job priorities
C. By using multiple workflow files
D. By adjusting the build agent configuration
Answer: A

What is a “build pipeline” in GitHub Actions?
A. A set of automated steps to build, test, and package code
B. A service for managing build artifacts
C. A tool for monitoring application performance
D. A feature for managing code branches
Answer: A

How can you implement rollback functionality in Azure DevOps?
A. By configuring release approvals and deployment gates
B. By using separate deployment scripts
C. By manually reverting code changes
D. By creating backup copies of deployments
Answer: A

What is the purpose of the checkout step in a GitHub Actions workflow?
A. To fetch the code from the repository before running the build
B. To deploy the application
C. To run unit tests
D. To set up the build environment
Answer: A

Which GitHub Actions feature allows you to reuse workflows across multiple repositories?
A. Reusable workflows
B. Workflow templates
C. Shared actions
D. Repository secrets
Answer: A

How can you test an Azure DevOps pipeline before deploying to production?
A. By deploying to a staging environment first
B. By using manual triggers
C. By reviewing build logs
D. By creating a new pipeline for testing
Answer: A

What does the name field in a GitHub Actions workflow file specify?
A. The name of the workflow
B. The name of the build environment
C. The name of the repository
D. The name of the job
Answer: A

How can you manage build versions and release notes in Azure DevOps?
A. By using build and release definitions with versioning policies
B. By manually updating version numbers
C. By creating separate repositories for each version
D. By using Git tags
Answer: A

What does the steps section in a GitHub Actions workflow file define?
A. A series of actions and commands to be executed sequentially
B. The build environment settings
C. The trigger events for the workflow
D. The configuration for deployment jobs
Answer: A

How can you secure sensitive data in a GitHub Actions workflow?
A. By using encrypted secrets
B. By storing data in environment variables
C. By keeping data in the repository
D. By using plaintext configuration files
Answer: A

Which Azure service helps in managing application settings and connection strings for ASP.NET apps?
A. Azure App Configuration
B. Azure Key Vault
C. Azure Blob Storage
D. Azure Monitor
Answer: A

What is the deployment phase in a CI/CD pipeline?
A. The phase where the application is deployed to a staging or production environment
B. The phase where the code is built and tested
C. The phase where application configurations are managed
D. The phase where performance monitoring is set up
Answer: A

How can you define environment-specific variables in GitHub Actions?
A. By using environment files or secrets in the workflow configuration
B. By modifying the application code directly
C. By setting variables in the Dockerfile
D. By creating multiple workflow files for each environment
Answer: A

What is the purpose of the release pipeline in Azure DevOps?
A. To automate the deployment process to various environments
B. To build and test application code
C. To manage user permissions and roles
D. To monitor application performance
Answer: A

In GitHub Actions, which key is used to define the environment for a job?
A. runs-on
B. env
C. strategy
D. steps
Answer: A

How can you monitor and troubleshoot CI/CD pipeline issues in Azure DevOps?
A. By using pipeline logs and diagnostics tools
B. By manually checking application performance
C. By updating the pipeline configuration
D. By restarting the build agent
Answer: A

What is the role of the build phase in a CI/CD pipeline?
A. To compile the source code and create build artifacts
B. To deploy the application to production
C. To monitor application performance
D. To manage configuration settings
Answer: A

In GitHub Actions, how do you manage dependencies between jobs?
A. By using the needs keyword
B. By defining job names
C. By setting job priorities
D. By configuring environment variables
Answer: A

What is a “self-hosted agent” in Azure DevOps?
A. An agent that runs on your own hardware or virtual machines
B. A build agent provided by Azure DevOps
C. A containerized build agent
D. An agent that handles deployment tasks
Answer: A

How can you automatically trigger a pipeline when changes are pushed to a specific branch in GitHub Actions?
A. By configuring the on key with the push event and specifying the branch
B. By setting up a manual trigger
C. By scheduling the pipeline to run at regular intervals
D. By using the workflow_dispatch event
Answer: A

What is a “task” in an Azure DevOps build pipeline?
A. A unit of work that performs a specific action, such as building or testing code
B. A configuration file for the pipeline
C. A service for managing build artifacts
D. A feature for monitoring application performance
Answer: A

How can you ensure a consistent build environment across different CI/CD pipelines?
A. By using Docker containers or virtual machines with the same configuration
B. By manually setting up environments for each pipeline
C. By using different build agents for each pipeline
D. By configuring build settings in the application code
Answer: A

What is the purpose of the matrix strategy in GitHub Actions?
A. To run jobs with different configurations or versions in parallel
B. To set up environment variables
C. To manage job dependencies
D. To configure deployment settings
Answer: A

In Azure Pipelines, what is the purpose of deployment gates?
A. To control and approve deployments to specific environments
B. To manage build artifacts
C. To monitor application performance
D. To configure environment variables
Answer: A

How can you define a specific version of the .NET SDK to use in a GitHub Actions workflow?
A. By using the actions/setup-dotnet action and specifying the version
B. By setting the SDK version in the Dockerfile
C. By modifying the application configuration
D. By using environment variables
Answer: A

What is the purpose of the variables section in an Azure DevOps pipeline?
A. To define and manage environment-specific settings and values
B. To specify build tasks and actions
C. To configure deployment stages
D. To set up monitoring and diagnostics
Answer: A

How can you automate the testing of ASP.NET applications in a CI/CD pipeline?
A. By including dotnet test as part of the build process
B. By manually running tests before deployment
C. By using separate testing scripts
D. By deploying to a test environment and running tests manually
Answer: A

In GitHub Actions, how do you specify conditions for when a job should run?
A. By using the if key in the job definition
B. By setting environment variables
C. By configuring the on key
D. By using the jobs key
Answer: A

What is the purpose of Azure DevOps Service Connections?
A. To manage connections to external services and resources, such as Azure or GitHub
B. To configure deployment environments
C. To monitor application performance
D. To manage build agents
Answer: A

How can you deploy an ASP.NET application to Azure Kubernetes Service (AKS) using Azure DevOps?
A. By creating a Kubernetes deployment manifest and configuring a deployment pipeline
B. By using Azure App Service
C. By deploying directly from the Azure portal
D. By using Docker Swarm
Answer: A

What is the function of the checkout step in GitHub Actions workflows?
A. To fetch the source code from the repository for the workflow
B. To deploy the application
C. To run tests
D. To build Docker images
Answer: A

How can you integrate code quality checks into an Azure DevOps pipeline?
A. By adding tasks for static code analysis and linting
B. By manually reviewing code changes
C. By using separate code review tools
D. By setting up additional build agents
Answer: A

In GitHub Actions, what does the workflow_dispatch event allow you to do?
A. Manually trigger a workflow
B. Automatically trigger a workflow on code changes
C. Schedule workflows to run at specific times
D. Configure workflow dependencies
Answer: A

How can you use Azure DevOps to manage deployments to multiple environments (e.g., staging, production)?
A. By creating separate stages in the release pipeline for each environment
B. By using multiple pipelines for each environment
C. By manually deploying to each environment
D. By using environment-specific configurations in the code
Answer: A

What does the env key specify in a GitHub Actions workflow?
A. Environment variables to be used in jobs and steps
B. The build environment
C. The name of the workflow
D. The version of GitHub Actions
Answer: A

How can you secure sensitive data in GitHub Actions workflows?
A. By using GitHub Secrets
B. By storing data in plaintext files
C. By using environment variables
D. By including secrets directly in the workflow file
Answer: A

In Azure DevOps, what is the role of deployment groups?
A. To manage and organize machines that run deployment tasks
B. To configure build agents
C. To monitor application health
D. To store build artifacts
Answer: A

What is a “job” in GitHub Actions workflows?
A. A set of steps that run on the same runner
B. A configuration for environment settings
C. A deployment script
D. A build agent
Answer: A

How can you view detailed logs and history of pipeline runs in Azure DevOps?
A. By navigating to the pipeline run details and logs section in Azure DevOps
B. By using external monitoring tools
C. By checking the build agent logs
D. By reviewing deployment reports
Answer: A

What does the with keyword specify in GitHub Actions steps?
A. Input parameters for an action
B. The environment variables
C. The build settings
D. The job dependencies
Answer: A

How can you ensure a consistent build environment in Azure DevOps?
A. By using Docker containers or virtual machines with defined configurations
B. By manually setting up build environments
C. By using different build agents for each pipeline
D. By configuring environment variables in the code
Answer: A

Which GitHub Actions feature allows for conditional execution of steps?
A. The if conditional expression
B. The when keyword
C. The depends_on key
D. The condition setting
Answer: A

How can you roll back a deployment in Azure DevOps?
A. By using deployment gates and approvals to deploy a previous version
B. By manually reverting code changes
C. By creating a new pipeline for each deployment
D. By using separate environments for testing
Answer: A

What is the purpose of the run key in a GitHub Actions step?
A. To specify the command or script to be executed
B. To define environment variables
C. To set up job dependencies
D. To configure the build environment
Answer: A

How can you automate the deployment of Docker containers in Azure DevOps?
A. By creating a pipeline that builds and pushes Docker images to a container registry
B. By manually deploying containers from the Azure portal
C. By using a different CI/CD tool
D. By deploying directly to a virtual machine
Answer: A

In GitHub Actions, what is the role of steps within a job?
A. To define the sequence of actions and commands executed in the job
B. To configure job dependencies
C. To specify the build environment
D. To set up environment variables
Answer: A

How can you set up automatic testing of your ASP.NET application in Azure DevOps?
A. By including test tasks in the build pipeline
B. By manually running tests before deployment
C. By creating separate pipelines for testing
D. By deploying to a test environment and running tests manually
Answer: A

What is a “self-hosted runner” in GitHub Actions?
A. A runner that is hosted on your own hardware or virtual machines
B. A runner provided by GitHub
C. A runner that handles deployment tasks
D. A runner used for managing repositories
Answer: A

How can you automate the build and deployment of a Dockerized ASP.NET application using GitHub Actions?
A. By defining Docker build and push steps in the workflow file
B. By using separate deployment scripts
C. By manually building and pushing Docker images
D. By deploying directly from the Azure portal
Answer: A

What is a “deployment trigger” in Azure DevOps?
A. An event or condition that starts a deployment process
B. A setting for configuring build agents
C. A service for managing code repositories
D. A feature for monitoring application performance
Answer: A

In GitHub Actions, how can you limit the concurrency of a workflow?
A. By using the concurrency key in the workflow file
B. By setting job priorities
C. By configuring environment variables
D. By creating multiple workflow files
Answer: A

What does the runs-on key specify in a GitHub Actions workflow?
A. The type of runner or environment to execute the job
B. The build and deployment settings
C. The job dependencies
D. The sequence of actions to be executed
Answer: A

How can you implement conditional deployment in Azure DevOps?
A. By using deployment gates and approval processes
B. By manually configuring deployment settings
C. By using separate pipelines for different environments
D. By setting up environment variables in the code
Answer: A

What is the purpose of Azure Pipelines templates?
A. To define reusable pipeline configurations for different projects
B. To manage build artifacts
C. To monitor application performance
D. To create Docker images
Answer: A

In GitHub Actions, what does the workflow key define?
A. The overall configuration and steps for the CI/CD process
B. The build environment settings
C. The deployment configuration
D. The sequence of jobs
Answer: A

How can you ensure that code quality checks are included in a CI/CD pipeline?
A. By incorporating static analysis and linting tools into the build process
B. By manually reviewing code changes
C. By using separate quality assurance tools
D. By limiting the number of build agents
Answer: A