import json

with open(r'c:\projects\myproject\azure-quiz\data\az-305\questions.json', 'r', encoding='utf-8') as f:
    data = json.load(f)

# Translations for missing Vietnamese content (questions 1-100)
# Format: {id: {"stem": "...", "options": {"A": "...", ...}, "explanation": "..."}}
translations = {}

translations[3] = {
    "stem": "Bạn có Azure Active Directory (Azure AD) tenant đồng bộ với on-premises Active Directory domain. Bạn có web app nội bộ tên WebApp1 được host on-premises. WebApp1 sử dụng Integrated Windows authentication. Một số người dùng làm việc từ xa và KHÔNG có quyền truy cập VPN vào mạng on-premises. Bạn cần cung cấp cho người dùng từ xa quyền truy cập single sign-on (SSO) vào WebApp1. Bạn nên bao gồm hai tính năng nào trong giải pháp? Mỗi đáp án đúng là một phần của giải pháp.",
    "options": {
        "A": "Azure AD Application Proxy",
        "B": "Azure AD Privileged Identity Management (PIM)",
        "C": "Conditional Access policies",
        "D": "Azure Arc",
        "E": "Azure AD enterprise applications",
        "F": "Azure Application Gateway"
    },
    "explanation": "A: Application Proxy là tính năng của Azure AD cho phép người dùng truy cập on-premises web applications từ remote client. Application Proxy bao gồm cả dịch vụ Application Proxy chạy trên cloud và Application Proxy connector chạy trên on-premises server.\nBạn có thể cấu hình single sign-on cho ứng dụng Application Proxy.\nE: Thêm on-premises app vào Azure AD. Sau khi chuẩn bị môi trường và cài đặt connector, bạn có thể thêm on-premises applications vào Azure AD thông qua Enterprise applications."
}

translations[5] = {
    "stem": "Bạn dự định triển khai Azure Databricks để hỗ trợ ứng dụng machine learning. Các data engineers sẽ mount một Azure Data Lake Storage account vào Databricks file system. Quyền truy cập vào folders được cấp trực tiếp cho data engineers. Bạn cần đề xuất thiết kế cho việc triển khai Databricks theo kế hoạch. Giải pháp phải đáp ứng các yêu cầu sau:\n✑ Đảm bảo data engineers chỉ có thể truy cập các folders mà họ có quyền.\n✑ Giảm thiểu nỗ lực phát triển.\n✑ Giảm thiểu chi phí.\nBạn nên bao gồm gì trong đề xuất? Chọn các tùy chọn phù hợp.",
    "options": {},
    "explanation": "Box 1: Premium - Premium Databricks SKU là bắt buộc cho credential passthrough.\n\nBox 2: Credential passthrough - Cho phép tự động xác thực tới Azure Data Lake Storage Gen1 và Gen2 từ Azure Databricks clusters bằng cùng Azure Active Directory (Azure AD) identity mà bạn sử dụng để đăng nhập vào Azure Databricks."
}

translations[10] = {
    "stem": "Bạn có Azure subscription. Subscription chứa các Azure virtual machines chạy Windows Server 2016 và Linux. Bạn cần sử dụng Azure Monitor để thiết kế chiến lược cảnh báo cho các sự kiện liên quan đến bảo mật. Bạn nên query những Azure Monitor Logs tables nào? Kéo các tables phù hợp vào đúng loại log.",
    "options": {},
    "explanation": "Events từ Windows event logs: Event. Bảng Event trong Azure Monitor lưu trữ dữ liệu Windows event log. Các log này được thu thập từ Windows machines kết nối với Azure Monitor, bao gồm System, Application và Security logs.\n\nEvents từ Linux system logging: Syslog. Bảng Syslog lưu trữ Linux log data, được tạo bởi Syslog daemon trên Linux systems."
}

translations[11] = {
    "stem": "Bạn đang thiết kế môi trường Azure lớn chứa nhiều subscriptions. Bạn dự định sử dụng Azure Policy như một phần của giải pháp governance. Bạn có thể gán Azure Policy definitions cho ba phạm vi (scopes) nào? Mỗi đáp án đúng là một giải pháp hoàn chỉnh.",
    "options": {
        "A": "Azure Active Directory (Azure AD) administrative units",
        "B": "Azure Active Directory (Azure AD) tenants",
        "C": "subscriptions",
        "D": "compute resources",
        "E": "resource groups",
        "F": "management groups"
    },
    "explanation": "Azure Policy đánh giá resources trong Azure bằng cách so sánh thuộc tính của resources với business rules. Sau khi business rules được hình thành, policy definition hoặc initiative được gán cho bất kỳ scope nào mà Azure hỗ trợ, như management groups, subscriptions, resource groups hoặc individual resources."
}

translations[12] = {
    "stem": "Mạng on-premises của bạn có server tên Server1 chạy ASP.NET application tên App1. Bạn có hybrid deployment của Azure Active Directory (Azure AD). Bạn cần đề xuất giải pháp đảm bảo users đăng nhập bằng Azure AD account và Azure Multi-Factor Authentication (MFA) khi kết nối tới App1 từ internet. Ba tính năng nào bạn nên triển khai và cấu hình theo thứ tự? Kéo các tính năng phù hợp vào vùng trả lời và sắp xếp đúng thứ tự.",
    "options": {},
    "explanation": "Bước 1: Azure AD Application Proxy - Bật giao tiếp tới Azure data centers để chuẩn bị môi trường.\nBước 2: Azure AD enterprise application - Đại diện cho ứng dụng được tích hợp với Azure AD để quản lý identity và access.\nBước 3: Conditional Access policy - Áp dụng các access controls như MFA dựa trên điều kiện của người dùng."
}

