Skip to content

Commit b26fdaf

Browse files
authored
Update SWA deployment instructions (#4859)
Signed-off-by: Marc Duiker <[email protected]>
1 parent fd0c2e9 commit b26fdaf

File tree

2 files changed

+33
-26
lines changed

2 files changed

+33
-26
lines changed

.github/iac/swa/readme.md

Lines changed: 16 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -14,23 +14,27 @@ This folder contains a template and infrastructure as code to recreate and recon
1414

1515
1) Export any environment variables you want to override with your values using `./infra/main.parameters.json` as a reference for the variable names. e.g.
1616

17-
In a new terminal:
18-
1917
Bash/sh/zsh:
18+
2019
```bash
21-
export AZURE_RESOURCE_GROUP=rg-dapr-docs-test
22-
export IDENTITY_RESOURCE_GROUP=rg-my-identities
23-
export AZURE_STATICWEBSITE_NAME=daprdocs-latest
20+
export AZURE_RESOURCE_GROUP=docs-website
21+
export IDENTITY_RESOURCE_GROUP=dapr-identities
22+
export AZURE_STATICWEBSITE_NAME=daprdocs-v1-1
2423
```
2524

25+
Where `daprdocs-v1-1` should be updated with the new preview version.
26+
2627
PowerShell
28+
2729
```PowerShell
28-
setx AZURE_RESOURCE_GROUP "rg-dapr-docs-test"
29-
setx IDENTITY_RESOURCE_GROUP "rg-my-identities"
30-
setx AZURE_STATICWEBSITE_NAME "daprdocs-latest"
30+
setx AZURE_RESOURCE_GROUP "docs-website"
31+
setx IDENTITY_RESOURCE_GROUP "dapr-identities"
32+
setx AZURE_STATICWEBSITE_NAME "daprdocs-v1-1"
3133
```
3234

