<?xml version="1.0"?>
<feed xmlns="http://www.w3.org/2005/Atom" xml:lang="en">
	<id>https://mindattic.com/wiki/docs/index.php?action=history&amp;feed=atom&amp;title=Unity.Multiplayer%2Farticles%2Fhosting%2Fazure-vm</id>
	<title>Unity.Multiplayer/articles/hosting/azure-vm - Revision history</title>
	<link rel="self" type="application/atom+xml" href="https://mindattic.com/wiki/docs/index.php?action=history&amp;feed=atom&amp;title=Unity.Multiplayer%2Farticles%2Fhosting%2Fazure-vm"/>
	<link rel="alternate" type="text/html" href="https://mindattic.com/wiki/docs/index.php?title=Unity.Multiplayer/articles/hosting/azure-vm&amp;action=history"/>
	<updated>2026-12-05T17:16:33Z</updated>
	<subtitle>Revision history for this page on the wiki</subtitle>
	<generator>MediaWiki 1.46.3</generator>
	<entry>
		<id>https://mindattic.com/wiki/docs/index.php?title=Unity.Multiplayer/articles/hosting/azure-vm&amp;diff=914&amp;oldid=prev</id>
		<title>Docs Sync: md2wiki: sync from MindAttic.Docs</title>
		<link rel="alternate" type="text/html" href="https://mindattic.com/wiki/docs/index.php?title=Unity.Multiplayer/articles/hosting/azure-vm&amp;diff=914&amp;oldid=prev"/>
		<updated>2026-11-29T20:36:44Z</updated>

		<summary type="html">&lt;p&gt;md2wiki: sync from MindAttic.Docs&lt;/p&gt;
&lt;p&gt;&lt;b&gt;New page&lt;/b&gt;&lt;/p&gt;&lt;div&gt;= Hosting on an Azure VM (AzureVm) =&lt;br /&gt;
&lt;br /&gt;
A big-cloud profile (UM-T27): &amp;lt;code&amp;gt;mp-host&amp;lt;/code&amp;gt; creates the four ARM resources a Linux VM needs -- a network security group (NSG), a static public IP, a network interface (NIC) wiring them to an existing VNet subnet, and the VM itself -- running the same Docker image + rendezvous side-car compose stack as GenericVps, booted by a cloud-init document passed as &amp;lt;code&amp;gt;customData&amp;lt;/code&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
== What &amp;lt;code&amp;gt;mp-host deploy&amp;lt;/code&amp;gt; does here ==&lt;br /&gt;
&lt;br /&gt;
# Builds (or reads an already-built) &amp;lt;strong&amp;gt;GenericVps-profile&amp;lt;/strong&amp;gt; server package and image, pushes it to GHCR.&lt;br /&gt;
# Creates an empty NSG, a static public IP (Azure assigns this address immediately -- before the VM that will use it even exists, unlike AWS/GCE where the IP only appears once the instance is running) and a NIC linking the IP, the NSG and your existing VNet subnet.&lt;br /&gt;
# Renders the compose file + bootstrap script into a &amp;lt;code&amp;gt;#cloud-config&amp;lt;/code&amp;gt; document and creates the VM (&amp;lt;code&amp;gt;virtualMachines&amp;lt;/code&amp;gt; PUT) attached to that NIC, with your chosen size and an SSH public key for login (password authentication is disabled).&lt;br /&gt;
# Authorizes NSG rules for SSH (22/tcp), the rendezvous port (8080/tcp) and your declared game port.&lt;br /&gt;
# Polls the public IP (already known from step 2) over SSH for &amp;lt;code&amp;gt;GET http&amp;amp;#58;//127.0.0.1:&amp;amp;lt;healthPort&amp;gt;/healthz&amp;lt;/code&amp;gt;, exactly like GenericVps.&lt;br /&gt;
# Watches &amp;lt;code&amp;gt;docker compose logs game&amp;lt;/code&amp;gt; over SSH for the join-code line and prints it.&lt;br /&gt;
&lt;br /&gt;
== Before you deploy ==&lt;br /&gt;
&lt;br /&gt;
You need an Azure subscription, a resource group, and &amp;lt;strong&amp;gt;an existing VNet + subnet&amp;lt;/strong&amp;gt; -- mp-host creates the NSG/IP/NIC/VM but deliberately does not create a VNet, since most teams already have one per environment and a profile silently creating network topology alongside a server deploy is more surprising than helpful. You also need a service principal (an Entra ID app registration with Contributor on the resource group) for mp-host&amp;#039;s client-credentials login, and an SSH key pair locally:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre class=&amp;quot;md-code&amp;quot;&amp;gt;az ad sp create-for-rbac --name mp-host --role Contributor --scopes /subscriptions/&amp;amp;lt;sub&amp;gt;/resourceGroups/&amp;amp;lt;rg&amp;gt;&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre class=&amp;quot;md-code&amp;quot;&amp;gt;mp-host credentials set-azure --tenant &amp;amp;lt;tenant-id&amp;gt; --client-id &amp;amp;lt;app-id&amp;gt; --client-secret &amp;amp;lt;password&amp;gt; --subscription &amp;amp;lt;sub-id&amp;gt;&lt;br /&gt;
mp-host credentials set-ghcr --username &amp;amp;lt;github-username&amp;gt; --token &amp;amp;lt;PAT with write:packages&amp;gt;&lt;br /&gt;
mp-host credentials set-cloud-options --profile AzureVm --name prod-azure \&lt;br /&gt;
  --opt resourceGroup=mp-host-rg \&lt;br /&gt;
  --opt subnetId=/subscriptions/&amp;amp;lt;sub&amp;gt;/resourceGroups/mp-host-rg/providers/Microsoft.Network/virtualNetworks/vnet/subnets/default \&lt;br /&gt;
  --opt sshUser=azureuser --opt sshKeyPath=C:\Users\me\.ssh\id_ed25519 \&lt;br /&gt;
  --opt sshPublicKeyPath=C:\Users\me\.ssh\id_ed25519.pub&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;vmSize&amp;lt;/code&amp;gt; (default &amp;lt;code&amp;gt;Standard_B1s&amp;lt;/code&amp;gt;) and &amp;lt;code&amp;gt;location&amp;lt;/code&amp;gt; (default &amp;lt;code&amp;gt;eastus&amp;lt;/code&amp;gt;, or pass &amp;lt;code&amp;gt;--region&amp;lt;/code&amp;gt; on deploy) are optional overrides -- see &amp;lt;code&amp;gt;AzureVmProvisioner&amp;lt;/code&amp;gt;&amp;#039;s class doc for the full list.&lt;br /&gt;
