Project

General

Profile

Azure VPS setup notes » History » Version 57

Jon Goldberg, 11/10/2025 09:18 PM

1 12 Jon Goldberg
{{last_updated_at}} by {{last_updated_by}}
2
3 14 Jon Goldberg
# Microsoft Azure - Setup
4 6 Jon Goldberg
5 14 Jon Goldberg
## For the Client
6 6 Jon Goldberg
7 22 Jon Goldberg
Hi there!  If I've directed you to this page, the part that concerns you are the first three sections only.  It's a bit convoluted, so feel free to ask me if you run into trouble! -Jon
8 14 Jon Goldberg
9 1 Jon Goldberg
[**NOTE**: Most of Microsoft's pages break with an ad blocker enabled.]
10 6 Jon Goldberg
11
### Get a Sponsorship
12
* [Go to the Nonprofit Microsoft Getting Started page](https://nonprofit.microsoft.com/en-us/getting-started).  Fill out the paperwork to be approved as a 501c3.  Approval can take 1 day or 3-4 weeks - I've seen both multiple times.
13
* Once approved, go to https://www.microsoft.com/en-us/nonprofits/azure to claim credits (or go directly to [Claiming Your Credits](https://nonprofit.microsoft.com/en-us/offers/azure).
14 41 Jon Goldberg
* You'll know you're successful because you'll see a sponsorship listed on the [Sponsorship Page](https://www.microsoftazuresponsorships.com/Balance).
15 6 Jon Goldberg
16
### Create a Subscription
17
18 1 Jon Goldberg
* Check that you have credits in your sponsored account: https://www.microsoftazuresponsorships.com/Balance
19
* Visit the [Azure Portal](https://portal.azure.com).  
20
* Click the **Subscriptions** icon.
21
* Click the **Add** button.
22
* Add a subscription of type "Microsoft Azure Sponsorship" from the Azure portal. You will likely need to select **Show other subscription types** to see it.
23
 * **Note**: Even sponsored subscriptions require a credit card, make sure you have one available.
24
25 22 Jon Goldberg
### Grant access to other users
26
Microsoft is now enforcing two-factor authentication, so you need to create a separate user for me as your web vendor.
27 51 Jon Goldberg
28
**October 2025**
29 52 Jon Goldberg
Starting in October, you must do these additional steps. If not, please start at the "Start Here" below.
30 51 Jon Goldberg
* Using the search bar at the top, search for **Microsoft Entra ID**.
31
* Click **Manage**, then **Users** in the left-hand menu.
32
* On the toolbar near the top of the page, select **New User » Invite External User**.
33
* Add my email (jon@megaphonetech.com) and display name.
34
* Click **Review and Invite** at the bottom left of the page.
35
36 22 Jon Goldberg
[Source](https://docs.microsoft.com/en-us/azure/cost-management-billing/manage/add-change-subscription-administrator) for instructions
37 51 Jon Goldberg
[START HERE if it's not October yet]
38 26 Jon Goldberg
* Open the new subscription by clicking on it from the **Subscriptions** page.
39 22 Jon Goldberg
* Click **Access Control (IAM)** in the left navigation bar.
40 43 Jon Goldberg
* At the top, press **Add » Add role assignment**.
41
* On the *Role* tab, go to the **Privileged administrator roles** subtab. 
42
* Click **Owner** and press **Next**.
43 25 Jon Goldberg
* On the *Members* tab, set *Assign Access* to **User, group, or service principal**, and click **Select Members**.
44 50 Jon Goldberg
* In the *Search by name or email address* box, put the email of the new user and press **Select**. Press **Next**.
45
* On the *Conditions* tab, select **Allow user to assign all roles except privileged administrator roles Owner, UAA, RBAC (Recommended)**.
46 40 Jon Goldberg
* Click **Review and Assign**, then click **Review and Assign** again.
47 22 Jon Goldberg
At this point, they'll receive an email to either log in with an existing Microsoft account or to create a new one.
48
49 42 Jon Goldberg
### On Renewals
50 49 Jon Goldberg
You will need to renew every year.  Instructions for this are incomplete - but you should go to your [Azure portal](https://portal.azure.com) and click the **Subscriptions** button (see screenshot 1 below).  Find the subscription ID (screenshot 2) - it's a string of numbers and letters.  Then go to https://www.microsoftazuresponsorships.com/Balance and assign your new credits to the existing subscription.
51 42 Jon Goldberg
52 1 Jon Goldberg
If you did not do this in time, you should be able to open a support ticket with Microsoft to request a refund.
53 49 Jon Goldberg
54
**Screenshot 1**
55
![Azure portal toolbar, "Subscriptions" is circled](Selection_2157.png)
56
**Screenshot 2**
57
![Azure portal Subscriptions screen, a red arrow points to the Subscription ID](Selection_2158.png)
58 42 Jon Goldberg
59 16 Jon Goldberg
## Technical Configuration
60
To set up a free account, you must:
61
* Get a Sponsorship (see above)
62
* Create a Subscription linked to the Sponsorship (see above)
63
* (Strongly recommended) Grant access to the subscription to other users.
64
* Create a Resource Group linked to the Subscription
65
* Create a Virtual Machine (and associated resources) linked to the Resource Group
66 14 Jon Goldberg
67
### Create a resource group
68 47 Jon Goldberg
* Select "Resource Groups" from the main Azure portal (left sidebar).
69 28 Jon Goldberg
* Select **Create** and give it a name.
70 1 Jon Goldberg
* Your subscription should be pre-selected since you only have the one.
71 23 Jon Goldberg
* Click **Review and Create**, then **Create**.
72 6 Jon Goldberg
73 1 Jon Goldberg
### Create a virtual machine
74 14 Jon Goldberg
* Click on your new resource group in the Azure Portal.
75 30 Jon Goldberg
* Click **Create**.
76 53 Jon Goldberg
* Search for the name of the image you want (e.g. `Debian 13 "Trixie`).
77
 * If you picked an image that shows an hourly cost, it's the wrong one.
78
* See the screenshots below for configuration of the "Basics" and "Disk" tabs.  The other tabs I keep with the defaults.  My standard VPS type is now `D2ps_v6`.
79
 * "D2" is general-purpose VM, we always select this.  "a" is AMD-series (old preference), "p" is ARM64, "d" is temp disk included (we don't need this), "s" supports premium SSD disks. v6 is the latest gen, always use the latest gen.
80 9 Jon Goldberg
81 54 Jon Goldberg
![Create a VM - Basics Tab](Selection_2678.png)
82 9 Jon Goldberg
83 54 Jon Goldberg
![Create a VM - Disks Tab](Selection_2679.png)
84 6 Jon Goldberg
85 14 Jon Goldberg
### Post-provisioning configuration
86 10 Jon Goldberg
87 37 Jon Goldberg
#### Get serial console working
88 1 Jon Goldberg
Serial console is necessary for single-user mode, and troubleshooting if SSH fails.
89 57 Jon Goldberg
90
It's normally working out of the box now.  Go to "Serial Console" in the VM left navigation.  If it doesn't work:
91
92 1 Jon Goldberg
* Go to **Boot Diagnostics** in the VM's left nav.
93
* Click **Settings** at the top.
94 44 Jon Goldberg
* Select **Enable with managed storage account**.
95
* Save.
96 1 Jon Goldberg
97 37 Jon Goldberg
Now Serial Console will work.
98
99 8 Jon Goldberg
#### Modify Firewall Rules
100
* Click on your new virtual machine in the Azure portal.
101 14 Jon Goldberg
* Click **Networking** in the side navigation.
102 6 Jon Goldberg
* You should see your firewall settings.  They should look like the screenshot below, except they'll be missing the two items circled.
103
* Add the "allow_ping" and "Port_5665" rules to the *Inbound Port Rules* as shown in the screenshot.
104
105
![Firewall Rules](https://hq.megaphonetech.com/attachments/download/1772/Selection_999(012).png)
106
107
#### Add a swapfile
108
[Complete instructions are here](https://support.microsoft.com/en-us/help/4010058/how-to-add-a-swap-file-in-linux-azure-virtual-machines) but in short, add this to `/etc/waagent.conf` for an 8GB swapfile:
109
110
```
111 27 Jon Goldberg
    ResourceDisk.Format=y
112
    ResourceDisk.EnableSwap=y
113
    ResourceDisk.SwapSizeMB=8192
114
```
115 1 Jon Goldberg
116
Then run `service walinuxagent restart`.
117
118
## Post-deployment management
119
### Adding a new disk
120
Add a disk by going to the virtual machine and clicking "Disk", not by "Add Resource".  Then used the `parted` and `mkfs` commands from above.  Don't forget to modify `/etc/fstab`!