translations[15] = {
    "stem": "Bạn cần thiết kế kiến trúc để capture việc tạo users và gán roles. Dữ liệu captured phải được lưu trong Azure Cosmos DB. Bạn nên bao gồm những services nào trong thiết kế? Kéo các services phù hợp vào đúng vị trí.",
    "options": {},
    "explanation": "Box 1: Azure Event Hubs - Bạn có thể route Azure Active Directory (Azure AD) activity logs tới nhiều endpoints để lưu trữ lâu dài và phân tích dữ liệu. Event Hub được sử dụng cho streaming.\n\nBox 2: Azure Functions - Sử dụng Azure Function cùng với Cosmos DB change feed để lưu dữ liệu vào Cosmos DB."
}

translations[17] = {
    "stem": "Bạn có Azure subscription chứa 300 virtual machines chạy Windows Server 2019. Bạn cần giám sát tập trung tất cả warning events trong System logs của các virtual machines. Bạn nên bao gồm gì trong giải pháp?",
    "options": {},
    "explanation": "Box 1: Log Analytics workspace - Gửi resource logs tới Log Analytics workspace để kích hoạt các tính năng của Azure Monitor Logs.\n\nBox 2: Cài đặt Azure Monitor agent - Sử dụng Azure Monitor agent khi cần thu thập guest logs và metrics từ bất kỳ machine nào trong Azure, trên các cloud khác, hoặc on-premises."
}

translations[18] = {
    "stem": "Bạn có một số Azure App Service web apps sử dụng Azure Key Vault để lưu trữ data encryption keys. Một số departments có các yêu cầu sau để hỗ trợ web app. Bạn nên đề xuất service nào cho yêu cầu của từng department?",
    "options": {},
    "explanation": "Box 1 (Security): Azure AD Privileged Identity Management - Cung cấp just-in-time privileged access, time-limited access với start/end dates, yêu cầu approval để kích hoạt privileged roles.\n\nBox 2 (Development): Azure Managed Identity - Cung cấp identity cho applications khi kết nối tới resources hỗ trợ Azure AD authentication mà không cần quản lý credentials.\n\nBox 3 (Quality Assurance): Azure AD Privileged Identity Management - Cung cấp time-based và approval-based role activation."
}

translations[19] = {
    "stem": "Công ty bạn có các divisions như trong bảng. Bạn dự định triển khai custom application cho mỗi subscription. Application sẽ chứa: Resource group, Azure web app, Custom role assignments, Azure Cosmos DB account. Bạn cần sử dụng Azure Blueprints để triển khai application cho mỗi subscription. Số lượng objects tối thiểu cần thiết để triển khai application là bao nhiêu?",
    "options": {},
    "explanation": "Management Groups (2): Một management group cho mỗi tenant để tổ chức các subscriptions.\n\nBlueprint Definitions (2): Vì Blueprints có phạm vi tenant, bạn cần một Blueprint definition cho mỗi tenant (East và West).\n\nBlueprint Assignments (4): Gán Blueprint cho mỗi subscription riêng lẻ (Sub1, Sub2, Sub3, Sub4) vì resource deployments yêu cầu subscription-level assignments."
}

translations[20] = {
    "stem": "Bạn cần thiết kế Azure policy sẽ thực hiện các chức năng sau:\n✑ Với resources mới, gán tags và values khớp với tags/values của resource group chứa chúng.\n✑ Với resources hiện có, xác định tags/values có khớp với resource group hay không.\n✑ Với resources không tuân thủ, trigger auto-generated remediation tasks để tạo missing tags/values.\nGiải pháp phải sử dụng principle of least privilege.",
    "options": {},
    "explanation": "Box 1: Modify - Được sử dụng để thêm, cập nhật hoặc xóa properties/tags trên subscription hoặc resource. Policy assignments với effect Modify yêu cầu managed identity để thực hiện remediation.\n\nBox 2: Managed identity với Contributor role - Managed identity cần được cấp roles phù hợp để remediate resources. Contributor có thể tạo và quản lý tất cả loại Azure resources nhưng không thể cấp access cho người khác."
}

translations[21] = {
    "stem": "Bạn có Azure subscription chứa các resources như trong bảng. Bạn tạo Azure SQL database tên DB1 được host tại East US Azure region. Bạn thêm diagnostic setting tên Settings1 vào DB1. Settings1 archive SQLInsights tới storage1 và gửi SQLInsights tới Workspace1. Với mỗi phát biểu sau, chọn Yes nếu đúng, ngược lại chọn No.",
    "options": {},
    "explanation": "Box 1: Yes - Một diagnostic setting chỉ cho phép tối đa một destination mỗi loại. Nếu muốn gửi dữ liệu tới nhiều hơn một destination cùng loại, hãy tạo nhiều settings.\n\nBox 2: Yes - Gửi logs tới Log Analytics workspace là chức năng cốt lõi của diagnostic settings.\n\nBox 3: Yes - Hub1 là Event Hub. Diagnostic settings hỗ trợ gửi logs tới Event Hubs, thường dùng cho tích hợp với third-party SIEM."
}

