Ngân hàng đề — Microsoft Azure Developer
Tìm thấy 409 câu.
After you answer a question in this section, you will NOT be able to return to it. As a result, these questions will not appear in the review screen.
You are developing an Azure solution to collect point-of-sale (POS) device data from 2,000 stores located throughout the world. A single device can produce 2 megabytes (MB) of data every 24 hours. Each store location has one to five devices that send data.
You must store the device data in Azure Blob storage. Device data must be correlated based on a device identifier. Additional stores are expected to open in the future.
You need to implement a solution to receive the device data.
Solution: Provision an Azure Notification Hub. Register all devices with the hub.
Does the solution meet the goal?
- A Yes
- B No
Xem giải thích
🧩 Phân tích chi tiết nội dung câu hỏi
Câu hỏi thuộc dạng case study trong kỳ thi chứng chỉ Azure (có thể là AZ-204 hoặc tương tự), nơi mô tả một kịch bản kinh doanh và yêu cầu đánh giá xem giải pháp đề xuất có đạt được mục tiêu hay không. Kịch bản cụ thể:
- Bạn đang phát triển giải pháp Azure để thu thập dữ liệu từ thiết bị POS (Point-of-Sale) tại 2.000 cửa hàng trên toàn thế giới.
- Mỗi thiết bị tạo ra 2 MB dữ liệu mỗi 24 giờ.
- Mỗi cửa hàng có 1-5 thiết bị, dữ liệu cần được tương quan (correlated) dựa trên device identifier.
- Dữ liệu phải lưu trữ trong Azure Blob Storage.
- Hệ thống cần mở rộng vì có thêm cửa hàng mới trong tương lai.
- Giải pháp đề xuất: Triển khai Azure Notification Hubs, đăng ký tất cả thiết bị vào hub.
- Câu hỏi: Giải pháp này có đạt mục tiêu (receive và lưu trữ dữ liệu thiết bị vào Blob Storage) không?
Mục tiêu chính 📈: Xây dựng hệ thống nhận dữ liệu từ thiết bị (không chỉ gửi thông báo), lưu trữ vào Blob Storage, hỗ trợ tương quan dữ liệu và scale lớn (hàng nghìn thiết bị).
🛠️ Kiến thức Azure cập nhật đến 2026: Azure Notification Hubs (phiên bản mới nhất hỗ trợ telemetry và tags cải tiến) chủ yếu dùng cho push notifications (gửi thông báo đến app/device), KHÔNG phải để nhận và lưu trữ dữ liệu lớn từ thiết bị. Để thu thập dữ liệu IoT/POS, nên dùng Azure IoT Hub hoặc Event Hubs kết hợp Blob Storage (theo docs Azure 2024-2026).
📘 Tài liệu tham khảo:
- Azure Notification Hubs documentation (xác nhận chỉ hỗ trợ gửi, không nhận data storage).
- Azure IoT Hub for device telemetry (giải pháp đúng cho telemetry ingestion).
- AZ-204 exam guide (Microsoft Learn, cập nhật 2025).
✅ Đáp án đúng: No
Lý do lựa chọn ✅: Giải pháp KHÔNG đạt mục tiêu vì Azure Notification Hubs chỉ dùng để gửi push notifications từ server đến thiết bị (mobile/web apps), không hỗ trợ nhận dữ liệu telemetry từ thiết bị và lưu trữ vào Blob Storage. Không có cơ chế tương quan device ID hoặc scale cho dữ liệu 2MB/ngày/thiết bị từ 2.000+ cửa hàng. Giải pháp đúng nên là Azure IoT Hub (hỗ trợ device-to-cloud messages, routing trực tiếp vào Blob Storage via built-in endpoints).
📋 Giải thích tất cả các phương án
-
Yes ❌
Sai vì: Phương án này cho rằng Notification Hubs có thể nhận và xử lý dữ liệu thiết bị, nhưng thực tế Notification Hubs chỉ dùng để gửi notifications (như alerts đến app), không ingest dữ liệu vào storage. Không hỗ trợ correlation device ID hay lưu Blob. Scale cho 10.000+ devices chỉ dành cho gửi, không nhận data lớn (2MB/ngày x 2.000 stores = ~4TB/năm). -
No ✅
Đúng vì: Giải pháp đề xuất không phù hợp với yêu cầu "receive the device data" và lưu Blob Storage. Notification Hubs thiếu tính năng telemetry ingestion, device twin cho correlation ID, và routing rules vào storage. Theo best practices Azure IoT (2026), dùng IoT Hub + Stream Analytics hoặc Event Hubs để xử lý chính xác.
Event Hub. Each retailer is given a unique identifier that is used as the primary identifier for the loyalty program.
Retailers must be able to be added or removed at any time. Retailers must only be able to record sales for themselves.
You need to ensure that retailers can record sales.
What should you do?
- A Use publisher policies for retailers.
- B Create a partition for each retailer.
- C Define a namespace for each retailer.
Xem giải thích
🧩 Phân tích chi tiết nội dung câu hỏi
Câu hỏi mô tả một chương trình khách hàng thân thiết (loyalty program) cho một nhà sản xuất snack lớn. Khi khách hàng mua snack tại bất kỳ một trong 100 nhà bán lẻ tham gia, sự kiện mua hàng sẽ được ghi nhận vào Azure Event Hub. Mỗi nhà bán lẻ có một unique identifier làm định danh chính cho chương trình.
Yêu cầu chính:
- 🛒 Nhà bán lẻ có thể được thêm hoặc xóa bất kỳ lúc nào.
- 🔒 Mỗi nhà bán lẻ chỉ được phép ghi nhận doanh số bán hàng của chính mình (không được phép ghi nhận cho nhà bán lẻ khác).
- Mục tiêu: Đảm bảo nhà bán lẻ có thể ghi nhận doanh số bán hàng một cách an toàn và cô lập.
Vấn đề cốt lõi là xác thực và ủy quyền publisher (người gửi sự kiện) trong Azure Event Hubs, để tránh tình trạng một nhà bán lẻ giả mạo dữ liệu của nhà bán lẻ khác, đồng thời hỗ trợ số lượng lớn (100+) nhà bán lẻ động.
📘 Tài liệu tham khảo:
- Azure Event Hubs - Publisher authorizations (cập nhật mới nhất 2024-2026, hỗ trợ SAS tokens scoped per publisher).
- Azure Event Hubs authentication and authorization (phiên bản Event Hubs Premium/Standard với tính năng publisher policies).
✅ Đáp án đúng: Use publisher policies for retailers
Lý do lựa chọn:
- Publisher policies (hay còn gọi là Publisher Authorizations) trong Azure Event Hubs cho phép tạo chính sách ủy quyền riêng biệt cho từng publisher dựa trên unique identifier (như tên publisher hoặc SAS token scoped).
- 🛡️ Mỗi nhà bán lẻ nhận một SAS token riêng (Shared Access Signature), chỉ cho phép họ publish events với publisher name khớp với ID của mình. Điều này đảm bảo cô lập hoàn toàn – nhà bán lẻ A không thể publish dưới tên nhà bán lẻ B.
- ➕ Hỗ trợ thêm/xóa động: Token hết hạn tự động hoặc revoke dễ dàng mà không ảnh hưởng toàn bộ hệ thống.
- ⚡ Phù hợp với quy mô 100+ nhà bán lẻ, không cần thay đổi cấu trúc Event Hub (partitions hay namespaces).
- Đây là best practice theo docs Azure mới nhất (2024+), đặc biệt với Event Hubs Premium hỗ trợ identity-based auth.
🔍 Giải thích tất cả các phương án
-
✅ Use publisher policies for retailers
🟢 Đúng: Như giải thích trên, đây là giải pháp chính xác nhất để ủy quyền per-publisher, đảm bảo an toàn, linh hoạt và scalable. Không cần cấu hình phức tạp, chỉ cần generate SAS token per retailer ID. -
❌ Create a partition for each retailer
🔴 Sai: Partitions trong Event Hubs là để phân phối throughput và ordering (tối đa 32 partitions/Event Hub), không dùng để ủy quyền hoặc cô lập publisher. Tạo 100 partitions là không khả thi (vượt giới hạn), gây lãng phí tài nguyên và không ngăn chặn publisher giả mạo (ai cũng có thể gửi vào partition bất kỳ nếu có quyền). -
❌ Define a namespace for each retailer
🔴 Sai: Namespace là container cấp cao chứa nhiều Event Hubs (chi phí cao, quản lý phức tạp với 100 namespaces). Không giải quyết vấn đề ủy quyền per-retailer (tất cả publisher vẫn cần key chung trong namespace), và thêm/xóa namespace rất chậm, không phù hợp quy mô động.
You develop a stateful ASP.NET Core 2.1 web application named PolicyApp and deploy it to an Azure App Service Web App. The PolicyApp reacts to events from
Azure Event Grid and performs policy actions based on those events.
You have the following requirements:
✑ Authentication events must be used to monitor users when they sign in and sign out.
✑ All authentication events must be processed by PolicyApp.
✑ Sign outs must be processed as fast as possible.
What should you do?
- A Create a new Azure Event Grid subscription for all authentication events. Use the subscription to process sign-out events.
- B Create a separate Azure Event Grid handler for sign-in and sign-out events.
- C Create separate Azure Event Grid topics and subscriptions for sign-in and sign-out events.
- D Add a subject prefix to sign-out events. Create an Azure Event Grid subscription. Configure the subscription to use the subjectBeginsWith filter.
Xem giải thích
🧩 Phân tích chi tiết nội dung câu hỏi
Câu hỏi mô tả một ứng dụng PolicyApp được phát triển bằng ASP.NET Core 2.1 (stateful web app), triển khai trên Azure App Service Web App. Ứng dụng này phản ứng với các sự kiện từ Azure Event Grid để áp dụng chính sách quản trị (governance policies) cho dịch vụ nội bộ/ngoại bộ và ứng dụng.
Yêu cầu chính (requirements):
- ✅ Sử dụng authentication events để giám sát (monitor) người dùng khi sign in (đăng nhập) và sign out (đăng xuất).
- ✅ Tất cả authentication events phải được xử lý bởi PolicyApp.
- ⚡ Sign-out events phải được xử lý nhanh nhất có thể (as fast as possible).
Bối cảnh kỹ thuật (dựa trên Azure Event Grid phiên bản mới nhất đến 2026):
- Azure Event Grid là dịch vụ pub/sub (publish/subscribe) cho events, hỗ trợ topics (nơi publish events) và subscriptions (để route events đến handler như Web App).
- Authentication events thường đến từ Azure AD (nay là Microsoft Entra ID), có thể được route qua Event Grid.
- Để xử lý nhanh sign-out (ví dụ: thu hồi session ngay lập tức), cần tách biệt luồng xử lý để tránh backlog từ sign-in events (sign-in thường nhiều hơn, có thể gây delay).
📘 Tài liệu tham khảo:
- Azure Event Grid documentation (cập nhật 2024-2026: hỗ trợ advanced filtering, multiple topics/subscriptions cho priority routing).
- Event Grid with Azure AD events.
✅ Đáp án đúng
Create separate Azure Event Grid topics and subscriptions for sign-in and sign-out events.
Lý do lựa chọn:
- 🛠️ Phương án này tách biệt hoàn toàn topics (sign-in topic riêng, sign-out topic riêng) và subscriptions tương ứng dẫn đến PolicyApp.
- Điều này cho phép scale độc lập (ví dụ: scale up subscription sign-out để xử lý nhanh, tránh delay từ sign-in events đông đúc).
- Đảm bảo tất cả events đều đến PolicyApp (qua 2 subscriptions riêng), và sign-out được ưu tiên tốc độ cao nhất bằng cách routing trực tiếp, không chia sẻ queue/resources.
- Phù hợp best practice Azure Event Grid: Sử dụng multiple topics để decouple workloads (xem docs Event Grid routing).
❌ Phân tích tất cả các phương án
-
SAI: Create a new Azure Event Grid subscription for all authentication events. Use the subscription to process sign-out events.
- ❌ Lý do sai: Tạo một subscription chung cho tất cả auth events sẽ khiến sign-out events bị xử lý cùng luồng với sign-in (có thể backlog lớn từ sign-in). Không đảm bảo "sign-out as fast as possible" vì không tách biệt scale/priority. PolicyApp nhận tất cả nhưng thiếu tốc độ cho sign-out.
-
SAI: Create a separate Azure Event Grid handler for sign-in and sign-out events.
- ❌ Lý do sai: "Handler" chỉ là endpoint nhận events (như PolicyApp URL). Tạo handler riêng không giải quyết routing gốc – events vẫn từ một topic/subscription chung, dẫn đến delay tương tự. Event Grid không hỗ trợ "separate handlers" mà không có topics/subs riêng (handler chỉ là target của subscription).
-
ĐÚNG: Create separate Azure Event Grid topics and subscriptions for sign-in and sign-out events.
- ✅ Lý do đúng: Như đã giải thích ở trên. Topics riêng (publish sign-in vào topic A, sign-out vào topic B), subscriptions riêng route đến PolicyApp. Đảm bảo tất cả events được xử lý, sign-out siêu nhanh nhờ independent scaling (Azure tự động scale subscriptions). Hỗ trợ full requirements!
-
SAI: Add a subject prefix to sign-out events. Create an Azure Event Grid subscription. Configure the subscription to use the subjectBeginsWith filter.
- ❌ Lý do sai: Sử dụng filter subjectBeginsWith (advanced filtering của Event Grid) chỉ lọc events tại subscription, nhưng vẫn một subscription chung cho tất cả auth events → sign-out vẫn có nguy cơ delay từ sign-in (filter chỉ route subset, không scale riêng). Không tách biệt topics nên kém hiệu quả cho "fast as possible". Phù hợp filter đơn giản, không phải priority high-volume.
Azure Blob storage account. All resources are secured by using Azure Active Directory (Azure AD).
The Azure Logic app must securely access the Azure Blob storage account. Azure AD resources must remain if the Azure Logic app is deleted.
You need to secure the Azure Logic app.
What should you do?
- A Create a user-assigned managed identity and assign role-based access controls.
- B Create an Azure AD custom role and assign the role to the Azure Blob storage account.
- C Create an Azure Key Vault and issue a client certificate.
- D Create a system-assigned managed identity and issue a client certificate.
- E Create an Azure AD custom role and assign role-based access controls.
Xem giải thích
🧩 Phân tích chi tiết nội dung câu hỏi
Câu hỏi tập trung vào việc bảo mật Azure Logic App để truy cập an toàn vào Azure Blob Storage account. Các yếu tố chính bao gồm:
- Azure Logic App gọi Azure Function App (có OpenAPI/Swagger) và sử dụng Azure Blob Storage.
- Tất cả tài nguyên được bảo mật bằng Azure Active Directory (Azure AD) (nay là Microsoft Entra ID).
- Yêu cầu: Logic App phải truy cập Blob Storage an toàn, và các tài nguyên Azure AD phải tồn tại ngay cả khi Logic App bị xóa.
- Mục tiêu: Secure the Azure Logic App một cách phù hợp với các ràng buộc trên.
🛠️ Vấn đề cốt lõi: Cần cơ chế xác thực không phụ thuộc vào Logic App (để tránh mất quyền khi xóa app), sử dụng Managed Identity kết hợp RBAC (Role-Based Access Control) để cấp quyền truy cập Blob Storage mà không cần secret/key thủ công. Điều này phù hợp với best practice Azure bảo mật (zero-trust model) cập nhật đến năm 2026.
📘 Tài liệu tham khảo:
- Azure Managed Identities (Microsoft Entra ID docs, cập nhật 2024-2026).
- Secure Logic Apps with Managed Identities (Azure Logic Apps security guide).
- RBAC for Storage (Azure Storage security, phiên bản mới nhất).
✅ Đáp án đúng và lý do lựa chọn
Đáp án đúng: Create a user-assigned managed identity and assign role-based access controls.
Lý do 🏆:
- User-assigned Managed Identity là identity độc lập (tồn tại riêng biệt với Logic App), có thể assign cho nhiều resources, và không bị xóa khi Logic App bị delete – đáp ứng yêu cầu "Azure AD resources must remain".
- Kết hợp RBAC (ví dụ: Storage Blob Data Contributor role) để cấp quyền chính xác cho identity truy cập Blob Storage.
- An toàn, không cần quản lý secret, tích hợp native với Azure AD/Entra ID. Đây là best practice từ Microsoft cho hybrid workloads như Logic App + Function + Storage (cập nhật 2026).
🧪 Giải thích tất cả các phương án (đúng/sai)
-
✅ Create a user-assigned managed identity and assign role-based access controls.
Đúng vì: Như phân tích trên, user-assigned MI độc lập, kết hợp RBAC cấp quyền granular cho Blob access. Hoàn hảo cho scenario này, tránh downtime khi delete Logic App. (Best practice từ docs Azure 2026). -
❌ Create an Azure AD custom role and assign the role to the Azure Blob storage account.
Sai vì: RBAC roles phải assign cho principal (như identity/user), không assign trực tiếp cho resource như Blob storage account. Cách này vi phạm nguyên tắc RBAC và không secure Logic App truy cập. -
❌ Create an Azure Key Vault and issue a client certificate.
Sai vì: Key Vault + client cert là cách cũ kỹ, yêu cầu rotate cert thủ công, không tự động như Managed Identity. Không đáp ứng yêu cầu "resources remain if Logic App deleted" và phức tạp hơn cần thiết cho Azure-native auth. -
❌ Create a system-assigned managed identity and issue a client certificate.
Sai vì: System-assigned MI gắn chặt với Logic App (bị xóa khi app delete), vi phạm yêu cầu. Hơn nữa, MI không cần "issue client certificate" – nó dùng token OIDC tự động, cert là redundant và không đúng practice. -
❌ Create an Azure AD custom role and assign role-based access controls.
Sai vì: Tạo custom role có thể dùng, nhưng câu hỏi cần secure Logic App cụ thể qua identity. Không chỉ rõ assign cho principal nào (như MI), và built-in roles (như Storage Blob Data Reader) thường đủ, custom role chỉ dùng khi cần granular cao – không phải giải pháp chính.
In case of an Azure data center outage, metadata loss must be kept to a minimum.
You need to configure the Azure Redis cache instance.
Which two actions should you perform? Each correct answer presents part of the solution.
NOTE: Each correct selection is worth one point.
- A Configure Azure Redis with AOF persistence.
- B Configure Azure Redis with RDB persistence.
- C Configure second storage account for persistence.
- D Set backup frequency to the minimum value.
Xem giải thích
🧩 Phân tích chi tiết câu hỏi
📖 Nội dung câu hỏi:
Câu hỏi thuộc chủ đề cấu hình Azure Cache for Redis (thường gọi là Azure Redis Cache) cho một ứng dụng web thực hiện phân tích hình ảnh người dùng, trả về metadata về các đối tượng được nhận diện. Phân tích này tốn kém về thời gian và tài nguyên tính toán (compute). Để tránh xử lý lại các ảnh trùng lặp (duplicate uploads), ứng dụng sử dụng Azure Redis Cache làm bộ nhớ đệm (cache).
Yêu cầu chính: Trong trường hợp trung tâm dữ liệu Azure bị gián đoạn (outage), phải giảm thiểu tối đa mất mát metadata. Bạn cần thực hiện hai hành động để cấu hình instance Azure Redis Cache. Đây là câu hỏi trắc nghiệm nhiều lựa chọn (multiple correct answers), mỗi lựa chọn đúng đáng 1 điểm.
🛠️ Bối cảnh kỹ thuật:
- Azure Cache for Redis hỗ trợ persistence (lưu trữ bền vững dữ liệu ra đĩa) để tránh mất dữ liệu khi cache restart hoặc outage.
- Hai chế độ persistence chính: RDB (snapshot) và AOF (Append Only File). AOF ghi log mọi thay đổi, bền vững hơn RDB (chỉ snapshot định kỳ).
- Persistence có thể lưu vào storage account, và để tăng độ bền, có thể dùng thứ hai storage account làm bản sao (replication).
- Kiến thức cập nhật đến 2026: Theo tài liệu Azure mới nhất (Premium/Enterprise tiers hỗ trợ Active Geo-Replication và persistence nâng cao với dual storage accounts cho RDB/AOF).
✅ Đáp án đúng (hai lựa chọn):
Hai hành động cần thực hiện là:
- Configure Azure Redis with AOF persistence – Vì AOF đảm bảo độ bền cao, giảm thiểu mất dữ liệu trong outage.
- Configure second storage account for persistence – Tăng redundancy bằng cách sao lưu persistence sang storage account thứ hai.
Lý do chọn đáp án đúng:
Kết hợp AOF (ghi log liên tục, mất dữ liệu ít nhất) và second storage account (bảo vệ chống mất dữ liệu ở storage chính) giúp giảm thiểu tối đa metadata loss trong data center outage, phù hợp yêu cầu. Đây là best practice cho high availability trong Azure Cache for Redis Premium tier trở lên.
📋 Giải thích chi tiết từng phương án
-
✅ Configure Azure Redis with AOF persistence (Đúng):
AOF persistence ghi lại mọi lệnh ghi (write commands) vào file log, đảm bảo độ bền cao (durability). Trong outage, chỉ mất dữ liệu chưa flush (rất ít). Phù hợp yêu cầu "metadata loss must be kept to a minimum". RDB kém hơn vì chỉ snapshot định kỳ, có thể mất dữ liệu giữa các snapshot. -
❌ Configure Azure Redis with RDB persistence (Sai):
RDB persistence tạo snapshot toàn bộ dữ liệu định kỳ (ví dụ: mỗi 60 giây), nhưng có thể mất dữ liệu từ snapshot cuối cùng đến lúc outage (lên đến vài phút dữ liệu). Không đáp ứng yêu cầu giảm thiểu tối đa mất mát metadata. -
✅ Configure second storage account for persistence (Đúng):
Azure cho phép cấu hình hai storage accounts cho persistence (primary và secondary). Dữ liệu persistence được replicate sang account thứ hai, tăng độ bền chống outage storage hoặc region. Đây là tính năng nâng cao trong Premium/Enterprise tiers, trực tiếp giảm rủi ro mất metadata. -
❌ Set backup frequency to the minimum value (Sai):
"Backup frequency" đề cập đến Redis Export (backup định kỳ ra blob storage), không phải persistence real-time. Giảm tần suất (minimum value) sẽ làm tăng khoảng cách giữa các backup, dẫn đến mất nhiều dữ liệu hơn trong outage. Không giải quyết vấn đề persistence chính và không minimize loss hiệu quả.
📘 Tài liệu tham khảo
- Azure Docs: Redis Persistence – Chi tiết AOF vs RDB và dual storage accounts (cập nhật 2024-2026).
- Azure Cache for Redis Best Practices – Hướng dẫn HA và durability cho outage.
- Pricing & Tiers – Xác nhận tính năng Premium/Enterprise.
🔍 Lưu ý: Cấu hình này yêu cầu tier Premium trở lên. Test trong môi trường dev trước khi apply production! 🛡️
After you answer a question in this section, you will NOT be able to return to it. As a result, these questions will not appear in the review screen.
You develop a software as a service (SaaS) offering to manage photographs. Users upload photos to a web service which then stores the photos in Azure
Storage Blob storage. The storage account type is General-purpose V2.
When photos are uploaded, they must be processed to produce and save a mobile-friendly version of the image. The process to produce a mobile-friendly version of the image must start in less than one minute.
You need to design the process that starts the photo processing.
Solution: Create an Azure Function app that uses the Consumption hosting model and that is triggered from the blob upload.
Does the solution meet the goal?
- A Yes
- B No
Xem giải thích
🧩 Phân tích chi tiết nội dung câu hỏi
Câu hỏi này thuộc dạng case study (phân tích tình huống) trong kỳ thi chứng chỉ Azure, nơi bạn phát triển một dịch vụ SaaS quản lý ảnh. Người dùng upload ảnh qua web service, ảnh được lưu vào Azure Blob Storage (loại tài khoản General-purpose v2).
Yêu cầu chính: Khi ảnh được upload, quá trình xử lý để tạo phiên bản "mobile-friendly" phải bắt đầu trong vòng dưới 1 phút (less than one minute).
Giải pháp đề xuất (Solution): Tạo một Azure Function app sử dụng mô hình hosting Consumption và được kích hoạt (triggered) từ sự kiện upload blob.
Câu hỏi: Giải pháp này có đáp ứng mục tiêu không? (Does the solution meet the goal?)
Bối cảnh quan trọng:
- Azure Blob Storage hỗ trợ BlobTrigger cho Functions để tự động kích hoạt khi có file mới upload.
- Tuy nhiên, với Consumption plan (pay-per-execution, scale-to-zero), Functions có hiện tượng cold start (khởi động lạnh) – thời gian khởi tạo instance mới có thể kéo dài vài giây đến vài phút, tùy workload và region.
- Yêu cầu <1 phút là thách thức lớn vì BlobTrigger dựa trên polling (kiểm tra định kỳ storage, mặc định 10 phút cho blobs mới, nhưng có thể cấu hình giảm xuống ~1 phút với change feed). Kết hợp cold start, tổng thời gian trigger có thể vượt quá 1 phút.
- Kiến thức cập nhật đến 2026: Theo docs Azure Functions (phiên bản runtime v4+), BlobTrigger vẫn polling-based, cold start trung bình 10-30s (nhưng worst-case >1 phút ở Consumption). Premium/Dedicated plan giảm cold start nhờ pre-warmed instances. Event Grid + Functions là best practice cho low-latency (<1s).
📘 Tài liệu tham khảo:
- Azure Functions Blob storage trigger (cập nhật 2024-2026).
- Azure Functions scale and hosting - Consumption plan cold starts (cold start benchmarks).
- Best practices for Blob triggers.
✅ Đáp án đúng: No
Lý do chọn đáp án đúng 🛠️:
Giải pháp KHÔNG đáp ứng mục tiêu vì Azure Function Consumption plan + BlobTrigger không đảm bảo khởi động xử lý trong <1 phút.
- BlobTrigger sử dụng cơ chế polling (kiểm tra thay đổi storage mỗi 1-10 phút), cộng với cold start của Consumption (scale-to-zero) có thể mất 30s - 2+ phút ở worst-case (traffic thấp, region xa).
- Không phù hợp với yêu cầu low-latency (<60s). Giải pháp tốt hơn: Sử dụng Event Grid (push-based, <1s latency) trigger Function Premium plan (pre-warmed, cold start <2s).
- Đây là bẫy phổ biến trong exam Azure Developer Associate (AZ-204).
📋 Giải thích tất cả các phương án
-
Yes ❌
Phương án SAI vì giả định giải pháp sẽ luôn trigger nhanh chóng. Thực tế, Consumption plan có cold start và polling delay khiến thời gian bắt đầu xử lý thường >1 phút (docs xác nhận polling interval 10 phút mặc định cho blobs mới, cold start thêm 10-90s). Không đáng tin cậy cho SLA <1 phút. -
No ✅
Phương án ĐÚNG vì giải pháp KHÔNG meet the goal do hạn chế của BlobTrigger trên Consumption: Polling chậm + cold start không đảm bảo <1 phút (best practice recommend Event Grid hoặc Service Bus Queue cho real-time processing). Phù hợp với yêu cầu exam nhấn mạnh performance optimization.
The application must always log when the application is offline for any reason.
You need to ensure that the on-call developer is not paged during offline processing.
What should you do?
- A Add Azure Monitor alert processing rules to suppress notifications.
- B Disable Azure Monitor Service Health Alerts during offline processing.
- C Create an Azure Monitor Metric Alert.
- D Build an Azure Monitor action group that suppresses the alerts.
Xem giải thích
🧩 Phân tích chi tiết nội dung câu hỏi
Câu hỏi mô tả một tình huống phát triển ứng dụng web dựa trên Azure, nơi ứng dụng định kỳ chuyển sang trạng thái offline để thực hiện xử lý dữ liệu ngoại tuyến (offline data processing). Trong khoảng thời gian này, nhiều cảnh báo (alerts) từ Azure Monitor được kích hoạt, dẫn đến việc nhân viên trực on-call bị page (gọi khẩn cấp). Yêu cầu chính là:
- Ứng dụng luôn ghi log (log) mọi lý do gây offline.
- Ngăn chặn việc page developer on-call cụ thể trong giai đoạn xử lý offline, mà không ảnh hưởng đến các cảnh báo khác.
📌 Mục tiêu cốt lõi: Sử dụng tính năng của Azure Monitor (phiên bản cập nhật mới nhất đến 2026) để tạm thời suppress (ngăn chặn thông báo) cho các alerts liên quan đến giai đoạn offline, đồng thời đảm bảo logging đầy đủ. Đây là vấn đề phổ biến trong DevOps Azure, nơi cần kiểm soát alerts linh hoạt để tránh "alert fatigue" (mệt mỏi do cảnh báo giả).
🛠️ Bối cảnh kỹ thuật: Azure Monitor hỗ trợ alert processing rules (tính năng nâng cao từ 2021, cập nhật liên tục đến 2026) để mute/suppress notifications mà không xóa alerts, giúp theo dõi log mà không làm phiền on-call.
✅ Đáp án đúng và lý do lựa chọn
Đáp án đúng: Add Azure Monitor alert processing rules to suppress notifications.
Lý do:
- Tính năng Alert processing rules trong Azure Monitor (cập nhật mới nhất 2026) cho phép tạo quy tắc xử lý alerts để suppress notifications (ngăn gửi thông báo/page) cho các alerts cụ thể trong khoảng thời gian định sẵn (ví dụ: trong giờ offline).
- Quy tắc này áp dụng cho toàn bộ hoặc nhóm alerts (dựa trên scope như resource group, subscription), phù hợp với việc ứng dụng offline định kỳ.
- Logging vẫn được giữ nguyên: Alerts vẫn fire và log vào Azure Monitor Logs/Metrics, chỉ suppress phần thông báo (email/SMS/page via action groups).
- Giải quyết chính xác yêu cầu: Không page on-call, nhưng vẫn log lý do offline. Đây là best practice theo Microsoft docs.
📋 Giải thích tất cả các phương án (đúng/sai)
-
✅ Add Azure Monitor alert processing rules to suppress notifications.
Đúng 🟢: Như giải thích trên, đây là tính năng chuyên dụng để suppress notifications tạm thời mà không ảnh hưởng đến việc ghi log alerts. Áp dụng linh hoạt theo filter (resource, severity, time window). Hoàn hảo cho kịch bản offline định kỳ. -
❌ Disable Azure Monitor Service Health Alerts during offline processing.
Sai 🔴: Service Health Alerts chỉ theo dõi tình trạng dịch vụ Azure toàn cầu (như outage), không liên quan đến alerts của ứng dụng cụ thể (app-specific như App Service offline). Disable thủ công không khả thi cho lịch offline định kỳ, và không log được. -
❌ Create an Azure Monitor Metric Alert.
Sai 🔴: Việc tạo thêm Metric Alert chỉ tăng số lượng alerts, không giải quyết suppress hiện tại. Metric Alerts dùng để monitor metrics (CPU, availability), nhưng vấn đề là suppress alerts đang fire, không phải tạo mới. -
❌ Build an Azure Monitor action group that suppresses the alerts.
Sai 🔴: Action groups định nghĩa hành động khi alert fire (như gửi email/page), nhưng không suppress alerts hoặc notifications. Suppress phải làm ở mức processing rules, không phải action group (chỉ route hành động).
📘 Tài liệu tham khảo (cập nhật mới nhất đến 2026)
- Azure Monitor alert processing rules (Microsoft Docs) – Hướng dẫn chính thức về suppress notifications.
- Manage Azure Monitor alerts (2026 updates) – Tổng quan alerts với best practices cho offline scenarios.
- Azure Monitor action groups vs. processing rules – Phân biệt rõ ràng tính năng.
🛠️ Lời khuyên từ Azure Developer: Triển khai qua Azure Portal/CLI: Tạo rule với scope ứng dụng, time window khớp lịch offline, và integrate với Application Insights để log chi tiết! Nếu cần code sample, hãy hỏi thêm. 🚀
The VMs contain code that must access resources in an Azure resource group. You grant the VM access to the resource group in Resource Manager.
You need to obtain an access token that uses the VM's system-assigned managed identity.
Which two actions should you perform? Each correct answer presents part of the solution.
- A From the code on the VM, call Azure Resource Manager using an access token.
- B Use PowerShell on a remote machine to make a request to the local managed identity for Azure resources endpoint.
- C Use PowerShell on the VM to make a request to the local managed identity for Azure resources endpoint.
- D From the code on the VM, call Azure Resource Manager using a SAS token.
- E From the code on the VM, generate a user delegation SAS token.
Xem giải thích
🧩 Giải thích nội dung câu hỏi
Câu hỏi này thuộc chủ đề Azure Managed Identities (danh tính được quản lý), cụ thể là system-assigned managed identity trên Azure Virtual Machines (VMs).
- Bối cảnh: Bạn đang phát triển một giải pháp sử dụng Azure VMs, nơi mã code chạy trên VM cần truy cập tài nguyên trong một Azure resource group (nhóm tài nguyên). Bạn đã cấp quyền cho VM truy cập resource group qua Azure Resource Manager (ARM) bằng cách gán role cho managed identity của VM.
- Mục tiêu: Lấy access token sử dụng system-assigned managed identity của VM (danh tính tự động được Azure tạo và quản lý, gắn liền với lifecycle của VM).
- Yêu cầu: Thực hiện hai hành động (multi-select question).
- Nguyên lý cốt lõi (cập nhật đến 2026): Managed identity cho phép code trên VM lấy token mà không cần lưu secret/client ID. Code phải gọi local endpoint của Azure Instance Metadata Service (IMDS) tại
http://169.254.169.254/metadata/identity/oauth2/tokenđể lấy token cho audience cụ thể (ví dụ:https://management.azure.com/cho ARM). Sau đó dùng token này gọi ARM API. Phương pháp này an toàn, không cần credential thủ công. (Phiên bản API mới nhất: 2018-02-01, hỗ trợ MSI và Entra ID integration).
🛠️ Lưu ý: Không dùng SAS token vì SAS dành cho Storage, không phải ARM. Remote access không hoạt động vì MSI chỉ accessible locally trên VM.
✅ Đáp án đúng và lý do lựa chọn
Hai phương án đúng là:
- From the code on the VM, call Azure Resource Manager using an access token.
- Use PowerShell on the VM to make a request to the local managed identity for Azure resources endpoint.
Lý do:
- Để lấy access token, sử dụng PowerShell (hoặc code) trên chính VM gọi local managed identity endpoint (IMDS) để acquire token dành cho ARM.
- Sau khi có token, code trên VM sử dụng token đó để gọi Azure Resource Manager truy cập resource group.
✅ Đây là quy trình chuẩn 2 bước theo docs Azure: Acquire token từ MSI → Authenticate với ARM. Không cần secret, tự động refresh.
🔍 Phân tích tất cả các phương án
Dưới đây là phân tích chi tiết từng phương án (giữ nguyên văn bản gốc tiếng Anh). Mỗi phương án được đánh giá đúng/sai dựa trên cơ chế Managed Identity VM (cập nhật 2026).
-
From the code on the VM, call Azure Resource Manager using an access token.
✅ Đúng. Đây là bước thứ hai: Sau khi lấy token từ MSI endpoint, code trên VM (ví dụ: dùng REST API hoặc SDK như Azure.Identity) gọi ARM endpoint (nhưhttps://management.azure.com/subscriptions/.../resourceGroups/...) với headerAuthorization: Bearer <token>. Điều này cho phép truy cập resource group đã cấp quyền. 🛠️ Hoàn hảo cho production code. -
Use PowerShell on a remote machine to make a request to the local managed identity for Azure resources endpoint.
❌ Sai. MSI endpoint (169.254.169.254) chỉ accessible local trên VM qua link-local IP. Từ remote machine (máy khác), không thể gọi được vì security boundary của Azure IMDS. Sử dụng PowerShell remote sẽ fail với lỗi "not accessible". -
Use PowerShell on the VM to make a request to the local managed identity for Azure resources endpoint.
✅ Đúng. Đây là bước đầu: Chạy PowerShell trên VM với lệnh nhưInvoke-RestMethod -Headers @{'Metadata'='true'} -Uri 'http://169.254.169.254/metadata/identity/oauth2/token?api-version=2018-02-01&resource=https://management.azure.com/'. Trả về access token cho ARM. 🧩 Đây là cách test/debug chuẩn, tương đương code logic. -
From the code on the VM, call Azure Resource Manager using a SAS token.
❌ Sai. SAS (Shared Access Signature) là token tạm thời dành cho Azure Storage (Blobs/Queues), không dùng cho ARM hoặc resource group. ARM yêu cầu OAuth 2.0 token từ AAD/MSI. Sử dụng SAS sẽ bị từ chối với lỗi 401 Unauthorized. -
From the code on the VM, generate a user delegation SAS token.
❌ Sai. User delegation SAS là loại SAS nâng cao cho Storage, yêu cầu OAuth token từ user/MSI để generate SAS cho Storage data plane. Không liên quan đến ARM hoặc resource group access. Đây là nhầm lẫn với Storage scenarios, không áp dụng ở đây.
📘 Tài liệu tham khảo
- Azure Docs - How managed identities work on VMs: learn.microsoft.com/en-us/entra/identity/managed-identities-azure-resources/how-managed-identities-work-vm (Cập nhật 2024-2026).
- Acquire token từ MSI trên VM: learn.microsoft.com/en-us/entra/identity/managed-identities-azure-resources/how-to-use-vm-token – Ví dụ PowerShell/Curl/Code samples.
- Azure SDK cho token: learn.microsoft.com/en-us/dotnet/api/azure.identity.defaultazurecredential (Tự động dùng MSI).
Hy vọng phân tích này giúp bạn nắm vững! 🚀 Nếu cần code sample, hỏi thêm nhé!
After you answer a question in this section, you will NOT be able to return to it. As a result, these questions will not appear in the review screen.
You develop and deploy an Azure App Service API app to a Windows-hosted deployment slot named Development. You create additional deployment slots named Testing and Production. You enable auto swap on the Production deployment slot.
You need to ensure that scripts run and resources are available before a swap operation occurs.
Solution: Update the app with a method named statuscheck to run the scripts. Update the app settings for the app. Set the
WEBSITE_SWAP_WARMUP_PING_PATH and WEBSITE_SWAP_WARMUP_PING_STATUSES with a path to the new method and appropriate response codes.
Does the solution meet the goal?
- A No
- B Yes
Xem giải thích
🧩 Giải thích chi tiết nội dung câu hỏi
Câu hỏi thuộc dạng "Does the solution meet the goal?" trong kỳ thi chứng chỉ (có thể là AZ-204: Developing Solutions for Microsoft Azure), nơi mô tả một tình huống thực tế về Azure App Service với các deployment slots.
-
Tình huống (Scenario):
- Bạn phát triển và triển khai một Azure App Service API app lên slot Development (chạy trên Windows).
- Tạo thêm các slot Testing và Production.
- Bật auto swap trên slot Production (tự động hoán đổi slot khi deploy mới).
-
Mục tiêu (Goal): Đảm bảo rằng các script chạy và tài nguyên sẵn sàng trước khi thực hiện swap operation (hoán đổi slot). Điều này tránh tình trạng "cold start" (ứng dụng khởi động chậm, mất kết nối DB, cache,... sau swap).
-
Giải pháp đề xuất (Solution):
- Cập nhật app với một method tên
statuscheckđể chạy các script kiểm tra. - Cập nhật app settings:
WEBSITE_SWAP_WARMUP_PING_PATH: Đường dẫn đến method mới (ví dụ:/statuscheck).WEBSITE_SWAP_WARMUP_PING_STATUSES: Các mã response code hợp lệ (ví dụ:200).
Giải pháp này sử dụng cơ chế warm-up ping của Azure App Service để "ping" endpoint trước swap, đảm bảo app sẵn sàng (kiểm tra scripts, kết nối tài nguyên).
- Cập nhật app với một method tên
Câu hỏi yêu cầu đánh giá giải pháp có đạt mục tiêu không.
✅ Đáp án đúng: Yes
Lý do lựa chọn:
- Giải pháp hoàn toàn chính xác và đạt mục tiêu theo tài liệu chính thức của Microsoft Azure (cập nhật đến 2026).
- Các app setting
WEBSITE_SWAP_WARMUP_PING_PATHvàWEBSITE_SWAP_WARMUP_PING_STATUSESlà slot-specific settings dành riêng cho pre-swap warmup trong Azure App Service. Chúng kích hoạt Azure tự động gọi endpoint (như/statuscheck) trước khi swap, chạy scripts kiểm tra, và chỉ swap nếu nhận response code hợp lệ (ví dụ: 200). Điều này đảm bảo tài nguyên (DB, cache, external services) sẵn sàng, tránh downtime. - Tính năng này hỗ trợ auto-swap trên Production slot, và áp dụng cho Windows-hosted apps.
- 🛠️ Cách hoạt động: Trước swap, Azure ping endpoint → Chạy method
statuscheck(scripts kiểm tra) → Nếu OK → Swap thành công.
📋 Giải thích tất cả các phương án (đúng/sai)
-
Yes ✅
Đúng: Như giải thích trên, giải pháp sử dụng đúng cơ chế warm-up ping của Azure App Service để chạy scripts và kiểm tra tài nguyên trước swap. Đây là best practice được Microsoft khuyến nghị, không cần code phức tạp hay extension ngoài. Áp dụng được cho auto-swap trên Production slot. Không có thay đổi nào trong phiên bản Azure 2026 làm vô hiệu hóa tính năng này. -
No ❌
Sai: Giải pháp không hề thiếu sót hay sai sót. Nếu chọn "No", sẽ nhầm lẫn vì bỏ qua tài liệu chính thức về slot swap warmup. Các vấn đề phổ biến như "quên slot-specific settings" hoặc "không dùng warmup ping" không áp dụng ở đây – giải pháp đã cover đầy đủ.
📘 Tài liệu tham khảo (Cập nhật mới nhất đến 2026)
- Azure App Service: Deployment slots - Warm up 🗂️ (Chi tiết về
WEBSITE_SWAP_WARMUP_PING_PATHvàWEBSITE_SWAP_WARMUP_PING_STATUSES). - Azure App Service settings reference 📖 (Danh sách đầy đủ app settings cho slots).
- AZ-204 Exam Prep: App Service Slots 🎓 (Tương tự các câu hỏi series này).
Giải pháp này 100% đạt goal! 🚀
The solution must meet the following requirements:
✑ Send insert and update operations to an Azure Blob storage account.
✑ Process changes to all partitions immediately.
✑ Allow parallelization of change processing.
You need to process the Azure Cosmos DB operations.
What are two possible ways to achieve this goal? Each correct answer presents a complete solution.
NOTE: Each correct selection is worth one point.
- A Create an Azure App Service API and implement the change feed estimator of the SDK. Scale the API by using multiple Azure App Service instances.
- B Create a background job in an Azure Kubernetes Service and implement the change feed feature of the SDK.
- C Create an Azure Function to use a trigger for Azure Cosmos DB. Configure the trigger to connect to the container.
- D Create an Azure Function that uses a FeedIterator object that processes the change feed by using the pull model on the container. Use a FeedRange object to parallelize the processing of the change feed across multiple functions.
Xem giải thích
🧩 Phân tích nội dung câu hỏi
Câu hỏi này thuộc chủ đề phát triển giải pháp sử dụng Azure Cosmos DB với cơ sở dữ liệu phân vùng đa (multi-partitioned database). Bạn đang sử dụng SDK mới nhất của Azure Cosmos DB để phát triển. Giải pháp cần đáp ứng các yêu cầu sau:
- 📤 Gửi các hoạt động insert và update đến một tài khoản Azure Blob Storage.
- ⚡ Xử lý thay đổi trên tất cả các phân vùng ngay lập tức (immediately).
- 🔄 Hỗ trợ song song hóa (parallelization) việc xử lý thay đổi.
Mục tiêu là chọn hai cách khả thi để xử lý các hoạt động Cosmos DB, sử dụng Change Feed (luồng thay đổi) của Cosmos DB – một tính năng cho phép theo dõi và xử lý các thay đổi dữ liệu thời gian thực trên container.
Lưu ý: Đây là câu hỏi trắc nghiệm chọn nhiều đáp án (mỗi đáp án đúng đáng 1 điểm), dựa trên phiên bản Azure Cosmos DB SDK v3.x mới nhất (cập nhật đến 2026, hỗ trợ pull model và push model cho change feed với parallelization qua FeedRange).
📘 Tài liệu tham khảo:
- Azure Cosmos DB Change Feed Documentation (Microsoft Docs, cập nhật 2025).
- Azure Functions Cosmos DB Trigger (hỗ trợ push model).
- Pull Model with FeedIterator (SDK v3, parallelization với FeedRange).
✅ Đáp án đúng và lý do lựa chọn
Hai đáp án đúng là:
- Create an Azure Function to use a trigger for Azure Cosmos DB. Configure the trigger to connect to the container.
- Create an Azure Function that uses a FeedIterator object that processes the change feed by using the pull model on the container. Use a FeedRange object to parallelize the processing of the change feed across multiple functions.
Lý do:
Cả hai cách đều sử dụng Azure Functions – dịch vụ serverless lý tưởng cho xử lý sự kiện thời gian thực từ Cosmos DB Change Feed.
- Chúng hỗ trợ xử lý ngay lập tức (real-time) trên tất cả phân vùng.
- Parallelization được đảm bảo: Trigger dùng push model (tự động phân phối), pull model dùng FeedRange để chia nhỏ phạm vi phân vùng.
- Dễ tích hợp gửi dữ liệu đến Azure Blob Storage qua output binding hoặc code. Đây là các giải pháp hoàn chỉnh và được khuyến nghị bởi Microsoft cho multi-partition scenarios (SDK mới nhất 2026).
🛠️ Giải thích chi tiết từng phương án
-
Create an Azure App Service API and implement the change feed estimator of the SDK. Scale the API by using multiple Azure App Service instances.
❌ Sai: "Change feed estimator" chỉ dùng để ước lượng số lượng thay đổi (không xử lý thực tế). App Service API không hỗ trợ change feed trigger tự động, phải poll thủ công (không immediate, không parallelize tốt). Scaling instances không giải quyết parallelization phân vùng Cosmos DB. Không phải giải pháp hoàn chỉnh cho real-time multi-partition. -
Create a background job in an Azure Kubernetes Service and implement the change feed feature of the SDK.
❌ Sai: AKS phù hợp cho workload containerized lớn, nhưng không có integration native với Cosmos DB Change Feed (phải implement thủ công lease container, phức tạp). Không đảm bảo immediate processing hoặc parallelization tự động trên tất cả phân vùng mà không code phức tạp. Không phải cách tối ưu so với Functions. -
Create an Azure Function to use a trigger for Azure Cosmos DB. Configure the trigger to connect to the container.
✅ Đúng: Sử dụng Cosmos DB Trigger (push model) – tự động kích hoạt function khi có insert/update trên container. Hỗ trợ multi-partition immediate (dùng lease container nội bộ), parallelization qua multiple function instances. Dễ config kết nối và gửi đến Blob Storage. Giải pháp serverless hoàn chỉnh (SDK v3+). -
Create an Azure Function that uses a FeedIterator object that processes the change feed by using the pull model on the container. Use a FeedRange object to parallelize the processing of the change feed across multiple functions.
✅ Đúng: Pull model với FeedIterator và FeedRange (mới nhất SDK 2026) cho phép chia nhỏ physical partitions để parallelize across functions/instances. Xử lý immediate bằng polling kiểm soát, hỗ trợ tất cả phân vùng, tích hợp Blob Storage dễ dàng. Lý tưởng cho high-throughput multi-partition.
Hy vọng phân tích này giúp bạn hiểu rõ! 🚀 Nếu cần code sample, hãy hỏi thêm nhé!