Explore key concepts in integrating .NET applications with cloud environments through this Azure-focused quiz. Assess your understanding of cloud services, scalability techniques, authentication, and deployment best practices for cloud-ready .NET apps.
Which type of cloud service should you use to host a .NET web application with automatic scaling and minimal infrastructure management?
Explanation: Platform as a Service (PaaS) enables you to run and scale .NET web applications easily without managing underlying servers. Function as a Resource is not a recognized type, and physical servers require manual management. Manual load balancers do not provide automatic scaling or reduce infrastructure management.
If your .NET application needs to store large objects like images and backups, which storage option is most appropriate?
Explanation: Object Storage is optimized for storing and accessing large binary files such as images and backups. Local file systems are not suitable for cloud scenarios due to limited scalability. RAM is volatile and not intended for persistent storage. Queue storage is used for message passing, not media storage.
How can you securely manage connection strings and API keys in a cloud-ready .NET app?
Explanation: A centralized configuration service allows secure storage and management of sensitive settings like connection strings and API keys. Hard-coding these values makes them difficult to update and insecure. Environment variables in plain text can be exposed easily if not protected. Application logs are not intended for storing confidential data.
Which approach allows a .NET app to handle increasing user demand during traffic spikes?
Explanation: Horizontal scaling involves adding more instances of your application to manage increased load, making it effective for handling spikes. Single-thread processing limits resource utilization. Local debugging is for development, not scaling. Manual restarts do not solve demand problems and may cause downtime.
A .NET app has multiple services needing to communicate reliably and asynchronously. Which integration pattern is most suitable?
Explanation: A message queue enables reliable, asynchronous communication between distributed components, improving scalability and fault tolerance. Direct database writes create tight coupling and possible bottlenecks. Shared static variables don’t work in distributed environments. Synchronous requests can create dependencies and increase latency.
Which method is recommended for authenticating users in a modern cloud-ready .NET web application?
Explanation: Token-based authentication provides a secure and scalable approach for user access in cloud environments. Placing usernames in URL paths is insecure and exposes sensitive information. Plain text passwords are vulnerable during transmission. IP whitelisting alone does not verify user identity.
To prevent failures from affecting a .NET cloud app, which resiliency mechanism should you apply when making external service calls?
Explanation: The circuit breaker pattern prevents an application from trying to invoke an operation likely to fail, increasing overall resilience. Infinite retry loops can overwhelm services and degrade performance. Removing timeouts can cause requests to hang. Hardcoding endpoints makes updates and maintenance difficult.
What is the main reason for separating development, testing, and production environments for a .NET cloud application?
Explanation: Separation enables safe testing and development without impacting the live application, and allows clear deployment processes. Doubling resource usage is a side effect, not a purpose. Changing log file names does not require environment separation. Randomizing IP addresses is unrelated to structured deployments.
Which tool or service feature is essential for tracking performance and errors in cloud-ready .NET apps?
Explanation: Centralized logging collects logs from distributed cloud applications, enabling effective monitoring of performance and issues. Manual spreadsheets are inefficient and not real-time. Local console output is inaccessible for cloud-deployed apps. Ignoring error reports leads to undetected problems.
Which approach simplifies deploying updates to a cloud-hosted .NET application?
Explanation: Continuous Integration and Deployment automates building, testing, and releasing updates, reducing errors and manual effort. FTP uploads are prone to mistakes and lack automation. Stopping services for every update disrupts availability. Unattended schema changes can introduce data risks and downtime.
A .NET cloud app needs to make secure calls to another REST-based API. Which technology should you use?
Explanation: HTTPS requests provide encryption and secure data transfer between the .NET app and external APIs. Unencrypted HTTP exposes sensitive data. Raw sockets lack built-in security and protocol handling. Email is not designed for real-time service integration and can be insecure.
Which method is best for maintaining user sessions in a distributed .NET cloud application?
Explanation: A distributed cache allows session data to be shared across multiple application instances, supporting scaling. Local in-memory sessions are tied to a single instance and cause users to lose state if switched. Appending session data to URLs is risky and potentially insecure. Storing sessions in cookies can exceed size limits and expose data to the client.
How can you reduce user disruption when updating a cloud-ready .NET app?
Explanation: Rolling deployments update one server or instance at a time, allowing users to continue accessing the application without major disruption. Taking the app offline impacts all users. Overwriting live files can cause errors for active sessions. Simultaneously upgrading all servers increases the risk of downtime.
When connecting to cloud-hosted databases from a .NET app, what should you implement to handle temporary connectivity issues?
Explanation: Retry logic with exponential backoff helps applications recover gracefully from transient network failures. Permanently disconnecting discards opportunities for recovery. Endless retry loops can overload networks and databases. Disabling error handling leaves failures unaddressed.
Which component should you use to offload background jobs, like sending emails or processing files, in a cloud-ready .NET app?
Explanation: A background worker service efficiently handles asynchronous operations without blocking the main application. Running tasks on the main UI thread can freeze the application. User requests should not process intensive background work directly. System tray apps are not intended for server-side task processing.
What is a key practice for improving security in a cloud-integrated .NET app?
Explanation: Managed identities allow secure resource access without exposing credentials. Embedding passwords in HTML or disabling authentication makes the app vulnerable. Allowing all IP addresses can lead to unauthorized access and security risks.