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
Admin tools for [Azure Url Shortener](https://github.com/FBoucher/AzUrlShortener) using Blazor Single Page Application (webassembly).
6
+
Admin tools for [Azure Url Shortener](https://github.com/FBoucher/AzUrlShortener) using [Blazor Single Page Application (webassembly)](https://azure.microsoft.com/en-ca/services/app-service/static/?WT.mc_id=tinyblazoradmin-github-frbouche).
Copy file name to clipboardExpand all lines: deployment.md
+20-2Lines changed: 20 additions & 2 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -20,7 +20,7 @@ This project is a frontend only so you will need to deploy the [Azure Url Shorte
20
20
21
21
## Deploy TinyBlazorAdmin (the Frontend)
22
22
23
-
There are many ways you could run Tiny Blazor Admin website. In this deployment, we will use the new [Azure Static Web App (SWA)](https://azure.microsoft.com/en-ca/services/app-service/static/). However, because the TinyBlazorAdmin use Azure Active Directory (AAD), we need a standalone Azure Function (deployed at the previous step).
23
+
There are many ways you could run Tiny Blazor Admin website. In this deployment, we will use the new [Azure Static Web App (SWA)](https://azure.microsoft.com/en-ca/services/app-service/static/?WT.mc_id=tinyblazoradmin-github-frbouche). However, because the TinyBlazorAdmin use Azure Active Directory (AAD), we need a standalone Azure Function (deployed at the previous step).
24
24
25
25
Open Azure portal (portal.azure.com), open the **resource group** where you created the backend (ex: streamDemo is our case). Click the "**+**" and search **Static Web App**, and click the *Create* button.
26
26
@@ -106,8 +106,24 @@ Now in your GitHub it's time to update the settings. THe code need to know the A
106
106
}
107
107
```
108
108
109
+
## Enabeling Cross-Origin Resource Sharing (CORS)
109
110
111
+
We need to let AzUrlShortener been called by TinyBlazorAdmin. They are running in different website, therefore we need to configure Cross-Origin Resource Sharing (CORS).
110
112
113
+
First we need the url of the caller (aka TinyBlazorAdmin). From the Azure Portal, open the TinyBlazorAdmin SWA blade. Note the URL display in the top right of the page this is the URL of your admin page.
114
+
115
+
![swa_URL][swa_URL]
116
+
117
+
Now we need to add this URL to the list in the CORS of the Azure Function that run AzUrlShortener. From the Azure portal open the blade of AzUrlShortener. From the left menu search CORS, and click it. Add the URL of the SWA and don't forget to save.
118
+
119
+
120
+
![azFunction_CORS][azFunction_CORS]
121
+
122
+
## Try it!
123
+
124
+
Voila, the deployment is now completed. You can test it by creating a new short URL using the admin SWA.
125
+
126
+
> To add a custom domain to your AzUrlShortener, [follow these steps](https://github.com/FBoucher/AzUrlShortener/blob/main/post-deployment-configuration.md#add-a-custom-domain)
111
127
112
128
113
129
[CreateBackend]: medias/CreateBackend.png
@@ -121,4 +137,6 @@ Now in your GitHub it's time to update the settings. THe code need to know the A
0 commit comments