translations[24] = {
    "stem": "Bạn có Azure App Service web app sử dụng system-assigned managed identity. Bạn cần đề xuất giải pháp lưu settings của web app dưới dạng secrets trong Azure key vault. Giải pháp phải đáp ứng các yêu cầu:\n✑ Giảm thiểu thay đổi code của app.\n✑ Sử dụng principle of least privilege.",
    "options": {},
    "explanation": "Box 1: Key Vault references trong Application settings - Cho phép giữ secrets trong Key Vault thay vì site config. App có thể reference secret thông qua key bình thường, không cần thay đổi code.\n\nBox 2: Secrets: Get - Để đọc secrets từ Key Vault, bạn cần tạo access policy cho application identity với quyền \"Get\" secret permission."
}

translations[27] = {
    "stem": "Bạn triển khai một số Azure SQL Database instances. Bạn dự định cấu hình Diagnostics settings trên các databases như trong hình. Sử dụng drop-down menus để chọn đáp án hoàn thành mỗi phát biểu.",
    "options": {},
    "explanation": "Box 1: 90 ngày - Theo exhibit, retention period cho blob storage là 90 ngày.\n\nBox 2: 730 ngày - Raw data points (các items bạn có thể query trong Analytics và inspect trong Search) được giữ tối đa 730 ngày."
}

translations[29] = {
    "stem": "Bạn có Azure subscription chứa virtual network tên VNET1 và 10 virtual machines. Các virtual machines kết nối tới VNET1. Bạn cần thiết kế giải pháp quản lý virtual machines từ internet. Giải pháp phải đáp ứng:\n✑ Incoming connections phải được xác thực bằng Azure Multi-Factor Authentication (MFA) trước khi cho phép kết nối mạng.\n✑ Incoming connections phải sử dụng TLS và kết nối tới TCP port 443.\n✑ Giải pháp phải hỗ trợ RDP và SSH.",
    "options": {},
    "explanation": "Box 1: Azure Bastion - Cung cấp kết nối RDP và SSH an toàn tới Azure VMs qua SSL, trực tiếp trong Azure portal mà không cần expose VMs ra public internet.\n\nBox 2: Conditional Access policy với Cloud apps assignment đặt thành Microsoft Azure Management - Azure Bastion client access được authorize khi đăng nhập Azure portal. Bạn có thể bật MFA cho portal access bằng Conditional Access policy."
}

translations[33] = {
    "stem": "Công ty bạn có 20 web APIs được phát triển nội bộ. Công ty đang phát triển 10 web apps sẽ sử dụng các web APIs. Web apps và APIs được đăng ký trong Azure Active Directory (Azure AD) tenant của công ty. Web APIs được publish bằng Azure API Management. Bạn cần đề xuất giải pháp chặn unauthorized requests từ web apps tới web APIs. Giải pháp phải:\n✑ Sử dụng Azure AD-generated claims.\n✑ Giảm thiểu effort cấu hình và quản lý.",
    "options": {},
    "explanation": "Box 1: Azure AD - Cấp permissions trong Azure AD.\n\nBox 2: Azure API Management - Cấu hình JWT validation policy để pre-authorize requests bằng cách validate access tokens."
}

translations[40] = {
    "stem": "Bạn có Azure subscription chứa Azure key vault tên KV1 và virtual machine tên VM1. VM1 chạy Windows Server 2022: Azure Edition. Bạn dự định triển khai ASP.Net Core application tên App1 tới VM1. Bạn cần cấu hình App1 sử dụng system-assigned managed identity để retrieve secrets từ KV1. Giải pháp phải giảm thiểu development effort.",
    "options": {},
    "explanation": "Box 1: Client credentials grant flows - Client credentials grant flow được sử dụng cho giao tiếp server-to-server, nơi app xác thực như chính nó (không có user interaction). Flow này thường dùng cho background services, daemons hoặc APIs.\n\nBox 2: OAuth 2.0 access token endpoint của Azure AD - Để lấy token bằng client credentials flow, app cần gọi token endpoint của Azure Active Directory."
}

translations[43] = {
    "stem": "Bạn có Azure subscription tên Sub1 liên kết với Azure AD tenant tên contoso.com. Bạn dự định triển khai hai ASP.NET Core apps tên App1 và App2 trên 100 virtual machines trong Sub1. Users sẽ đăng nhập App1 và App2 bằng contoso.com credentials. App1 cần read permissions để truy cập calendar của signed-in user. App2 cần write permissions để truy cập calendar của signed-in user. Bạn cần đề xuất giải pháp authentication và authorization. Giải pháp phải:\n• Sử dụng principle of least privilege.\n• Giảm thiểu administrative effort.",
    "options": {},
    "explanation": "Box 1: User-assigned managed identity - Vì có 100 VMs, user-assigned managed identity có thể được chia sẻ (không giống system-assigned). Managed identities giảm overhead quản lý secrets, key rotation.\n\nBox 2: Delegated permissions - Vì apps cần truy cập calendar thay mặt signed-in user, delegated permissions là phù hợp."
}