33-
This assumes you have an existing [user-assigned managed identity](https://learn.microsoft.com/entra/identity/managed-identities-azure-resources/how-manage-user-assigned-managed-identities?pivots=identity-mi-methods-azp) (see L39 in `./infra/main.bicep` to use or modify name) in a resource group that you can reference as the runtime identity of this static web app. We recommend storing this in a different resource group from your application, to keep the permissions and lifecycles separate of your identity and your web app. We also recommend narrowly limiting who has access to view, contribute or own this identity, and also only apply it to single resource scopes, not to entire resource groups or subscriptions, to avoid elevation of priviledges.
35+
Where `daprdocs-v1-1` should be updated with the new preview version.
36+
37+
This assumes you have an existing [user-assigned managed identity](https://learn.microsoft.com/entra/identity/managed-identities-azure-resources/how-manage-user-assigned-managed-identities?pivots=identity-mi-methods-azp) (see L39 in `./infra/main.bicep` to use or modify name) in a resource group that you can reference as the runtime identity of this static web app. We recommend storing this in a different resource group from your application, to keep the permissions and lifecycles separate of your identity and your web app. We also recommend narrowly limiting who has access to view, contribute or own this identity, and also only apply it to single resource scopes, not to entire resource groups or subscriptions, to avoid elevation of priviledges.
3438

3539
2) Deploy using the Azure Dev CLI
3640

@@ -40,15 +44,15 @@ Start by creating a create a side-by-side azd environment:
4044
azd env new
4145
```
4246

43-
For example, you can name the new environment something like: `dapr-docs-v1-15`.
47+
For example, you can name the new environment something like: `dapr-docs-v1-1`.
4448

4549
Now, deploy the Dapr docs SWA in the new azd environment using the following command:
4650

4751
```bash
4852
azd up
4953
```
5054

51-
You will be prompted for the subscription and location (region) to use. The Resource Group and Static Web App will now be created and usable. Typical deployment times are only 20-60 seconds.
55+
You will be prompted for the subscription and location (region) to use. The Resource Group and Static Web App will now be created and usable. Typical deployment times are only 20-60 seconds.
5256

5357
## Configure the Static Web App in portal.azure.com
5458

@@ -58,4 +62,4 @@ You will be prompted for the subscription and location (region) to use. The Res
5862

5963
## Configure your CI/CD pipeline
6064

61-
You will need a rotatable token or ideally a managed identity (coming soon) for your pipeline to have Web publishing access grants to the Static Web App. Get the token from the Overview blade -> Manage Access Token command of the SWA, and store it in the vault/secret for the repo matching your Github Action (or other CI/CD pipeline)'s workflow file. One example for the current/main release of Dapr docs is [here](https://github.com/dapr/docs/blob/v1.13/.github/workflows/website-root.yml#L57). This is an elevated operation that likely needs an admin or maintainer to perform.
65+
You will need a rotatable token or ideally a managed identity (coming soon) for your pipeline to have Web publishing access grants to the Static Web App. Get the token from the Overview blade -> Manage Access Token command of the SWA, and store it in the vault/secret for the repo matching your Github Action (or other CI/CD pipeline)'s workflow file. One example for the current/main release of Dapr docs is [here](https://github.com/dapr/docs/blob/v1.13/.github/workflows/website-root.yml#L57). This is an elevated operation that likely needs an admin or maintainer to perform.

daprdocs/content/en/contributing/docs-contrib/maintainer-guide.md

Lines changed: 17 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -296,6 +296,7 @@ Next, create a new website for the future Dapr release. To do this, you'll need
296296
- Configure DNS via request from CNCF.
297297

298298
#### Prerequisites
299+
299300
- Docs maintainer status in the `dapr/docs` repo.
300301
- Access to the active Dapr Azure Subscription with Contributor or Owner access to create resources.
301302
- [Azure Developer CLI](https://learn.microsoft.com/azure/developer/azure-developer-cli/install-azd?tabpane=winget-windows%2Cbrew-mac%2Cscript-linux&pivots=os-windows) installed on your machine.
@@ -310,7 +311,7 @@ Deploy a new Azure Static Web App for the future Dapr release. For this example,
310311
```bash
311312
cd .github/iac/swa
312313
```
313-
314+
314315
1. Log into Azure Developer CLI (`azd`) using the Dapr Azure subscription.
315316

316317
```bash
@@ -319,47 +320,49 @@ Deploy a new Azure Static Web App for the future Dapr release. For this example,
319320

320321
1. In the browser prompt, verify you're logging in as Dapr and complete the login.
321322

322-
1. In a new terminal, replace the following values with the website values you prefer.
323+
1. In the same terminal, set these environment variables:
323324

324325
```bash
325-
export AZURE_RESOURCE_GROUP=rg-dapr-docs-test
326-
export IDENTITY_RESOURCE_GROUP=rg-my-identities
327-
export AZURE_STATICWEBSITE_NAME=daprdocs-latest
326+
export AZURE_RESOURCE_GROUP=docs-website
327+
export IDENTITY_RESOURCE_GROUP=dapr-identities
328+
export AZURE_STATICWEBSITE_NAME==daprdocs-v1-1
328329
```
329-
330+
331+
Where `daprdocs-v1-1` should be updated with the new preview version.
332+
330333
1. Create a new [`azd` environment](https://learn.microsoft.com/azure/developer/azure-developer-cli/faq#what-is-an-environment-name).
331-
334+
332335
```bash
333336
azd env new
334337
```
335338

336-
1. When prompted, enter a new environment name. For this example, you'd name the environment something like: `dapr-docs-v1-1`.
339+
1. When prompted, enter a new environment name. For this example, you'd name the environment something like: `dapr-docs-v1-1`.
337340

338341
1. Once the environment is created, deploy the Dapr docs SWA into the new environment using the following command:
339342

340343
```bash
341344
azd up
342345
```
343-
344-
1. When prompted, select an Azure subscription and location. Match these to the Dapr Azure subscription.
346+
347+
1. When prompted, select an Azure subscription (Dapr Tests) and deployment location (West US 2).
345348

346349
#### Configure the SWA in the Azure portal
347350

348-
Head over to the Dapr subscription in the [Azure portal](https://portal.azure.com) and verify that your new Dapr docs site has been deployed.
351+
Head over to the Dapr subscription in the [Azure portal](https://portal.azure.com) and verify that your new Dapr docs site has been deployed.
349352

350353
Optionally, grant the correct minimal permissions for inbound publishing and outbound access to dependencies using the **Static Web App** > **Access control (IAM)** blade in the portal.
351354

352355
#### Configure DNS
353356

354-
1. In the Azure portal, from the new SWA you just created, naviage to **Custom domains** from the left side menu.
357+
1. In the Azure portal, from the new SWA you just created, naviage to **Custom domains** from the left side menu.
355358
1. Copy the "CNAME" value of the web app.
356-
1. Using your own account, [submit a CNCF ticket](https://jira.linuxfoundation.org/secure/Dashboard.jspa) to create a new domain name mapped to the CNAME value you copied. For this example, to create a new domain for Dapr v1.1, you'd request to map to `v1-1.docs.dapr.io`.
359+
1. Using your own account, [submit a CNCF ticket](https://jira.linuxfoundation.org/secure/Dashboard.jspa) to create a new domain name mapped to the CNAME value you copied. For this example, to create a new domain for Dapr v1.1, you'd request to map to `v1-1.docs.dapr.io`.
357360

358361
Request resolution may take some time.
359362

360363
1. Once the new domain has been confirmed, return to the static web app in the portal.
361364
1. Navigate to the **Custom domains** blade and select **+ Add**.
362-
1. Select **Custom domain on other DNS**.
365+
1. Select **Custom domain on other DNS**.
363366
1. Enter `v1-1.docs.dapr.io` under **Domain name**. Click **Next**.
364367
1. Keep **Hostname record type** as `CNAME`, and copy the value of **Value**.
365368
1. Click **Add**.

0 commit comments

Comments
 (0)