การสร้างเอกสารจากรหัสโครงสร้างพื้นฐาน

เสร็จสมบูรณ์เมื่อ

Tip

ดูแท็บ ข้อความและรูปภาพ สําหรับรายละเอียดเพิ่มเติม!

รหัสโครงสร้างพื้นฐานมีเอกสารน้อยเกินไป เทมเพลต Bicep อาจปรับใช้สถาปัตยกรรมหลายชั้นที่ซับซ้อนได้อย่างถูกต้อง แต่ถ้าไม่มีใครบันทึกสิ่งที่ปรับใช้เหตุใดทรัพยากรแต่ละรายการจึงมีอยู่หรือสิ่งที่พารามิเตอร์ควบคุมเทมเพลตจะกลายเป็นความรู้ของชนเผ่า เฉพาะผู้ที่เขียนเท่านั้นที่สามารถเปลี่ยนแปลงได้อย่างปลอดภัย

ช่องว่างนี้มีอยู่เนื่องจากเอกสารประกอบนั้นน่าเบื่อในการเขียนและข้ามได้ง่าย หลังจากเสร็จสิ้นและตรวจสอบเทมเพลต Bicep 400 บรรทัดแล้ว การเขียนคําอธิบายสถาปัตยกรรมที่ตรงกันจะให้ความรู้สึกเหมือนเป็นโครงการแยกต่างหาก

GitHub Copilot เปลี่ยนสมการนี้ เมื่อได้รับเทมเพลต Copilot สามารถสร้างฉบับร่างแรกของเอกสารได้ภายในไม่กี่วินาที งานของวิศวกรเปลี่ยนจากการเขียนเอกสารเป็นการทบทวนและปรับแต่ง เอกสารประกอบจะหยุดเป็นทางเลือกและเริ่มเป็นส่วนหนึ่งของเวิร์กโฟลว์ปกติ

การสร้างคําอธิบายสถาปัตยกรรมภาษาธรรมดา

ความต้องการเอกสารที่เร่งด่วนที่สุดคือคําอธิบายที่มนุษย์อ่านได้เกี่ยวกับสิ่งที่เทมเพลตปรับใช้ เอกสารระดับนี้คือสิ่งที่ผู้จัดการโครงการ ผู้ตรวจสอบความปลอดภัย หรือสมาชิกในทีมใหม่ต้องการก่อนที่พวกเขาจะสามารถเข้าใจหรือทํางานกับโครงสร้างพื้นฐานได้

Explain what this Bicep template deploys in plain language.
Structure your explanation as follows:
1. A one-paragraph summary of the overall architecture
2. A section for each major resource group or logical component,
   describing what it does and why it exists
3. A description of how the components connect to each other
4. Any security controls that are configured

Use language that a technical project manager could understand.
Avoid Bicep-specific syntax in the explanation.

[paste template here]

คําแนะนําโครงสร้างเป็นสิ่งสําคัญ หากไม่มี Copilot จะสร้างรายการทรัพยากรแบบแบนแทนที่จะเป็นคําอธิบายที่สื่อถึงเจตนารมณ์ของสถาปัตยกรรม

ตัวอย่างโครงสร้างเอาต์พุต

สําหรับเทมเพลตเครือข่ายแบบฮับสปีก คําอธิบายที่มีโครงสร้างดีอาจมีลักษณะดังนี้:

## Architecture Overview

This template deploys a hub-and-spoke network topology for Azure, a standard
pattern for enterprise environments that need centralized security controls
alongside segmented workload networks.

## Hub Network
The hub virtual network (10.0.0.0/16) is the central connection point for all
network traffic. It hosts the Azure Firewall, which inspects and filters all
traffic entering and leaving the environment. It also contains an Azure Bastion
host, which provides secure browser-based access to virtual machines without
exposing RDP or SSH ports to the internet.

## Spoke Network
The spoke virtual network (10.1.0.0/16) is where application workloads run.
It connects to the hub through VNet peering, a low-latency, private connection
within the Azure backbone. Traffic from the spoke to the internet is routed
through the hub firewall, ensuring all outbound connections are inspected.

## Observability
A Log Analytics workspace collects diagnostic logs from the Azure Firewall.
This enables security monitoring, threat detection, and compliance auditing
from a single location.