translations[46] = {
    "stem": "Bạn có Azure AD tenant chứa management group tên MG1. Bạn có các Azure subscriptions như trong bảng. Bạn thực hiện:\n- Gán User3 vai trò Contributor cho Sub1.\n- Gán Group1 vai trò Virtual Machine Contributor cho MG1.\n- Gán Group3 vai trò Contributor cho Tenant Root Group.\nVới mỗi phát biểu, chọn Yes nếu đúng, ngược lại chọn No.",
    "options": {},
    "explanation": "Box 1: Yes - Vì Group1 được gán VM contributor cho MG1, nên có thể tạo VM mới trong RG1.\n\nBox 2: No - User2 không thể cấp permission cho Group2 vì chỉ là member với contributor role (cần Owner hoặc User Access Administrator).\n\nBox 3: Yes - Vì Group3 có Contributor role cho Tenant Root Group, User3 có thể tạo storage account trong RG2."
}

translations[52] = {
    "stem": "Bạn có Azure AD tenant chứa administrative unit tên MarketingAU. MarketingAU có 100 users. Bạn tạo hai users tên User1 và User2. Bạn cần đảm bảo users có thể thực hiện các hành động sau trong MarketingAU:\n• User1 phải có thể tạo user accounts.\n• User2 phải có thể reset user passwords.\nBạn nên gán role nào cho mỗi user?",
    "options": {},
    "explanation": "User1: User Administrator cho MarketingAU - Vai trò User Administrator cho phép tạo và quản lý users, reset passwords, gán users vào groups. Vì role được scoped tới MarketingAU, User1 chỉ thực hiện được trong administrative unit đó.\n\nUser2: Helpdesk Administrator cho MarketingAU - Vai trò Helpdesk Administrator cho phép reset passwords cho non-admin users. Scoped tới MarketingAU nên chỉ áp dụng cho users trong unit đó."
}

translations[54] = {
    "stem": "Bạn đang thiết kế app sẽ được host trên Azure virtual machines chạy Ubuntu. App sẽ sử dụng third-party email service để gửi email. Email service yêu cầu app xác thực bằng API key. Bạn cần đề xuất giải pháp Azure Key Vault để lưu trữ và truy cập API key. Giải pháp phải giảm thiểu administrative effort.",
    "options": {},
    "explanation": "Storage: Secret - API keys thường được lưu dưới dạng secrets trong Azure Key Vault.\n\nAccess: Managed service identity (MSI) - MSI cho phép VM truy cập key vault mà không cần quản lý credentials. Azure tự động quản lý việc rotate credentials và đảm bảo lifecycle."
}

translations[55] = {
    "stem": "Bạn có hai app registrations tên App1 và App2 trong Azure AD. App1 hỗ trợ role-based access control (RBAC) và bao gồm role tên Writer. Bạn cần đảm bảo khi App2 authenticate để truy cập App1, tokens do Azure AD phát hành bao gồm Writer role claim. Bạn nên sử dụng blade nào để modify mỗi app registration?",
    "options": {},
    "explanation": "App1: App roles - Định nghĩa roles trong App1 qua blade App roles.\n\nApp2: API permissions - Cấu hình permissions cho App2 để truy cập App1 roles thông qua blade API permissions."
}

translations[59] = {
    "stem": "Để đáp ứng yêu cầu authentication của Fabrikam, bạn nên bao gồm gì trong giải pháp? Chọn các tùy chọn phù hợp.",
    "options": {},
    "explanation": "Số lượng Azure AD tenants tối thiểu: 1 - Một Azure AD tenant đại diện cho một instance của Azure Active Directory. Hầu hết giải pháp có thể được thiết kế trong một tenant.\n\nSố lượng Conditional Access policies tối thiểu cần tạo: 2 - Ví dụ: Policy 1 bắt buộc MFA cho Admins, Policy 2 yêu cầu compliant devices cho general users."
}

translations[61] = {
    "stem": "Bạn có Azure subscription chứa 50 Azure SQL databases. Bạn tạo Azure Resource Manager (ARM) template tên Template1 kích hoạt Transparent Data Encryption (TDE). Bạn cần tạo Azure Policy definition tên Policy1 sẽ sử dụng Template1 để enable TDE cho bất kỳ noncompliant Azure SQL databases nào. Bạn nên cấu hình Policy1 như thế nào?",
    "options": {},
    "explanation": "Box 1: DeployIfNotExists - Effect DeployIfNotExists được sử dụng khi bạn muốn đảm bảo resource/configuration được deploy tự động nếu thiếu. Thường dùng cho remediation.\n\nBox 2: Identity cần thiết để thực hiện remediation task - Để DeployIfNotExists hoạt động, Azure cần permission để deploy missing resource, yêu cầu định nghĩa managed identity có đủ RBAC permissions."
}

translations[63] = {
    "stem": "Log files từ App1 được đăng ký vào App1Logs. Trung bình 120 GB log data được ingest mỗi ngày. Bạn cấu hình Azure Monitor alert sẽ triggered nếu App1 logs chứa error messages. Bạn cần giảm thiểu chi phí Log Analytics liên quan tới App1. Giải pháp phải:\n• Đảm bảo tất cả log files từ App1 được ingest vào App1Logs.\n• Giảm thiểu impact lên Azure Monitor alert.",
    "options": {},
    "explanation": "Resource: Workspace1\nModification: Chuyển sang commitment pricing tier - Với 120 GB/ngày, commitment tier sẽ rẻ hơn pay-as-you-go pricing."
}