&lt;br /&gt;
Then deploy:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre class=&amp;quot;md-code&amp;quot;&amp;gt;mp-host deploy --profile AzureVm --name prod-azure --package ./build/GenericVps \&lt;br /&gt;
  --image myorg/mygame --tag v1 --region eastus --size Standard_B1s \&lt;br /&gt;
  --rendezvous-url https&amp;amp;#58;//rendezvous.example.com \&lt;br /&gt;
  --public-address prod-azure&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Add &amp;lt;code&amp;gt;--dry-run&amp;lt;/code&amp;gt; first to see every ARM call (NSG, public IP, NIC, VM PUTs) mp-host would make, without creating anything.&lt;br /&gt;
&lt;br /&gt;
== Open ports ==&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
! Port&lt;br /&gt;
! Protocol&lt;br /&gt;
! Purpose&lt;br /&gt;
|-&lt;br /&gt;
| your game port&lt;br /&gt;
| UDP (or TCP for WebSocket)&lt;br /&gt;
| Players connect here.&lt;br /&gt;
|-&lt;br /&gt;
| 8080&lt;br /&gt;
| TCP&lt;br /&gt;
| The rendezvous service.&lt;br /&gt;
|-&lt;br /&gt;
| 22&lt;br /&gt;
| TCP&lt;br /&gt;
| SSH -- the only way mp-host reaches the box after boot.&lt;br /&gt;
|-&lt;br /&gt;
| health port&lt;br /&gt;
| TCP, bound to 127.0.0.1&lt;br /&gt;
| Not reachable from the internet by design.&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
== Updating and tearing down ==&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;mp-host update&amp;lt;/code&amp;gt; restarts the compose stack in place over SSH, same as the other UM-T27 VM profiles. &amp;lt;code&amp;gt;mp-host destroy ... --yes&amp;lt;/code&amp;gt; stops the compose stack, then deletes the VM, its NIC, and finally its public IP and NSG, in that order -- ARM resources reference each other (the NIC references the IP and NSG; the VM references the NIC), so deleting out of order fails. mp-host warns rather than fails if the IP/NSG delete needs a moment for the NIC deletion to finish propagating -- delete them yourself afterwards if they&amp;#039;re still there and nothing else uses them.&lt;br /&gt;
&lt;br /&gt;
== Cost and data-transfer notes ==&lt;br /&gt;
&lt;br /&gt;
Azure bills outbound data transfer separately from VM compute time, with the rate depending on region and monthly volume -- check the [https://azure.microsoft.com/en-us/pricing/details/bandwidth/ Azure bandwidth pricing page] for your region&amp;#039;s current tier (a commonly-cited starting rate is roughly $0.087/GB for the first 10 TB/ month as of this writing). Using the same rule-of-thumb send rate as the other UM-T27 guides (roughly 20 KB/s per player -- replace with your own game&amp;#039;s actual figure), a player-hour is about 0.07 GB, which works out to on the order of &amp;lt;strong&amp;gt;$0.006 per player-hour&amp;lt;/strong&amp;gt; in data transfer at that rate, on top of the VM&amp;#039;s own hourly cost (&amp;lt;code&amp;gt;Standard_B1s&amp;lt;/code&amp;gt; is a reasonable default for a small lobby). &amp;lt;code&amp;gt;mp-host destroy&amp;lt;/code&amp;gt; after each test run is the cheapest way to avoid paying for an idle VM, its public IP (Azure bills a reserved static IP even while the VM is stopped) and NIC between events.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;div class=&amp;quot;md2wiki-crumb&amp;quot;&amp;gt;Part of [[Unity.Multiplayer]].&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;div class=&amp;quot;md2wiki-source&amp;quot;&amp;gt;From [https://github.com/mindattic/Unity.Multiplayer/blob/main/docs/articles/hosting/azure-vm.md Unity.Multiplayer/docs/articles/hosting/azure-vm.md] via MindAttic.Docs; synced automatically, so edit the repo, not this page.&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
[[Category:Unity.Multiplayer]]&lt;/div&gt;</summary>
		<author><name>Docs Sync</name></author>
	</entry>
</feed>