Create Free Linux In Azure

申请免费的微软云服务器

B2ATS
2 P6 (64GiB) managed disks
$100 额度。1年有效期,到期再申请
参考

1. Github 认证学生信息,使用 Github 账户登录 Microsoft Azure

2. 开始

进入 Microsoft Azure 主页面,点击 “Create a resource” ,点击 “Virtual machine” 下面的 “create” 即可进入创建页面,也就是 Create a virtual machine 这个页面,开始进行配置

Region: (Asia Pacific) Southeast Asia
Availability options: No infrastructure redundancy required
Security type: Standard
Image: Ubuntu Server 24.04 LTS - x64 Gen2
Size: Standard_B2ats_v2 - 2 vcpus, 1 GiB memory ($8.61/month) 
Authentication type: SSH public key
Public inbound ports: Allow selected ports
Select inbound ports: SSH (22)

点击 “Next: Disks >” ,继续配置

OS disk size: 64 GiB (P6)

点击 “Next: Networking >” ,继续配置

这里本应该使用动态 IP 地址,以减少开销。但是 20250331 之后无法使用了,只能使用静态 IPv4 地址,可能会导致额外的开销。
[[参考]](https://azure.microsoft.com/en-us/updates?id=upgrade-to-standard-sku-public-ip-addresses-in-azure-by-30-september-2025-basic-sku-will-be-retired)
[[价格$0.005/hour]](https://azure.microsoft.com/en-us/pricing/details/ip-addresses/)

点击 “Monitoring” ,继续配置

Boot diagnostics: Disable

点击 “Review and create” 即可创建成功。之后会自动下载 SSH 密钥文件。虚拟机创建成功。使用 SSH 密钥文件远程连接服务器。

3. 问题

截止到目前20250415,我创建的服务器,不知道哪里出问题了,$100 额度被用完!也就半个月的时间!我把这个服务器已经从面板中删除了,无法看到详细的成本。我的公共 IP 地址应该是 SKU Basic ,我使用 SSH 远程连接服务器。

[官方账单文档] [额度查看] [计费FAQ]

Service Name    Service Resource    Spend
Azure Bastion	Standard Gateway	$98.02
Virtual Network	Standard IPv4 Static Public IP	$1.7
Azure Firewall	Standard Deployment	$0.83
Azure Bastion	Basic Data Transfer Out	$0.08
Log Analytics	Pay-as-you-go Data Ingestion	$0.06
Network Watcher	Standard Diagnostic Tool API	$0.01

我问了 GPT ,它回答

Azure Bastion是一种安全连接到虚拟机的服务,无需公共IP地址。它的计费主要基于两个因素:
    部署时间(按小时计费)
    使用的网关类型(Standard比Basic贵)
你使用的是Standard Gateway,这是较高级的选项,价格自然也更高。
可能的问题:
    你可能在不使用时没有关闭Azure Bastion服务
    你选择了较贵的Standard版本而非Basic版本
    你可能不了解Bastion的计费方式,误以为它只在连接时才收费
建议解决方案:
    立即删除或停止当前的Azure Bastion服务
    今后只在需要连接到VM时才部署Bastion
    考虑使用Basic级别而非Standard级别
    设置开支警报,避免意外消费
    使用Azure Cost Management工具监控你的消费情况
对于学生账户,我建议使用更经济的连接方式,比如通过SSH客户端连接,或者使用Azure的免费服务等级。