translations[64] = {
    "stem": "Bạn có 12 Azure subscriptions và ba projects. Mỗi project sử dụng resources trên nhiều subscriptions. Bạn cần sử dụng Microsoft Cost Management để giám sát chi phí theo từng project. Giải pháp phải giảm thiểu administrative effort. Hai thành phần nào bạn nên bao gồm?",
    "options": {
        "A": "budgets",
        "B": "resource tags",
        "C": "custom role-based access control (RBAC) roles",
        "D": "management groups",
        "E": "Azure boards"
    },
    "explanation": "B. Resource Tags: Tagging là cách dễ dàng để phân loại assets. Metadata có thể được dùng để phân loại theo project. Azure Cost Management có thể sử dụng tags để tạo different views của cost data.\n\nA. Budgets: Budgets trong Azure Cost Management giúp bạn lập kế hoạch và thúc đẩy organizational accountability, chủ động thông báo cho teams về spending targets."
}

translations[65] = {
    "stem": "Bạn có Azure subscription chứa nhiều storage accounts. Bạn gán Azure Policy definitions cho storage accounts. Bạn cần đề xuất giải pháp đáp ứng các yêu cầu:\n• Trigger on-demand Azure Policy compliance scans.\n• Raise Azure Monitor non-compliance alerts bằng cách query logs collected bởi Log Analytics.",
    "options": {},
    "explanation": "Để trigger compliance scans: Azure Command-Line Interface (CLI) - CLI cho phép trigger on-demand policy compliance scans.\n\nĐể generate non-compliance alerts: Azure activity logs - Cấu hình diagnostic settings cho Azure activity logs để gửi tới Log Analytics workspace, từ đó query và tạo alerts."
}

translations[66] = {
    "stem": "Bạn có Azure subscription. Bạn dự định triển khai 5 storage accounts lưu block blobs và 5 storage accounts host file shares. File shares sẽ được truy cập bằng SMB protocol. Bạn cần đề xuất giải pháp access authorization cho storage accounts. Giải pháp phải:\n• Tối đa hóa security.\n• Ngăn sử dụng shared keys.\n• Khi có thể, hỗ trợ time-limited access.",
    "options": {},
    "explanation": "Cho blobs: User delegation shared access signature (SAS) only - Là best practice về security, sử dụng Azure AD credentials thay vì account key. User delegation SAS cung cấp time-limited access.\n\nCho file shares: Azure AD credentials - Đáp ứng yêu cầu tối đa hóa security, nhưng không hỗ trợ time-limited access cho file shares qua SMB."
}

translations[67] = {
    "stem": "Bạn có Azure subscription chứa 100 virtual machines chạy Windows Server 2022, đã cài Azure Monitor Agent. Bạn cần đề xuất giải pháp:\n• Forward JSON-formatted logs từ VMs tới Log Analytics workspace.\n• Transform logs và lưu data trong table của Log Analytics workspace.",
    "options": {},
    "explanation": "Để forward logs: Azure Monitor data collection endpoint - Endpoint nhận data từ agents.\n\nĐể transform logs và store data: XPath query - Dùng để lọc và transform Windows event logs và custom logs."
}

translations[68] = {
    "stem": "Bạn có 5 Azure subscriptions. Mỗi subscription liên kết với Azure AD tenant riêng biệt và chứa virtual machines chạy Windows Server 2022. Bạn dự định thu thập Windows security events từ VMs và gửi tới một Log Analytics workspace duy nhất. Bạn cần đề xuất giải pháp:\n• Thu thập event logs từ nhiều subscriptions.\n• Hỗ trợ data collection rules (DCRs) để định nghĩa events cần thu thập.",
    "options": {},
    "explanation": "Để thu thập event logs: Azure Lighthouse - Để gửi data cross-tenants, bạn phải enable Azure Lighthouse trước.\n\nĐể hỗ trợ DCRs: Log Analytics agent - Tham khảo agents overview documentation."
}

translations[69] = {
    "stem": "Bạn có 100 servers chạy Windows Server 2012 R2 host Microsoft SQL Server 2014 instances. Các instances host databases có đặc điểm:\n✑ Stored procedures sử dụng CLR.\n✑ Database lớn nhất hiện tại là 3 TB. Không database nào vượt quá 4 TB.\nBạn dự định chuyển tất cả data từ SQL Server sang Azure. Bạn cần đề xuất service host databases. Giải pháp phải:\n✑ Giảm thiểu management overhead cho migrated databases.\n✑ Đảm bảo users xác thực bằng Azure Active Directory (Azure AD) credentials.\n✑ Giảm thiểu số database changes cần thiết cho migration.",
    "options": {
        "A": "Azure SQL Database elastic pools",
        "B": "Azure SQL Managed Instance",
        "C": "Azure SQL Database single databases",
        "D": "SQL Server 2016 trên Azure virtual machines"
    },
    "explanation": "SQL Managed Instance cho phép SQL Server customers lift and shift on-premises applications lên cloud với minimal application và database changes. Đồng thời duy trì tất cả PaaS capabilities (automatic patching, automated backups, high availability) giúp giảm management overhead và TCO."
}

