Skip to content

Commit dd39fd5

Browse files
author
Kalyan Krishna
committed
Minor last minute edits
1 parent 68caf90 commit dd39fd5

File tree

2 files changed

+13
-41
lines changed

2 files changed

+13
-41
lines changed

4-WebApp-your-API/4-1-MyOrg/AppCreationScripts-withCert/Configure.ps1

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-

1+
22
[CmdletBinding()]
33
param(
44
[Parameter(Mandatory=$False, HelpMessage='Tenant ID (This is a GUID which represents the "Directory ID" of the AzureAD tenant into which you want to create the apps')]

4-WebApp-your-API/4-1-MyOrg/README.md

Lines changed: 12 additions & 40 deletions
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,6 @@ description: This sample demonstrates an ASP.NET Core Web App signing-in a user
1818

1919
* [Overview](#overview)
2020
* [Scenario](#scenario)
21-
* [Contents](#contents)
2221
* [Prerequisites](#prerequisites)
2322
* [Setup the sample](#setup-the-sample)
2423
* [Explore the sample](#explore-the-sample)
@@ -193,7 +192,9 @@ Open the project in your IDE (like Visual Studio or Visual Studio Code) to confi
193192
1. Select one of the available key durations (**6 months**, **12 months** or **Custom**) as per your security posture.
194193
1. The generated key value will be displayed when you select the **Add** button. Copy and save the generated value for use in later steps.
195194
1. You'll need this key later in your code's configuration files. This key value will not be displayed again, and is not retrievable by any other means, so make sure to note it from the Azure portal before navigating to any other screen or blade.
196-
> :bulb: For enhanced security, instead of using client secrets, consider [using certificates](https://github.com/AzureAD/microsoft-authentication-library-for-js/blob/dev/lib/msal-node/docs/certificate-credentials.md) and [Azure KeyVault](https://github.com/AzureAD/microsoft-authentication-library-for-js/blob/dev/lib/msal-node/docs/key-vault-managed-identity.md).1. Since this app signs-in users, we will now proceed to select **delegated permissions**, which is is required by apps signing-in users.
195+
> :bulb: For enhanced security, instead of using client secrets, consider [using certificates](./README-use-certificate.md) and [Azure KeyVault](https://azure.microsoft.com/services/key-vault/#product-overview).
196+
197+
1. Since this app signs-in users, we will now proceed to select **delegated permissions**, which is is required by apps signing-in users.
197198
1. In the app's registration screen, select the **API permissions** blade in the left to open the page where we add access to the APIs that your application needs:
198199
1. Select the **Add a permission** button and then,
199200
1. Ensure that the **My APIs** tab is selected.
@@ -379,7 +380,6 @@ services.AddMicrosoftIdentityWebAppAuthentication(Configuration)
379380

380381
</details>
381382

382-
383383
## How the code was created
384384

385385
<details>
@@ -499,10 +499,8 @@ services.AddMicrosoftIdentityWebAppAuthentication(Configuration)
499499
```
500500

501501
</details>
502-
## How to deploy this sample to Azure
502+
## How to deploy this sample to Azure
503503

504-
<details>
505-
<summary>Expand the section</summary>
506504
### Deploying web API to Azure App Services
507505

508506
There is one web API in this sample. To deploy it to **Azure App Services**, you'll need to:
@@ -514,28 +512,17 @@ There is one web API in this sample. To deploy it to **Azure App Services**, you
514512

515513
##### Publish using Visual Studio
516514

517-
Follow the link to [Publish with Visual Studio](https://docs.microsoft.com/visualstudio/deployment/quickstart-deploy-to-azure?view=vs-2019).
515+
Follow the link to [Publish with Visual Studio](https://docs.microsoft.com/visualstudio/deployment/quickstart-deploy-to-azure).
518516
519517
##### Publish using Visual Studio Code
520518

521-
1. Install the VS Code extension [Azure App Service](https://marketplace.visualstudio.com/items?itemName=ms-azuretools.vscode-azureappservice).
522-
1. Sign-in to App Service using Azure AD Account.
523-
1. Open the TodoListService-aspnetcore-webapi project folder.
524-
1. Choose View > Terminal from the main menu.
525-
1. The terminal opens in the TodoListService-aspnetcore-webapi folder.
526-
1. Run the following command:
527-
528-
```console
529-
dotnet publish --configuration Release
530-
```
531-
532-
1. Publish folder is created under path `bin/Release/<Enter_Framework_FolderName>`.
533-
1. Right Click on **Publish** folder and select **Deploy to Web App**.
534-
1. Select **Create New Web App**, enter unique name for the app.
535-
1. Select **Windows** as the *OS*. Press **Enter**.
519+
1. Install the Visual Studio Code extension [Azure App Service](https://marketplace.visualstudio.com/items?itemName=ms-azuretools.vscode-azureappservice).
520+
1. Follow the link to [Publish with Visual Studio Code](https://docs.microsoft.com/aspnet/core/tutorials/publish-to-azure-webapp-using-vscode)
536521
537522
#### Enable cross-origin resource sharing (CORS) (TodoListService-aspnetcore-webapi)
538523

524+
> :warning: the following steps are required only if you want your web API to be consumed by a single-page application (SPA). Learn more on [cross-origin resource sharing](https://developer.mozilla.org/docs/Web/HTTP/CORS).
525+
539526
1. Go to [Azure portal](https://portal.azure.com), and locate your project there.
540527
- On the API tab, select **CORS**. Check the box **Enable Access-Control-Allow-Credentials**.
541528
- Under **Allowed origins**, add the site URL of your published website **that will call this web API**.
@@ -552,26 +539,12 @@ There is one web app in this sample. To deploy it to **Azure App Services**, you
552539

553540
##### Publish using Visual Studio
554541

555-
Follow the link to [Publish with Visual Studio](https://docs.microsoft.com/visualstudio/deployment/quickstart-deploy-to-azure?view=vs-2019).
542+
Follow the link to [Publish with Visual Studio](https://docs.microsoft.com/visualstudio/deployment/quickstart-deploy-to-azure).
556543
557544
##### Publish using Visual Studio Code
558545

559-
1. Install the VS Code extension [Azure App Service](https://marketplace.visualstudio.com/items?itemName=ms-azuretools.vscode-azureappservice).
560-
1. Sign-in to App Service using Azure AD Account.
561-
1. Open the TodoListClient-aspnetcore-webapi project folder.
562-
1. Choose **View** > **Terminal** from the main menu.
563-
1. The terminal opens in the TodoListClient-aspnetcore-webapi folder.
564-
1. Run the following command:
565-
566-
```console
567-
dotnet publish --configuration Release
568-
```
569-
570-
1. Publish folder is created under path `bin/Release/<Enter_Framework_FolderName>`.
571-
1. Right Click on **Publish** folder and select **Deploy to Web App**.
572-
1. Select **Create New Web App**, enter a unique name for the app.
573-
1. Select **Windows** as the *OS*. Press **Enter**.
574-
1. Browse your website. If you see the default web page of the project, then the publication was successful.
546+
1. Install the Visual Studio Code extension [Azure App Service](https://marketplace.visualstudio.com/items?itemName=ms-azuretools.vscode-azureappservice).
547+
1. Follow the link to [Publish with Visual Studio Code](https://docs.microsoft.com/aspnet/core/tutorials/publish-to-azure-webapp-using-vscode)
575548
576549
#### Update the Azure AD app registration (TodoListClient-aspnetcore-webapi)
577550

@@ -591,7 +564,6 @@ In the left-hand navigation pane, select the **Azure Active Directory** service,
591564
592565
> :warning: If your app is using an *in-memory* storage, **Azure App Services** will spin down your web site if it is inactive, and any records that your app was keeping will emptied. In addition, if you increase the instance count of your website, requests will be distributed among the instances. Your app's records, therefore, will not be the same on each instance.
593566

594-
</details>
595567
## Next Steps
596568

597569
Learn how to:

0 commit comments

Comments
 (0)