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 3, 2024. It is now read-only.
@@ -487,6 +483,55 @@ You can use [React Router](https://reactrouter.com/) component in conjunction wi
487
483
};
488
484
```
489
485
486
+
## How to deploy this sample to Azure
487
+
488
+
<details>
489
+
<summary>Expand the section</summary>
490
+
491
+
### Deploying SPA to Azure Storage
492
+
493
+
There is one single-page application in this sample. To deploy it to **Azure Storage**, you'll need to:
494
+
495
+
* create an Azure Storage blob and obtain website coordinates
496
+
* build your project and upload it to Azure Storage blob
497
+
* update config files with website coordinates
498
+
499
+
> :information_source: If you would like to use **VS Code Azure Tools** extension for deployment, [watch the tutorial](https://docs.microsoft.com/azure/developer/javascript/tutorial-vscode-static-website-node-01) offered by Microsoft Docs.
500
+
501
+
#### Build and upload (ms-identity-react-c2s1) to an Azure Storage blob
502
+
503
+
Build your project to get a distributable files folder, where your built `html`, `css` and `javascript` files will be generated. Then follow the steps below:
504
+
505
+
> :warning: When uploading, make sure you upload the contents of your distributable files folder and **not** the entire folder itself.
506
+
507
+
> :information_source: If you don't have an account already, see: [How to create a storage account](https://docs.microsoft.com/azure/storage/common/storage-account-create).
508
+
509
+
1. Sign in to the [Azure portal](https://portal.azure.com).
510
+
1. Locate your storage account and display the account overview.
511
+
1. Select **Static website** to display the configuration page for static websites.
512
+
1. Select **Enabled** to enable static website hosting for the storage account.
513
+
1. In the **Index document name** field, specify a default index page (For example: `index.html`).
514
+
1. The default **index page** is displayed when a user navigates to the root of your static website.
515
+
1. Select **Save**. The Azure portal now displays your static website endpoint. Make a note of the **Primary endpoint field**.
516
+
1. In the `ms-identity-react-c2s1` project source code, update your configuration file with the **Primary endpoint field** as your new **Redirect URI** (you will register this URI later).
517
+
1. Next, select **Storage Explorer**.
518
+
1. Expand the **BLOB CONTAINERS** node, and then select the `$web` container.
519
+
1. Choose the **Upload** button to upload files.
520
+
1. If you intend for the browser to display the contents of file, make sure that the content type of that file is set to `text/html`.
521
+
1. In the pane that appears beside the **account overview page** of your storage account, select **Static Website**. The URL of your site appears in the **Primary endpoint field**. In the next section, you will register this URI.
522
+
523
+
#### Update the Azure AD app registration for ms-identity-react-c2s1
524
+
525
+
1. Navigate back to to the [Azure portal](https://portal.azure.com).
526
+
1. In the left-hand navigation pane, select the **Azure Active Directory** service, and then select **App registrations**.
527
+
1. In the resulting screen, select `ms-identity-react-c2s1`.
528
+
1. In the app's registration screen, select **Authentication** in the menu.
529
+
* In the **Redirect URIs** section, update the reply URLs to match the site URL of your Azure deployment. For example:
The Microsoft Authentication Library (MSAL) apps generate log messages to help diagnose issues. An app can configure logging with a few lines of code and have custom control over the level of detail and whether or not personal and organizational data is logged. Please check the [authConfig.js](./SPA/src//authConfig.js) file to see an example of configuring the logger with MSAL.js. For more information about using the logger with MSAL.js, see the following [Logging in MSAL.js](https://docs.microsoft.com/azure/active-directory/develop/msal-logging-js).
0 commit comments