translations[70] = {
    "stem": "Bạn có Azure subscription chứa Azure Blob Storage account tên store1. Bạn có on-premises file server tên Server1 chạy Windows Server 2016 lưu 500 GB company files. Bạn cần lưu bản sao company files từ Server1 vào store1. Hai Azure services nào có thể đạt mục tiêu này?",
    "options": {
        "A": "Azure Logic Apps integration account",
        "B": "Azure Import/Export job",
        "C": "Azure Data Factory",
        "D": "Azure Analysis services On-premises data gateway",
        "E": "Azure Batch account"
    },
    "explanation": "B: Azure Import/Export service cho phép export an toàn lượng lớn data từ Azure Blob storage bằng cách ship drives tới Azure datacenter.\n\nC: Azure Data Factory là managed cloud service xây dựng cho các complex hybrid ETL, ELT và data integration projects."
}

translations[72] = {
    "stem": "Bạn cần thiết kế giải pháp storage cho app sẽ lưu lượng lớn data thường xuyên sử dụng. Giải pháp phải:\n✑ Tối đa hóa data throughput.\n✑ Ngăn modification của data trong một năm.\n✑ Giảm thiểu latency cho read và write operations.\nBạn nên đề xuất Azure Storage account type và storage service nào?",
    "options": {},
    "explanation": "Box 1: BlockBlobStorage - Block Blob là premium storage account type cho block blobs và append blobs. Phù hợp cho scenarios với high transaction rates hoặc yêu cầu consistently low storage latency.\n\nBox 2: Blob - Archive tier là offline tier cho storing blob data ít truy cập. Có lowest storage costs nhưng higher data retrieval costs và latency."
}

translations[73] = {
    "stem": "Bạn nên đề xuất sử dụng storage accounts nào cho mỗi app? Chọn các tùy chọn phù hợp.",
    "options": {},
    "explanation": "Box 1 (App1): Storage1 và storage3 only - Cần sử dụng Standard accounts. Data lưu trong premium block blob storage account không thể được tiered sang hot, cool hoặc archive.\n\nBox 2 (App2): Storage1 và storage4 only - Azure File shares yêu cầu Premium accounts."
}

translations[76] = {
    "stem": "Bạn đang lên kế hoạch giải pháp Azure IoT Hub sẽ bao gồm 50,000 IoT devices. Mỗi device sẽ stream data bao gồm temperature, device ID và time data. Khoảng 50,000 records sẽ được ghi mỗi giây. Data sẽ được visualized gần real time. Bạn cần đề xuất service để store và query data. Hai services nào bạn có thể đề xuất?",
    "options": {
        "A": "Azure Table Storage",
        "B": "Azure Event Grid",
        "C": "Azure Cosmos DB SQL API",
        "D": "Azure Time Series Insights"
    },
    "explanation": "D: Time Series Insights là fully managed service cho time series data, thực hiện stream processing, data store, analytics và reporting. Nó chấp nhận streaming data từ IoT Hub hoặc Event Hubs và hiển thị data gần real time.\n\nC: Processed data được lưu trong analytical data store như Azure Cosmos DB, hỗ trợ high throughput và low latency."
}

translations[77] = {
    "stem": "Bạn có Azure subscription chứa Azure Blob Storage account tên store1. Bạn có on-premises file server tên Server1 chạy Windows Server 2016 lưu 500 GB company files. Bạn cần lưu bản sao company files từ Server1 vào store1. Hai Azure services nào có thể đạt mục tiêu này? (Lưu ý: trùng với câu 70)",
    "options": {},
    "explanation": "Xem giải thích câu 70."
}

translations[79] = {
    "stem": "Với mỗi phát biểu sau, chọn Yes nếu đúng, ngược lại chọn No. (Liên quan đến auditing cho Azure SQL databases với các loại storage accounts khác nhau)",
    "options": {},
    "explanation": "Box 1: Yes - Auditing hoạt động tốt với Standard storage account.\n\nBox 2: No - Auditing limitations: Premium storage hiện không được hỗ trợ.\n\nBox 3: No - Auditing limitations: Premium storage hiện không được hỗ trợ."
}

translations[80] = {
    "stem": "Bạn nên đề xuất sử dụng gì để migrate data? Kéo các tools phù hợp vào đúng data sources.",
    "options": {},
    "explanation": "Từ SQL Server 2012 database: Data Migration Assistant - DMA giúp upgrade lên modern data platform bằng cách phát hiện compatibility issues có thể ảnh hưởng database functionality.\n\nTừ table trong SQL Server 2014 database: Azure Cosmos DB Data Migration Tool - Có thể dùng để migrate SQL Server Database table tới Azure Cosmos."
}

translations[82] = {
    "stem": "Bạn có Azure subscription. Mạng on-premises chứa file server tên Server1 lưu 5 TB company files ít được truy cập. Bạn dự định copy files tới Azure Storage. Bạn cần triển khai storage solution đáp ứng:\n✑ Files phải available trong vòng 24 giờ khi được yêu cầu.\n✑ Giảm thiểu storage costs.\nHai giải pháp storage nào đạt mục tiêu này?",
    "options": {
        "A": "Tạo Azure Blob Storage account với Cool default access tier. Tạo blob container, copy files và đặt mỗi file ở Archive access tier.",
        "B": "Tạo general-purpose v1 storage account. Tạo blob container và copy files.",
        "C": "Tạo general-purpose v2 storage account với Cool default access tier. Tạo file share và copy files.",
        "D": "Tạo general-purpose v2 storage account với Hot default access tier. Tạo blob container, copy files và đặt mỗi file ở Archive access tier.",
        "E": "Tạo general-purpose v1 storage account. Tạo file share và copy files."
    },
    "explanation": "Đáp án A và D: Để giảm thiểu chi phí, Archive tier được tối ưu cho storing data ít truy cập, lưu tối thiểu 180 ngày với flexible latency requirements (hàng giờ). Cả hai tùy chọn đều đặt files ở Archive tier."
}

