AZ-104考題解析_部署和管理 Azure 計算資源 (20–25%)
Q1.You have an app named App1 that runs on an Azure web app named webapp1.
The developers at your company upload an update of App1 to a Git repository named Git1.
Webapp1 has the deployment slots shown in the following table.
Which two actions should you perform?
○ Stop webapp1-prod.
○ Deploy the App1 update to webapp1-prod, and then test the update.
○ Deploy the App1 update to webapp1-test, and then test the update.
○ Stop webapp1-test.
○ Swap the slots.
Azure App Service 部署位置可讓您透過在預備環境中測試變更,再將其推送到生產環境,安全地部署更新。以下是此情境的運作方式:
webapp1-prod → 正式環境槽位:這是使用者存取應用程式正式版本的地方。
webapp1-test → 測試/預發環境槽位:這是您在不影響使用者的情況下測試新版本的地方。
Step1.部署到 webapp1-test 確保更新能在正式應用於生產環境前,先在預備環境中進行測試。
Step2.透過位置交換來推播更新。在確認更新於預備位置運作正常後,您會將 webapp1-test 與 webapp1-prod 進行交換。這樣就能讓經過測試的更新無縫上線,不會造成服務中斷。
========================================================================
Q2.You have an Azure subscription.
You need to deploy a virtual machine by using an Azure Resource Manager (ARM) template.
You need to complete the following template.
Which value should you choose for Placeholder 1?
○ Reference
○ ResourceId
○ Union
要正確配置網路介面的相依性,您應該使用 resourceId() 函數。因此,Placeholder 1 的值應為 resourceId。
ARM 模板中的 dependsOn 區段用於指定必須在當前資源之前部署的資源。
當要在同一個模板中引用其他資源時,通常會使用 resourceId() 函數來獲取該資源的唯一識別碼。
在此案例中,虛擬機器需要先部署網路介面( VM1 )。在 dependsOn 陣列中參照 VM1 資源 ID 的正確方式是使用:"[resourceId('Microsoft.Network/networkInterfaces', 'VM1')]"
resourceId()函式會根據資源類型( Microsoft.Network/networkInterfaces )與資源名稱( VM1 )動態建構資源 ID。
其他選項
Union =>並非標準函式或關鍵字。這可能是個混淆選項。
Reference => 在 ARM 範本中, reference() 函式用於擷取已部署資源的執行階段屬性。雖然您可以在部署後使用它來取得網路介面的相關資訊,但這不是正確用於 dependsOn 陣列中的函式。
Ref:
https://learn.microsoft.com/en-us/azure/azure-resource-manager/templates/overview
========================================================================
Q3.You have an Azure subscription.
You need to deploy a virtual machine by using an Azure Resource Manager (ARM) template.
You need to complete the following template.
○ Array
○ Image
○ ImageReference
○ vhd
Placeholder 2 位於 ARM 模板的 storageProfile 區段中,具體位置是在虛擬機器作業系統磁碟的配置定義處。在 storageProfile 內,關於 OS 磁碟來源映像的詳細資訊會標註在描述映像本身的屬性下方。Azure 使用 imageReference 屬性來定義應該用於建立虛擬機器 OS 磁碟的市集映像、自訂映像或共用映像庫映像。
當選擇 ImageReference 時,要正確指定了包含虛擬機器部署所需作業系統映像資訊的屬性。
一些後續屬性( publisher 、 Offer 、 sku 、 version )皆隸屬於 imageReference 之下,以完整定義此範例中的市集映像。
Ref:
Create a Windows virtual machine from a Resource Manager template
Microsoft.Compute virtualMachines
========================================================================
Q4.You plan to deploy an Azure container instance by using the following Azure Resource Manager template.
Based on the information presented, select the answer choice that completes the following statement correctly.
“Internet users ________________________________________.”
“Internet users ________________________________________.”
○ Can connect to the container instance from any device
可以從任何裝置連線至該容器實例
○ Cannot connect to the container instance
無法連線至容器實例
○ Can only connect to the container instance from devices that run Windows
僅能從執行 Windows 的裝置連線至容器實例
"ipAddress" 區段:此區段位於容器群組層級(在個別容器定義之外),並指定了公共 IP 位址的配置。ipAddress 中的 "ports" 陣列:此陣列定義將在公共 IP 位址上公開的連接埠。它指定了 "protocol": "TCP" 和 "port": 80" ,表示允許 TCP 連接埠 80 的流量到達容器群組。
在 ipAddress 區段中,將 "type" 設定為 "Public" 會明確要求為容器群組配置公共 IP 位址。這意味著該容器群組將可從網際網路進行存取。
其他選項
Cannot connect to the container instance
該設定明確要求並公開一個具有開放 80 埠的公共 IP 位址,使其可從網際網路存取。
Can only connect to the container instance from devices that run Windows
容器本身執行的是 Windows 基礎映像( microsoft/iis:nanoserver ),但網路可存取性由公共 IP 位址與開放埠決定,這些與用戶端的作業系統無關。
========================================================================
Q5.You plan to deploy an Azure container instance by using the following Azure Resource Manager template.
Based on the information presented, select the answer choice that completes the following statement correctly.
“If Internet Information Services (IIS) in the container fails, ________________________________.”
○ The container instance will restart automatically
容器執行個體將自動重新啟動
○ The container instance will only restart manually
容器執行個體僅能手動重新啟動
○ The container instance must be redeployed
必須重新部署容器執行個體
在 ARM 範本中決定容器失敗時重啟行為的關鍵屬性,是容器群組層級的 "restartPolicy" 屬性:
"restartPolicy": "OnFailure",
此設定明確指示 Azure 容器執行個體如何處理容器結束狀態。當設定為 "OnFailure" 時,代表若容器群組內任何容器以非零結束代碼退出(表示發生錯誤),Azure 將會自動重新啟動該容器。
若容器內的網際網路資訊服務 (IIS) 發生錯誤,且容器以失敗退出代碼終止時, "restartPolicy": "OnFailure" 設定將會觸發 webprod 容器的自動重啟。整個容器執行個體(容器群組)將保持運行狀態,Azure 會嘗試讓故障容器重新上線。
其他選項
The container instance will only restart manually
若 "restartPolicy" 設定為 "Never" ,通常便需要手動重新啟動。
The container instance must be redeployed
重新部署整個容器執行個體通常是針對組態變更或容器群組層級無法復原的錯誤所採取的較激烈措施,而非針對已設定重新啟動原則時個別容器故障的情況。 "OnFailure" 原則的設計正是為了優雅處理這類情境,會嘗試重新啟動故障的容器。
Ref
Run containerized tasks with restart policies
========================================================================
Q6.You have an Azure subscription that contains multiple virtual machines in the West US Azure region.
You need to use Traffic Analytics in Azure Network Watcher to monitor virtual machine traffic.
Which two resources should you create?
○ a storage account
一個儲存體帳戶
○ a Microsoft Sentinel workspace
一個 Microsoft Sentinel 工作區
○ a Log Analytics workspace
一個 Log Analytics 工作區
○ a Data Collection Rule (DCR) in Azure Monitor
Azure Monitor 中的資料收集規則 (DCR)
○ an Azure Monitor workbook
Azure Monitor 活頁簿
Azure Traffic Analytics 是 Network Watcher 的一項功能,需要兩種主要資源才能正常運作,並提供網路流量的深入分析:
- A Storage Account
流量分析會擷取網路流量記錄(NSG 流量記錄)。這些原始記錄在處理與分析前需要一個儲存空間,而儲存體帳戶正是提供此必要儲存功能。 - A Log Analytics Workspace
當 NSG 流量記錄儲存至儲存體帳戶後,流量分析會處理這些數據以提供有意義的洞見、視覺化呈現及分析結果。處理後的資料將儲存並顯示於 Log Analytics 工作區中。可透過 Log Analytics 工作區查詢與分析流量分析所收集的流量數據。
其他選項
a Microsoft Sentinel workspace
Microsoft Sentinel 是一款安全性資訊與事件管理 (SIEM) 及安全性協調、自動化與回應 (SOAR) 解決方案。雖然 Sentinel 能與 Azure Monitor 記錄(包含來自 Network Watcher 的記錄)整合,但這並非啟用和使用流量分析功能本身的必要條件。
a Data Collection Rule (DCR) in Azure Monitor
資料收集規則用於指定資料的擷取方式,以及應在 Azure Monitor 內傳送至何處。
雖然 DCR 在 Azure Monitor 的資料收集中日益重要,但流量分析擁有自身指向包含 NSG 流量記錄的儲存體帳戶的設定。在初始設定中,您無需專門為流量分析直接建立 DCR。
an Azure Monitor workbook
提供互動式視覺化效果,並能分析 Azure Monitor (包括 Log Analytics) 中已收集的資料。
雖然您可以使用工作簿在 Log Analytics 工作區內視覺化流量分析資料,但建立工作簿屬於後續配置步驟,並非啟用流量分析前需要建立的資源。
Traffic analytics overview
========================================================================
Q7.You have an Azure subscription named Subscription1.
In Subscription1, you create an alert rule named Alert1.
The Alert1 action group is configured as shown in the following exhibit.
Based on the information presented, select the answer choice that completes the following statement correctly.
“The number of email messages that Alert1 will send in an hour _____.”
○ 4
○ 0
○ 6
○ 12
○ 60
EmailReceivers: {Action1 - EmailAction}。這表示在此動作群組中設定了一個郵件動作( EmailAction )。每次觸發警示時,這個郵件動作都會執行,導致一封郵件被寄出。
由於警報每分鐘觸發一次,且每次觸發都會因配置的電子郵件動作而發送一封郵件,因此一小時(60 分鐘)內發送的電子郵件總數將為60
Action groups
========================================================================
Q8.You have an Azure subscription named Subscription1.
In Subscription1, you create an alert rule named Alert1.
The Alert1 action group is configured as shown in the following exhibit.
Based on the information presented, select the answer choice that completes the following statement correctly.
“The number of SMS messages that Alert1 will send in an hour is ________.”
○ 0
○ 4
○ 6
○ 12
○ 60
警示觸發頻率:警示規則「Alert1」設定為每分鐘觸發一次。這表示當警示規則中定義的條件被滿足時,相關聯的動作群組就會每 60 秒執行一次。
簡訊動作群組設定:Alert1 的動作群組包含一個簡訊動作( SMSAction ),如 SmsReceivers: {Action1 - SMSAction} 所示。若無任何限制,這代表每次警示觸發時都會發送一則簡訊。
然而,Azure 對發送簡訊通知設有速率限制。此限制為每 5 分鐘僅能發送 1 則簡訊訊息。這項限制是為了防止濫用並控管簡訊發送相關成本。
因此,儘管警報觸發的頻率大幅增加,Azure 平台簡訊發送的速率限制機制仍確保在一小時內最多只會發送 12 則簡訊
10 SMS actions in an action group.
In production: No more than one SMS message every five minutes.
In a test action group: No more than one SMS every one minute.
========================================================================
Q9.You have an Azure subscription named Subscription1 that contains the resources shown in the following table.
Which resources can be backed up to Vault1?
○ VM1 only
○ VM1 and share1 only
○ VM1 and SQL1 only
○ VM1, storage1, and SQL1 only
○ VM1, blob1, share1, and SQL1
Azure 備份至復原服務保存庫有特定的區域和資源群組依賴性。若要將資源備份至特定保存庫,該資源通常必須與Vault位於相同的 Azure 區域。
Vault1 位於Central US ,屬於資源群組 RG1。
VM1 位於Central US,屬於資源群組 RG2。
雖然與 Vault1 位於相同區域,但屬於不同的資源群組。不過,通常在相同區域內跨資源群組的備份是受支援的。
storage1 位於West US,與 Vault1(美國中部)位於不同區域。因此,您無法直接將 storage1 或其內容( blob1 、 share1 )備份至 Vault1 。
SQL1 位於East US,同樣與 Vault1(美國中部)位於不同區域。因此,您無法直接將 SQL1 備份至 Vault1 。
因此,清單中唯一與 Vault1 位於相同區域且可備份至該處的資源是 VM1。
Ref:
========================================================================
Q10.You have a Recovery Services vault named RSV1. RSV1 has a backup policy that retains instant snapshots for five days and daily backup for 14 days.
RSV1 performs daily backups of VM1. VM1 hosts a static website that was updated eight days ago.
You need to recover VM1 to a point eight days ago. The solution must minimize downtime.
What should you do first?
○ Delete VM1.
刪除 VM1。
○ Restore VM1 by using the Create new restore configuration option.
使用「建立新的還原設定」選項來還原 VM1。
○ Deallocate VM1.
解除配置 VM1。
○ Restore VM1 by using the Replace existing restore configuration option.
使用「取代現有還原設定」選項來還原 VM1。
目標是將 VM1 復原至八天前的狀態,同時將停機時間降至最低。
Backup Policy該保存庫會保留即時快照五天以及每日備份十四天。由於網站是在八天前更新的,所需的復原點仍落在每日備份的保留期間內。
其他選項
Restore VM1 by using the Replace existing restore configuration option.
此選項會以還原資料覆蓋目前的 VM1。雖然能達到還原至指定時間點的目標,但需要在整個還原過程中讓 VM 保持不可用狀態,這將導致明顯的停機時間。
Restore VM1 by using the Create new restore configuration option.
建立新項目:此選項會從選取的復原點建立新的虛擬機器。原始 VM1 保持不變。當新虛擬機器運行並確認處於所需狀態(八天前的狀態)後,您便可將流量重新導向至此新虛擬機器。此方法能將網站停機時間降至最低,因為原始虛擬機器會持續運作直至還原的虛擬機器準備就緒。
Deleting or Deallocating VM1
這些動作會立即讓當前網站下線,直接違反了最小化停機時間的要求。刪除虛擬機器還會使復原過程變得複雜。
How to restore Azure VM data in Azure portal
========================================================================
Q11.You have a Microsoft Entra tenant that contains the users shown in the following table.
You need to perform the following tasks:
- Create an attribute named Property1.
- Ensure that Admin1 can assign Property1 to User1.
Which two settings should you configure on the Microsoft Entra ID blade?
○ Custom security attributes 自訂安全性屬性
○ Roles and administrators 角色與管理員
○ External Identities 外部身分識別
○ Administrative units 管理單位
○ Application proxy 應用程式 Proxy
○ Microsoft Entra Connect
Custom security attributes
此功能可讓您直接在 Microsoft Entra ID 中定義及管理自訂屬性(例如 Property1 )。您將使用此設定來建立 Property1 屬性並定義其屬性(資料類型、允許值等)。
Roles and administrators
了讓擁有「使用者管理員」角色的 Admin1 能將新建立的 Property1 指派給 User1 ,您需要授予 Admin1 與自訂安全性屬性相關的必要權限。這可透過「角色與管理員」設定來完成。
其他選項
External Identities
此設定與管理來賓使用者及外部協作相關,而非用於定義或管理內部使用者的自訂屬性。
Administrative units:
管理單位可協助將管理權限範圍限定於特定使用者、群組或裝置的子集。
但這並非建立屬性或讓 Admin1 能夠指派該屬性的直接必要條件。
Application proxy:
此功能提供安全的遠端存取給內部部署的網頁應用程式,且與使用者屬性無關。
Microsoft Entra Connect:
此工具用於同步本地 Active Directory 與 Microsoft Entra ID 之間的身分識別資訊。由於需求是要直接在 Microsoft Entra ID 中建立屬性並管理其內部權限,Microsoft Entra Connect 並非相關設定。
========================================================================
Q12.You have an Azure subscription.
You plan to deploy a container.
You need to recommend which Azure services can scale the container automatically.
What should you recommend?
○ Azure Container Apps only
○ Azure Container Instances only
○ Azure Container Apps or Azure App Service only
○ Azure Container Instances or Azure App Service only
○ Azure Container Apps, Azure Container Instances, or Azure App Service
Azure Container Apps 和 Azure App Service 都為容器提供內建的自動擴展功能。它們能根據 CPU 使用率、記憶體消耗量或自訂指標等數據,自動調整容器執行個體的數量。這確保您的容器化應用程式能在無需人工干預的情況下,應對不同程度的流量與需求變化。
其他選項
Azure Container Instances (ACI)
主要設計用於以單一執行個體或小型手動擴展群組方式執行容器。
儘管您可以透過其他 Azure 服務(如 Azure Logic Apps 或 Azure Functions)協調 ACI 的擴展,但 ACI 本身並未像 Container Apps 或 App Service 那樣,內建基於資源使用率或自訂指標的自動擴展功能。
Ref:
========================================================================
Q13.You have an Azure subscription.
You need to create an Azure container instance named cont1. The solution must meet the following requirements:
- Ensure that specific configuration parameters are applied to cont1 during the container startup.
- Provide secure values to cont1 during the container startup.
What should you configure for cont1?
○ a command override
○ tags
○ customer-managed keys
○ environment variables
客戶管理金鑰用於加密 Azure 服務中靜態儲存的資料。雖然安全性很重要,但針對 Azure 容器實例的客戶管理金鑰主要與使用 Azure 檔案儲存體之容器群組的基礎儲存加密有關。
它們並不會在容器應用程式啟動時直接提供組態參數或安全數值給執行中的應用程式。
標籤是協助您組織與分類 Azure 資源的鍵值對。這些標籤是與容器執行個體本身相關聯的中繼資料,不會直接影響組態設定,也不會在啟動時為容器應用程式提供安全數值。
命令覆寫讓您能在容器啟動時指定執行不同的指令,而非 Dockerfile 中定義的預設指令。雖然這可能會影響容器的行為,但這並非提供組態參數或安全值的主要機制。直接將敏感資訊嵌入命令覆寫中也是不安全的做法。
Set environment variables in container instances
========================================================================
Q14.You have the Azure virtual machines shown in the following table.
You have a Recovery Services vault that protects VM1 and VM2.
You need to protect VM3 and VM4 by using Recovery Services.
What should you do first?
○ Create a new Recovery Services vault 建立一個新的復原服務保存庫
○ Create a storage account 建立一個儲存體帳戶
○ Configure the extensions for VM3 and VM4 為 VM3 和 VM4 設定擴充功能
○ Create a new backup policy 建立新的備份原則
Azure 復原服務保存庫(RSV)是區域特定的。現有的復原服務保存庫保護位於西歐地區的虛擬機器(VM1 和 VM2)。若要保護位於北歐地區的虛擬機器(VM3 和 VM4),您需要在北歐 Azure 區域建立新的復原服務保存庫。您無法使用相同的復原服務保存庫來保護位於不同 Azure 區域的虛擬機器。
其他選項
Create a storage account ->這動作可以在 建完RSV之後再接續作業
雖然復原服務會使用儲存體帳戶來儲存備份資料,但您必須先建立復原服務保存庫,才能管理北歐地區 VM3 和 VM4 的備份流程與原則。在備份設定過程中,儲存體帳戶將會與新的保存庫建立關聯。
Configure the extensions for VM3 and VM4 ->這動作可以在 建完RSV之後再接續作業
您無法針對位於不同區域的復原服務保存庫配置這些擴充功能進行保護。您必須先建立保存庫,接著才能為 VM3 和 VM4 設定備份,這包含確保相關擴充功能已正確安裝。
Create a new backup policy ->這動作可以在 建完RSV之後再接續作業
備份原則定義了備份的排程和保留設定。您需要為 VM3 和 VM4 建立備份原則,但此原則需與同區域(北歐)的復原服務保存庫建立關聯。因此,建立保存庫是必要的第一步。
Tutorial: Set up disaster recovery for Azure VMs
========================================================================
Q15.You have an Azure subscription.
You plan to migrate 50 virtual machines from VMware vSphere to the subscription.
You create a Recovery Services vault.
What should you do next?
○ Create a recovery plan 建立復原計畫
○ Deploy an Open Virtualization Application (OVA) template to vSphere.
將開放式虛擬化應用程式 (OVA) 範本部署至 vSphere。
○ Configure a virtual network. 設定虛擬網路。
○ Configure an extended network. 設定擴充網路。
由於復原服務保存庫已經建立,這個問題指的是 Azure Site Recovery (ASR),而不是 Azure Migrate。
Azure Site Recovery 需要一個 Azure 虛擬網路來進行虛擬機器的複寫。若沒有這個虛擬網路,複寫的機器將無處可去。因此,下一步是設定目標 Azure 虛擬網路,讓複製的 VMware 虛擬機器在容錯移轉或遷移時能夠連接到該網路。
當使用 Azure Site Recovery (ASR) 將虛擬機器從 VMware vSphere 遷移至 Azure 時,在建立復原服務保存庫後,下一步必須在 Azure 中設定虛擬網路。此網路將作為遷移後虛擬機器的目的地,確保它們在遷移後能正常運作。
Ref:
Prepare Azure for on-premises disaster recovery to Azure
========================================================================
Q16.You have an Azure subscription that contains a resource group named RG1.
You plan to create a storage account named storage1.
You have a Bicep file named File1.
You need to modify File1 so that it can be used to automate the deployment of storage1 to RG1.
Which property should you modify?
○ kind
○ scope
○ sku
○ location
在 Bicep 中,資源宣告的 scope 屬性定義了該資源的目標 Azure 範圍。
若要將儲存體帳戶 ( storage1 ) 部署至特定資源群組 ( RG1 ),您需要確保 File1.bicep 中儲存體帳戶資源的範圍已設定為該資源群組。若未明確將範圍定義為資源群組,Bicep 可能會預設在更高層級的範圍 (例如訂閱) 進行部署,如此便無法將儲存體帳戶放置於所需的資源群組中。
其他選項
kind 屬性
storage 帳戶的 kind 屬性定義了儲存帳戶的類型(例如 StorageV2 、 BlobStorage )。雖然您需要定義 kind 來指定儲存帳戶的功能,但它並不決定儲存帳戶的部署位置。
sku 屬性
指定了儲存帳戶的效能層級和複寫選項(例如 Standard_LRS 、 Premium_ZRS )。與 kind 類似,它配置的是儲存帳戶的功能,而非其部署位置。
location 屬性
指定了儲存帳戶將建立的 Azure 區域 (例如 eastus 、 westeurope )。雖然資源群組 RG1 也位於特定位置,但在 Bicep 檔案中明確設定儲存帳戶的 location 對其部署至關重要。然而,scope 才是將部署導向該位置內特定資源群組的關鍵。
通常會確保儲存帳戶的 location 與 RG1 的位置相符,以獲得組織架構和潛在成本/延遲優勢,但 scope 才是直接控制部署目標(即資源群組)的屬性。
Ref:
Use Bicep to deploy resources to resource groups
========================================================================
Q17.You have an Azure subscription. You plan to use Azure Resource Manager templates to deploy 50 Azure virtual machines that will be part of the same availability set.
You need to ensure that as many virtual machines as possible are available if the fabric fails or during servicing.
You need to configure the following template.
What value should you choose for “platformFaultDomainCount”?
○ 0
○ 1
○ 2
○ 3
「platformFaultDomainCount」的正確設定值應為 3。
平台容錯網域代表 Azure 資料中心的底層實體基礎架構,例如電力與網路交換器。透過將虛擬機器分散於多個容錯網域中,可大幅降低單一硬體故障同時影響大量虛擬機器的風險。Azure 保證不同容錯網域中的虛擬機器,不會共用相同的電力與網路單點故障來源。
為了在 Azure 平台內達到最高的可用性並抵禦硬體故障,您應將 platformFaultDomainCount 設定為其最大可用值,在大多數 Azure 區域中此值為 3。這能確保您的虛擬機器分散於三個不同的容錯網域中。
其他選項:
使用容錯網域數量為 0 對於 platformFaultDomainCount 是無效的。必須為正整數。
使用容錯網域數量為 1,意味著您的可用性集中所有虛擬機器可能會被部署在同一底層硬體上。若該硬體發生故障,所有虛擬機器都可能受到影響。這不符合在結構性故障時最大化可用性的需求。
使用容錯網域數量為2,雖然 2 比 1 已經更好了,因為它能將您的虛擬機器分散在兩個容錯網域中,降低單一硬體故障的影響。不過,使用最大可用值 3 則能提供最高層級的保護,防範底層基礎架構問題。
以下官網three搜尋的到
========================================================================
Q18.You have an Azure subscription. You plan to use Azure Resource Manager templates to deploy 50 Azure virtual machines that will be part of the same availability set.
You need to ensure that as many virtual machines as possible are available if the fabric fails or during servicing.
You need to configure the following template.
What value should you choose for “platformUpdateDomainCount”?
○ 0
○ 1
○ 6
○ 12
○ 17
○ 20
平台更新網域代表底層硬體的邏輯分組,在計畫性維護期間可同時重新啟動。透過將您的虛擬機器分散於多個更新網域,可最小化在 Azure 平台更新期間同時無法使用的 VM 數量。Azure 保證一次僅會重新啟動一個更新網域。
為確保在計劃性維護事件期間達到最高可用性,您應將 platformUpdateDomainCount 設定為其最大可用值 20。此配置會將您的虛擬機器分散至最多數量的更新網域,確保在任何時間點僅有最小部分的虛擬機器會受到更新影響。
========================================================================
Q19.You have an Azure subscription that contains the resource groups shown in the following table.
You create the following Azure Resource Manager (ARM) template named deploy.json.
New-AzSubscriptionDeployment -Location westus -TemplateFile deploy.json
For the following statement, select Yes if the statement is true. Otherwise, select No.
“The template creates a resource group named RG0 in the East US Azure region.”
○ Yes
○ No
Azure Resource Manager (ARM)範本 deploy.json 包含了 Microsoft.Resources/resourceGroups 的資源定義。在此定義中,資源群組的 location 屬性被明確硬編碼為 "eastus" 。 copy 迴圈設定會建立 count: 4 個資源群組,其名稱生成規則為 RG 後接索引值,從 0 開始計數。這意味著將建立名為 RG0、RG1、RG2 和 RG3 的資源群組。
New-AzSubscriptionDeployment cmdlet 的 -Location westus 參數指定了部署元數據(部署操作本身的記錄)將儲存的位置。它不會覆寫 ARM 範本中明確定義的資源位置。範本中資源群組資源的 location 屬性對於資源群組實際的實體位置具有優先權。
========================================================================
Q20.You have an Azure subscription that contains the resource groups shown in the following table.
You create the following Azure Resource Manager (ARM) template named deploy.json.
New-AzSubscriptionDeployment -Location westus -TemplateFile deploy.json
For the following statement, select Yes if the statement is true. Otherwise, select No.
“The template creates four new resource groups."
○ Yes
○ No
Azure Resource Manager (ARM) 範本使用 copy 迴圈搭配 count: 4 ,試圖建立四個分別名為 RG0、RG1、RG2 和 RG3 的資源群組。這些資源群組皆指定在 eastus 地區建立。
然而,這個 Azure 訂閱已包含:
RG1 in East US RG1 位於 East US
RG2 in West US RG2 位於 West US
當範本部署完成時:
RG0:此資源群組不存在於訂閱中。它將會在 East US 被建立。(已建立 1 個新 RG)
RG1:名為 RG1 的資源群組已存在於 East US 中。由於範本中指定的位置( eastus )與現有資源群組的位置相符,Azure Resource Manager 會將其識別為現有資源,而不會建立新的資源群組。這是一個冪等操作,實際上不會對此實例造成任何變更。
RG2:名為 RG2 的資源群組已存在於 West US 。範本嘗試在 East US 建立 RG2 。您無法變更現有資源群組的位置。嘗試使用現有名稱但不同位置建立資源群組,將導致該特定執行個體的部署失敗。因此,不會建立新的 RG2。
RG3:此資源群組在訂閱中不存在。它將在 East US 建立。(已建立 1 個新 RG)
因此,在這四次嘗試中,僅有兩個新的資源群組(RG0 和 RG3)會實際由此範本部署建立。
========================================================================
Q21.You have an Azure subscription that contains the resource groups shown in the following table.
You create the following Azure Resource Manager (ARM) template named deploy.json.
New-AzSubscriptionDeployment -Location westus -TemplateFile deploy.json
For the following statement, select Yes if the statement is true. Otherwise, select No.
“The template creates a resource group named RG3 in the West US Azure region.”
○ Yes
○ No
ARM 範本中指定 RG3 (由 [concat('RG', copyIndex())] 為 copyIndex() = 3 生成)應該建立在 eastus 區域。部署命令 New-AzSubscriptionDeployment -Location westus 指定了部署元數據的儲存位置,但不會覆寫模板中為資源指定的位置。
========================================================================
Q22.You plan to move a distributed on-premises app named App1 to an Azure subscription.
After the planned move, App1 will be hosted on nine Azure virtual machines.
You need to ensure that App1 always runs on at least eight virtual machines during planned Azure maintenance.
What should you create?
○ one virtual machine scale set that has 12 virtual machines instances
一個包含 12 台虛擬機器執行個體的虛擬機器擴展集
○ one virtual machine scale set that has 10 virtual machines instances
一組虛擬機器擴展集,包含 10 個虛擬機器實例
○ one Availability Set that has three fault domains and one update domain
一組可用性設定組,包含三個容錯網域和一個更新網域
○ one Availability Set that has 10 update domains and one fault domain
一組可用性設定組,包含 10 個更新網域和一個容錯網域
在 Azure 中,計劃性維護通常會影響更新域,而非容錯域。
因此,關鍵在於:
您有 9 台運行 App1 的虛擬機器。
您希望確保至少有 8 台持續運作,換言之,最多只能有一台虛擬機器同時受到影響。
為實現此目標,將虛擬機器分散到 10 個更新網域 — 如此在維護期間,Azure 一次只會更新一個網域,且 9 台虛擬機器中最多只有 1 台可能會重新啟動。一個容錯網域即已足夠,因為容錯網域主要應對實體硬體故障,而非計劃性維護。
留言
張貼留言