## Security Controls
- All internet-bound traffic from workloads is inspected by Azure Firewall
- No management ports (SSH, RDP) are exposed directly to the internet
- Network access to VMs is restricted to Azure Bastion sessions only

การสร้างเอกสารอ้างอิงพารามิเตอร์

เทมเพลตที่มีพารามิเตอร์จํานวนมากนั้นใช้งานยากหากไม่มีเอกสารประกอบ ตารางอ้างอิงพารามิเตอร์จะบอกผู้ใช้ว่าแต่ละพารามิเตอร์ทําอะไร ค่าใดถูกต้อง และค่าเริ่มต้นคืออะไร

Generate a markdown parameter reference table for this Bicep template.
Include these columns:
| Parameter | Type | Default | Allowed Values | Description |

Cover all parameters. For parameters with @allowed() decorators,
list the allowed values. For parameters with no default, mark the
Default column as "Required". Write descriptions in plain language,
not a repeat of the parameter name.

Copilot สร้างตารางนี้อย่างถูกต้องเนื่องจากอ่านตัวตกแต่ง @description(), @allowed() และ @minLength() โดยตรงจากเทมเพลต หากเทมเพลตของคุณไม่มีตัวตกแต่ง Copilot จะอนุมานคําอธิบายจากชื่อพารามิเตอร์ ซึ่งเป็นอีกเหตุผลหนึ่งในการใช้ชื่อพารามิเตอร์ที่สื่อความหมายเมื่อสร้างเทมเพลต

การสร้างการอ้างอิงเอาต์พุต

Add a second table below the parameters table documenting all outputs
from this template. Include: Output Name | Type | Description.
Describe what each output contains and when you would use it.

ตัวอย่างนี้มีประโยชน์สําหรับเอาต์พุตโมดูลที่ใช้โดยเทมเพลตอื่น เอกสารประกอบผลลัพธ์จะบอกผู้โทรว่าพวกเขาได้รับอะไรและอยู่ในรูปแบบใด

การสร้างไดอะแกรมสถาปัตยกรรมด้วย Mermaid

Mermaid เป็นภาษาไดอะแกรมแบบข้อความที่รองรับใน GitHub Markdown, Azure DevOps Wiki และ VS Code มันแสดงไดอะแกรมจากข้อความธรรมดา ซึ่งหมายความว่าไดอะแกรมสามารถอยู่ในที่เก็บเดียวกันกับโค้ดโครงสร้างพื้นฐาน โดยกําหนดเวอร์ชันและอัปเดตควบคู่ไปกับเทมเพลต

Represent the network topology deployed by this Bicep template as a Mermaid diagram.
Use flowchart LR (left to right) direction.
Show:
- Each VNet as a subgraph
- Subnets as nodes inside their VNet subgraph
- Resources (Firewall, Bastion, VMs) as nodes in the appropriate subnet
- VNet peering as a double-headed arrow between VNets
- The Log Analytics workspace outside the VNets, with a log collection arrow
  from the Firewall
- Use descriptive labels on each node showing the resource name and type

Wrap the Mermaid code in a markdown code block with the mermaid language tag.

ไดอะแกรมนางเงือกไม่ได้สมบูรณ์แบบพิกเซลเสมอไปในรุ่นแรก ถาม Copilot ปรับเลย์เอาต์ เพิ่มหรือลบส่วนประกอบ หรือเปลี่ยนประเภทไดอะแกรมตามสิ่งที่แสดงผลได้ดีที่สุด

การตรวจสอบไดอะแกรม

ดูตัวอย่างไดอะแกรมใน VS Code โดยใช้ Markdown Preview (Ctrl+Shift+V) หาก GitHub แสดงผล Mermaid ใน README ของที่เก็บของคุณ ให้กดไฟล์และตรวจสอบเอาต์พุตที่แสดงผลที่นั่น ตัวแสดงผลของ GitHub มีพฤติกรรมที่แตกต่างจาก VS Code เล็กน้อย

หากไดอะแกรมซับซ้อนเกินกว่าจะแสดงผลได้อย่างหมดจด ให้ขอให้ Copilot ลดความซับซ้อน:

Simplify this Mermaid diagram to show only the major components and their
connections. Remove subnet-level detail and focus on the resource relationships
at the VNet level.