translations[83] = {
    "stem": "Bạn có app tên App1 sử dụng hai on-premises Microsoft SQL Server databases tên DB1 và DB2. Bạn dự định migrate DB1 và DB2 tới Azure. Bạn cần đề xuất Azure solution host DB1 và DB2. Giải pháp phải:\n✑ Hỗ trợ server-side transactions across DB1 và DB2.\n✑ Giảm thiểu administrative effort để update solution.",
    "options": {
        "A": "Hai Azure SQL databases trong elastic pool",
        "B": "Hai databases trên cùng Azure SQL managed instance",
        "C": "Hai databases trên cùng SQL Server instance trên Azure virtual machine",
        "D": "Hai Azure SQL databases trên different Azure SQL Database servers"
    },
    "explanation": "Elastic database transactions cho Azure SQL Database và Azure SQL Managed Instance cho phép chạy transactions span nhiều databases. SQL Managed Instance giảm administrative tasks vì service tự thực hiện hoặc đơn giản hóa đáng kể các tasks đó."
}

translations[84] = {
    "stem": "Bạn cần thiết kế highly available Azure SQL database đáp ứng:\n✑ Failover giữa replicas phải xảy ra không mất data.\n✑ Database phải remain available khi zone outage.\n✑ Giảm thiểu costs.\nBạn nên sử dụng deployment option nào?",
    "options": {},
    "explanation": "Azure SQL Database Premium - Hỗ trợ multiple redundant replicas tự động provisioned trong cùng datacenter. Sử dụng SQL Server AlwaysON technology, cung cấp resilience với 99.99% availability SLA và RPO=0. Hỗ trợ Availability Zones trong Premium service tier."
}

translations[85] = {
    "stem": "Bạn đang lên kế hoạch Azure Storage solution cho sensitive data. Data sẽ được truy cập hàng ngày. Dataset nhỏ hơn 10 GB. Bạn cần đề xuất storage solution đáp ứng:\n✑ Tất cả data written phải được retained 5 năm.\n✑ Sau khi written, data chỉ có thể đọc. Phải ngăn modifications và deletions.\n✑ Sau 5 năm, data có thể bị xóa nhưng không bao giờ được modified.\n✑ Giảm thiểu data access charges.",
    "options": {},
    "explanation": "Storage account type: General purpose v2 với Hot access tier cho blobs - Hot tier có lower access/transaction costs, phù hợp khi data được truy cập hàng ngày.\n\nConfiguration: Container access policy - Azure Immutable Blob Storage cung cấp WORM (Write Once, Read Many) capability đáp ứng yêu cầu."
}

translations[86] = {
    "stem": "Bạn đang thiết kế data storage solution hỗ trợ reporting. Solution sẽ ingest large volumes data ở JSON format bằng Azure Event Hubs. Khi data arrives, Event Hubs sẽ write data tới storage. Giải pháp phải:\n✑ Tổ chức data trong directories theo date và time.\n✑ Cho phép stored data được queried trực tiếp, transformed thành summarized tables, rồi stored trong data warehouse.\n✑ Data warehouse phải store 50 TB relational data và hỗ trợ 200-300 concurrent read operations.",
    "options": {},
    "explanation": "Data store cho ingested data: Azure Data Lake Storage Gen2 - Tối ưu cho big data analytics workloads, hỗ trợ hierarchical file system.\n\nData store cho data warehouse: Azure SQL Database Hyperscale - Hỗ trợ databases tới 100 TB, cung cấp high throughput và performance. Hyperscale multi-tiered architecture cho effective IOPS cao hơn General Purpose và Business Critical."
}

translations[88] = {
    "stem": "Bạn đang lên kế hoạch Azure IoT Hub solution bao gồm 50,000 IoT devices. Mỗi device stream data gồm temperature, device ID và time data. Khoảng 50,000 records được ghi mỗi giây. Data sẽ được visualized gần real time. Bạn cần đề xuất service để store và query data. Hai services nào bạn có thể đề xuất?",
    "options": {
        "A": "Azure Table Storage",
        "B": "Azure Event Grid",
        "C": "Azure Cosmos DB for NoSQL",
        "D": "Azure Time Series Insights"
    },
    "explanation": "C: Azure Cosmos DB for NoSQL - Cung cấp real-time access với fast read/write latencies globally, throughput và consistency được backed bởi SLAs.\n\nD: Azure Time Series Insights - Là fully managed analytics, storage và visualization service giúp explore và analyze billions of IoT events simultaneously."
}

