You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
This repository was archived by the owner on May 20, 2025. It is now read-only.
Copy file name to clipboardExpand all lines: docs/providers/pulumi/azure.mdx
+63Lines changed: 63 additions & 0 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -137,6 +137,18 @@ apis:
137
137
# provide domains to be used for the api
138
138
description: An Azure API
139
139
140
+
# Add CDN configuration, required for custom domains for website deployments
141
+
# Available since v1.19.4
142
+
cdn:
143
+
# The name of the Azure DNS Zone to use when configuring the website DNS
144
+
zone-name: example.com
145
+
# The resource group name of the DNS Zone you configured in Azure DNS Zones
146
+
zone-resource-group: yourzone-rg
147
+
# A valid domain or subdomain for the DNS Zone to use for the deployed websites endpoint
148
+
domain-name: app.example.com
149
+
# Skip CDN cache invalidation during deployments (defaults to false)
150
+
skip-cache-invalidation: true
151
+
140
152
# Configure your deployed services
141
153
config:
142
154
# How services without a type will be deployed
@@ -164,6 +176,57 @@ config:
164
176
max-replicas: 100
165
177
```
166
178
179
+
### Websites
180
+
181
+
When deploying [websites](/websites), Nitric will create a Front Door Endpoint that automatically provides a public URL for your website. This URL is not suitable for production use, and you should configure a custom domain for your website.
182
+
183
+
The DNS Zone used to configure the custom domain must be created in Azure DNS Zones before deploying with your custom domain configuration.
184
+
185
+
- Purchase/Register a domain name with your domain registrar of choice.
186
+
- Navigate to https://portal.azure.com/#browse/Microsoft.Network%2FdnsZones in your Azure Portal
187
+
- Click `Create`
188
+
- Select your subscription and resource group (or create a new one)
189
+
- Enter a `Name` of your choice, this should be the domain name you purchased i.e. example.com
190
+
- Click `Review + Create`
191
+
- Click `Create`
192
+
- Once the DNS Zone is created, click on the `Go to resource` button
193
+
194
+
Now that the DNS Zone is created, you need to configure your registrar (domain) or existing DNS (subdomain) to point at the new name servers created for the zone.
195
+
196
+
The configuration details are available on the `Essentials tab` within the `DNS Zone` page. This step is different depending on your chosen domain registrar. Below are some general steps depending on whether your configuring the primary domain or a subdomain.
197
+
198
+
#### Domain
199
+
200
+
Your registrar (e.g. Namecheap, GoDaddy, Cloudflare, etc.) will allow you to change the name servers for you domain, sometimes this is called 'Custom DNS'. Add each of the name servers (NS records) from the Registrar setup dialog in the relevant config page for your registrar.
201
+
202
+
#### Subdomain
203
+
204
+
If you're configuring a subdomain e.g. app.yourdomain.com, you can simply add the NS records to your existing DNS configuration for the chosen subdomain. Typically, the config will look something like this:
205
+
206
+
<Note>Substitute your values for `Host` and `Nameserver`</Note>
207
+
208
+
| Record Type | Host | Nameserver |
209
+
| ----------- | ---- | --------------------- |
210
+
| NS Record | app | ns1-06.azure-dns.com |
211
+
| NS Record | app | ns2-06.azure-dns.net |
212
+
| NS Record | app | ns3-06.azure-dns.org |
213
+
| NS Record | app | ns4-06.azure-dns.info |
214
+
215
+
### Stack file configuration
216
+
217
+
Now that you have your DNS Zone created and Nameservers configured you can add the relevant config to your GCP stack file.
218
+
219
+
```yaml title:nitric.[stack ID].yaml
220
+
# Add to your stack file
221
+
cdn:
222
+
# The name of the Azure DNS Zone to use when configuring the website DNS
223
+
zone-name: example.com
224
+
# The resource group name of the DNS Zone you configured in Azure DNS Zones
225
+
zone-resource-group: yourzone-rg
226
+
# A valid domain or subdomain for the DNS Zone to use for the deployed websites endpoint
227
+
domain-name: app.example.com
228
+
```
229
+
167
230
<Note>
168
231
Missing something? Let us know by raising an issue in
169
232
[GitHub](https://github.com/nitrictech/nitric) or by dropping us a line on
0 commit comments