การสร้างสรุปการเปลี่ยนแปลง

เมื่อโครงสร้างพื้นฐานมีการเปลี่ยนแปลง คําอธิบายคําขอดึงข้อมูล เช่น "เทมเพลต Bicep ที่อัปเดต" ไม่ได้ให้ข้อมูลที่เป็นประโยชน์แก่ผู้ตรวจสอบ Copilot สามารถสร้างสรุปการเปลี่ยนแปลงที่มีความหมายได้โดยการเปรียบเทียบเทมเพลตสองเวอร์ชัน

Compare these two Bicep templates (v1 and v2) and generate a change summary
in markdown format.

For each change, include:
- What changed (resource added, modified, or removed)
- Why it likely changed (e.g., added for security, added for observability,
  fixed a misconfiguration)
- Impact on existing deployments (e.g., requires redeployment, causes downtime,
  is additive only)

Group changes by category: Security, Observability, Networking, Compute, Cost.

--- v1 template ---
[paste old template]

--- v2 template ---
[paste new template]

สรุปการเปลี่ยนแปลงนี้มีประโยชน์ทันทีในฐานะคําอธิบายคําขอดึงข้อมูล การสื่อสารกับผู้มีส่วนได้ส่วนเสีย หรือส่วนในรันบุ๊กการปรับใช้

ตัวอย่างผลลัพธ์สรุปการเปลี่ยนแปลง

## Infrastructure Change Summary — v1 to v2

### Security
- **Added:** AzureFirewallSubnet resized from /27 to /26
  - *Why:* Azure Firewall requires a minimum /26 subnet. The /27 caused deployment failures.
  - *Impact:* Requires redeployment of the hub VNet. Existing peering will need to be re-established.

- **Added:** CostCenter tag on all resources
  - *Why:* Azure Policy requires a CostCenter tag. Missing tag caused policy denial.
  - *Impact:* Additive only. No resource changes.

### Observability
- **Added:** Azure Bastion host in AzureBastionSubnet
  - *Why:* Provides browser-based secure access to VMs without exposing management ports.
  - *Impact:* Additive. New resource. Costs approximately $140/month per Bastion instance.

- **Added:** Log Analytics Workspace and Firewall diagnostic settings
  - *Why:* Required for security monitoring and compliance auditing.
  - *Impact:* Additive. Data ingestion costs depend on log volume.

การซิงค์เอกสาร

ความล้มเหลวของเอกสารที่พบบ่อยที่สุดคือความเก่า เอกสารที่เขียนเมื่อแม่แบบเป็นเวอร์ชัน 1 จะทําให้เข้าใจผิดในเวอร์ชัน 5

แนวทางปฏิบัติหลายอย่างช่วยรักษาความถูกต้องเมื่อเวลาผ่านไป

สร้างเอกสารประกอบเป็นส่วนหนึ่งของกระบวนการประชาสัมพันธ์ เพิ่มขั้นตอนไปยังไปป์ไลน์ CI ของคุณที่ตั้งค่าสถานะ PR สําหรับการตรวจสอบเอกสารเมื่อเทมเพลตมีการเปลี่ยนแปลงอย่างมีนัยสําคัญ

ใช้ @description() นักตกแต่งเป็นแหล่งที่มาของความจริง เอกสารที่ฝังอยู่ในเทมเพลตผ่านตัวตกแต่งจะซิงค์กับโค้ดเสมอเนื่องจากอยู่ในไฟล์เดียวกัน เอกสารมาร์กดาวน์ภายนอกสามารถล่องลอยได้

สร้างเอกสารประกอบสําหรับทุกรุ่นหลัก ใช้พรอมต์สรุปการเปลี่ยนแปลงหลังจากการผสานที่สําคัญทุกครั้งเป็นหลัก ยอมรับเอกสารที่อัปเดตใน PR เดียวกันกับการเปลี่ยนแปลงเทมเพลต

พร้อมท์สําหรับการอัปเดต README:

The following changes were made to our infrastructure template in this release:
[paste change summary]

Update the Infrastructure README to reflect these changes. Specifically:
- Update the Architecture Overview section to mention Azure Bastion
- Add the new CostCenter parameter to the parameter reference table
- Update the "Resources Deployed" list