translations[89] = {
    "stem": "Bạn đang lên kế hoạch Azure Storage solution cho sensitive data. Data được truy cập hàng ngày. Dataset nhỏ hơn 10 GB. Bạn cần đề xuất storage solution đáp ứng:\n• Tất cả data written phải retained 5 năm.\n• Sau khi written, data chỉ đọc. Ngăn modifications và deletions.\n• Sau 5 năm, data có thể bị xóa nhưng không bao giờ modified.\n• Giảm thiểu data access charges.",
    "options": {},
    "explanation": "Storage account type: General purpose v2 với Hot access tier cho blobs - Hot access tier cung cấp lower data access costs so với cool tier, phù hợp khi data truy cập hàng ngày.\n\nConfiguration: Container access policy - Tạo container access policy với specific permissions (read-only) và set expiry time 5 năm, ngăn modifications và deletions."
}

translations[90] = {
    "stem": "Bạn đang thiết kế data analytics solution sử dụng Azure Synapse và Azure Data Lake Storage Gen2. Bạn cần đề xuất Azure Synapse pools đáp ứng:\n• Ingest data từ Data Lake Storage vào hash-distributed tables.\n• Implement, query và update data trong Delta Lake.",
    "options": {},
    "explanation": "Ingest data vào hash-distributed tables: Dedicated SQL pool - Phù hợp cho big và complex tasks, hỗ trợ hash-distributed tables.\n\nImplement, query và update data trong Delta Lake: Serverless SQL pool - Tự động adjust resources dựa trên nhu cầu, chỉ pay for what you use, phù hợp cho on-demand queries."
}

translations[92] = {
    "stem": "Bạn có on-premises app tên App1. Khách hàng sử dụng App1 để quản lý digital images. Bạn dự định migrate App1 tới Azure. Bạn cần đề xuất data storage solution cho App1 đáp ứng:\nYêu cầu image storage:\n• Encrypt images at rest.\n• Cho phép files tới 50 MB.\n• Quản lý access tới images bằng Azure Web Application Firewall (WAF) trên Azure Front Door.\nYêu cầu customer account:\n• Hỗ trợ automatic scale out of storage.\n• Duy trì availability nếu datacenter fails.\n• Hỗ trợ reading và writing data từ multiple Azure regions.",
    "options": {},
    "explanation": "Image storage: Azure Blob storage - Azure Front Door tăng tốc delivery static content từ Azure Storage blobs, cung cấp secure và scalable architecture.\n\nCustomer accounts: Azure Cosmos DB - Hỗ trợ multi-region writes, data distribution tới bất kỳ Azure region nào chỉ bằng một nút bấm."
}

translations[96] = {
    "stem": "Bạn có app tạo 50,000 events mỗi ngày. Bạn dự định stream events tới Azure event hub và sử dụng Event Hubs Capture để implement cold path processing. Output của Event Hubs Capture sẽ được consumed bởi reporting system. Bạn cần xác định loại Azure storage nào phải được provisioned để hỗ trợ Event Hubs Capture, và inbound data format nào reporting system phải hỗ trợ.",
    "options": {},
    "explanation": "Storage type: Azure Data Lake Storage Gen2 - Event Hubs Capture hỗ trợ output tới Azure Data Lake Storage Gen2.\n\nData format: Avro - Event Hubs Capture lưu captured data ở Avro format."
}

translations[98] = {
    "stem": "Bạn có Azure subscription. Subscription chứa Azure SQL managed instance lưu employee details, bao gồm social security numbers và phone numbers. Bạn cần cấu hình managed instance đáp ứng:\n• Helpdesk team chỉ thấy 4 chữ số cuối của phone number.\n• Cloud administrators phải bị ngăn không thể xem employee social security numbers.",
    "options": {},
    "explanation": "Phone numbers: Dynamic data masking - Giúp ngăn unauthorized access tới sensitive data bằng cách cho phép chỉ hiển thị một phần data (ví dụ: 4 chữ số cuối).\n\nSocial security numbers: Always Encrypted - Tính năng bảo vệ sensitive data. Data được mã hóa ở client-side, cloud administrators không thể xem plaintext data."
}

translations[100] = {
    "stem": "Bạn đang thiết kế storage và analytics solution sẽ ingest, store và analyze petabytes (PBs) structured, semi-structured và unstructured text data. Analyzed data sẽ được offloaded tới Azure Data Lake Storage Gen2 cho long-term retention. Bạn cần đề xuất solution đáp ứng:\n• Stores processed data.\n• Cung cấp interactive analytics.\n• Hỗ trợ manual scaling, built-in autoscaling và custom autoscaling.",
    "options": {},
    "explanation": "Cho storage và interactive analytics: Azure Data Explorer - Tối ưu cho real-time analysis trên large volumes of streaming data, hỗ trợ cả manual và auto scaling.\n\nQuery language: KQL (Kusto Query Language) - Ngôn ngữ query native của Azure Data Explorer cho interactive analytics."
}

# Now apply translations to the data
for q in data[:100]:
    qid = q['id']
    if qid in translations:
        t = translations[qid]
        # Update stem
        if 'stem' in t and t['stem']:
            q['stem']['vi'] = t['stem']
        # Update options
        if 'options' in t and t['options']:
            for opt in q.get('options', []):
                if opt['key'] in t['options']:
                    opt['text']['vi'] = t['options'][opt['key']]
        # Update explanation
        if 'explanation' in t and t['explanation']:
            q['explanation']['vi'] = t['explanation']

# Save updated data
with open(r'c:\projects\myproject\azure-quiz\data\az-305\questions.json', 'w', encoding='utf-8') as f:
    json.dump(data, f, ensure_ascii=False, indent=2)

print(f"Updated {len(translations)} questions with Vietnamese translations.")
