Skip to content

Commit 348ad5e

Browse files
authored
Merge pull request #313079 from lootle1/FR39
Freshness Edit: App Service 1 of 3
2 parents cd7b753 + aac3c9b commit 348ad5e

9 files changed

Lines changed: 64 additions & 63 deletions

File tree

articles/app-service/includes/tutorial-connect-app-access-microsoft-graph-as-user/intro.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,7 @@ In this tutorial, you learn how to:
3535

3636
Now that you've enabled authentication and authorization on your web app, the web app is registered with the Microsoft identity platform and is backed by a Microsoft Entra application. In this step, you give the web app permissions to access Microsoft Graph for the user. (Technically, you give the web app's Microsoft Entra application the permissions to access the Microsoft Graph Microsoft Entra application for the user.)
3737

38-
1. In the [Microsoft Entra admin center](https://entra.microsoft.com), select **Applications**.
38+
1. In the [Microsoft Entra admin center](https://entra.microsoft.com), select **Entra ID**.
3939

4040
1. Select **App registrations** > **Owned applications** > **View all applications in this directory**. Select your web app name, and then select **API permissions**.
4141

@@ -51,11 +51,11 @@ The web app now has the required permissions to access Microsoft Graph as the si
5151
> If you don't configure App Service to return a usable access token, you receive a ```CompactToken parsing failed with error code: 80049217``` error when you call Microsoft Graph APIs in your code.
5252
5353
# [Azure Resource Explorer](#tab/azure-resource-explorer)
54-
Go to [Azure Resource Explorer](https://resources.azure.com/) and using the resource tree, locate your web app. The resource URL should be similar to `https://resources.azure.com/subscriptions/subscriptionId/resourceGroups/SecureWebApp/providers/Microsoft.Web/sites/SecureWebApp20200915115914`.
54+
Go to [Azure Resource Explorer](https://rc.portal.azure.com/#view/Microsoft_Azure_Resources/ResourceExplorer.ReactView) and using the resource tree, locate your web app. The resource URL should be similar to `https://management.azure.com/subscriptions/subscriptionId/resourceGroups/SecureWebApp/providers/Microsoft.Web/sites/SecureWebApp20200915115914`.
5555

5656
The Azure Resource Explorer is now opened with your web app selected in the resource tree.
5757

58-
1. At the top of the page, select **Read/Write** to enable editing of your Azure resources.
58+
1. At the top of the page, select **Edit** to enable editing of your Azure resources.
5959

6060
1. In the left browser, drill down to **config** > **authsettingsV2**.
6161

articles/app-service/includes/tutorial-dotnet-storage-managed-identity/introduction.md

Lines changed: 7 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -14,15 +14,15 @@ ms.custom:
1414
---
1515
Learn how to access Azure services, _such as Azure Storage_, from a web app (not a signed-in user) running on Azure App Service by using managed identities. This tutorial demonstrates connecting to Azure Storage as an example.
1616

17-
[Any service](../../../active-directory/managed-identities-azure-resources/managed-identities-status.md) that supports managed identity (_B_ in the following image) can be securely accessed using this tutorial:
17+
[Any service](/entra/identity/managed-identities-azure-resources/managed-identities-status) that supports managed identity (_B_ in the following image) can be securely accessed using this tutorial:
1818

1919
* Azure Storage
2020
* Azure SQL Database
2121
* Azure Key Vault
2222

2323
:::image type="content" alt-text="Diagram that shows how to access storage." source="../../media/scenario-secure-app-access-storage/web-app-access-storage.svg" border="false":::
2424

25-
You want to add secure access to Azure services (Azure Storage, Azure SQL Database, Azure Key Vault, or other services) from your web app. You could use a shared key, but then you have to worry about operational security of who can create, deploy, and manage the secret. It's also possible that the key could be checked into GitHub, which hackers know how to scan for. A safer way to give your web app access to data is to use [managed identities](../../../active-directory/managed-identities-azure-resources/overview.md).
25+
You want to add secure access to Azure services (Azure Storage, Azure SQL Database, Azure Key Vault, or other services) from your web app. You could use a shared key, but then you have to worry about operational security of who can create, deploy, and manage the secret. It's also possible that the key could be checked into GitHub, which hackers know how to scan for. A safer way to give your web app access to data is to use [managed identities](/entra/identity/managed-identities-azure-resources/overview).
2626

2727
A managed identity from Microsoft Entra ID allows App Service to access resources through role-based access control (RBAC), without requiring app credentials. After assigning a managed identity to your web app, Azure takes care of the creation and distribution of a certificate. People don't have to worry about managing secrets or app credentials.
2828

@@ -64,7 +64,7 @@ Blobs in Azure Storage are organized into containers. Before you can upload a bl
6464

6565
To create a general-purpose v2 storage account in the Azure portal, follow these steps.
6666

67-
1. On the Azure portal menu, select **All services**. In the list of resources, enter **Storage Accounts**. As you begin typing, the list filters based on your input. Select **Storage Accounts**.
67+
1. On the Azure portal menu, enter **Storage Accounts**. As you begin typing, the list filters based on your input. Select **Storage Accounts**.
6868

6969
1. In the **Storage Accounts** window that appears, select **Create**.
7070

@@ -76,15 +76,14 @@ To create a general-purpose v2 storage account in the Azure portal, follow these
7676

7777
1. Select a location (region) for your storage account, or use the default value.
7878

79+
1. Under **Preferred storage type** field, select **Azure Blob Storage or Azure Data Lake Storage Gen2**.
80+
7981
1. Leave these fields set to their default values:
8082

8183
|Field|Value|
8284
|--|--|
83-
|Deployment model|Resource Manager|
8485
|Performance|Standard|
85-
|Account kind|StorageV2 (general-purpose v2)|
86-
|Replication|Read-access geo-redundant storage (RA-GRS)|
87-
|Access tier|Hot|
86+
|Redundancy|Geo-redundant storage|
8887

8988
1. Select **Review + Create** to review your storage account settings and create the account.
9089

@@ -96,7 +95,7 @@ To create a Blob Storage container in Azure Storage, follow these steps.
9695

9796
1. In the left menu for the storage account, scroll to the **Data storage** section, and then select **Containers**.
9897

99-
1. Select the **+ Container** button.
98+
1. Select the **+ Add Container** button.
10099

101100
1. Type a name for your new container. The container name must be lowercase, must start with a letter or number, and can include only letters, numbers, and the dash (-) character.
102101

articles/app-service/includes/tutorial-microsoft-graph-as-app/introduction.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ Learn how to access Microsoft Graph from a web app running on Azure App Service.
1313

1414
:::image type="content" alt-text="Diagram that shows accessing Microsoft Graph." source="../../media/scenario-secure-app-access-microsoft-graph/web-app-access-graph.svg" border="false":::
1515

16-
You want to call Microsoft Graph for the web app. A safe way to give your web app access to data is to use a [system-assigned managed identity](../../../active-directory/managed-identities-azure-resources/overview.md). A managed identity from Microsoft Entra ID allows App Service to access resources through role-based access control (RBAC), without requiring app credentials. After assigning a managed identity to your web app, Azure takes care of the creation and distribution of a certificate. You don't have to worry about managing secrets or app credentials.
16+
You want to call Microsoft Graph for the web app. A safe way to give your web app access to data is to use a [system-assigned managed identity](/entra/identity/managed-identities-azure-resources/overview). A managed identity from Microsoft Entra ID allows App Service to access resources through role-based access control (RBAC), without requiring app credentials. After assigning a managed identity to your web app, Azure takes care of the creation and distribution of a certificate. You don't have to worry about managing secrets or app credentials.
1717

1818
In this tutorial, you learn how to:
1919

@@ -115,6 +115,6 @@ When accessing the Microsoft Graph, the managed identity needs to have proper pe
115115
116116
:::image type="content" alt-text="Screenshot that shows the All applications option." source="../../media/scenario-secure-app-access-microsoft-graph/enterprise-apps-all-applications.png":::
117117
118-
1. In **Overview**, select **Permissions**, and you'll see the added permissions for Microsoft Graph.
118+
1. In **Security**, select **Permissions**, and you'll see the added permissions for Microsoft Graph.
119119
120120
:::image type="content" alt-text="Screenshot that shows the Permissions pane." source="../../media/scenario-secure-app-access-microsoft-graph/enterprise-apps-permissions.png":::
-17.3 KB
Loading
-23.3 KB
Loading

articles/app-service/scenario-secure-app-access-microsoft-graph-as-app.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ author: cephalin
55
ms.author: cephalin
66
ms.service: azure-app-service
77
ms.topic: tutorial
8-
ms.date: 04/05/2023
8+
ms.date: 03/13/2026
99
ms.devlang: csharp
1010
ms.custom: azureday1, devx-track-dotnet, AppServiceIdentity
1111
#Customer intent: As an application developer, I want to learn how to access data in Microsoft Graph by using managed identities.

articles/app-service/scenario-secure-app-access-microsoft-graph-as-user.md

Lines changed: 9 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ author: cephalin
55
ms.author: cephalin
66
ms.service: azure-app-service
77
ms.topic: tutorial
8-
ms.date: 09/15/2023
8+
ms.date: 03/17/2026
99
ms.devlang: csharp
1010
ms.custom: azureday1, devx-track-dotnet, AppServiceIdentity
1111
#Customer intent: As an application developer, I want to learn how to access data in Microsoft Graph for a signed-in user.
@@ -21,13 +21,14 @@ Your web app now has the required permissions and also adds Microsoft Graph's cl
2121

2222
Using the [Microsoft.Identity.Web library](https://github.com/AzureAD/microsoft-identity-web/), the web app gets an access token for authentication with Microsoft Graph. In version 1.2.0 and later, the Microsoft.Identity.Web library integrates with and can run alongside the App Service authentication/authorization module. Microsoft.Identity.Web detects that the web app is hosted in App Service and automatically retrieves the access token from the `X-MS-TOKEN-AAD-ACCESS-TOKEN` request header that App Service injects (see [Retrieve tokens in app code](configure-authentication-oauth-tokens.md#retrieve-tokens-in-app-code)). You don't need to manually access this header in your code. The access token is then passed along to authenticated requests with the Microsoft Graph API.
2323

24-
To see this code as part of a sample application, see the:
24+
To see this code as part of a sample application, see the:
25+
2526
* [Sample on GitHub](https://github.com/Azure-Samples/ms-identity-easyauth-dotnet-storage-graphapi/tree/main/2-WebApp-graphapi-on-behalf).
2627

2728
> [!NOTE]
28-
> The Microsoft.Identity.Web library isn't required in your web app for basic authentication/authorization or to authenticate requests with Microsoft Graph. It's possible to [securely call downstream APIs](tutorial-auth-aad.md#call-api-securely-from-server-code) with only the App Service authentication/authorization module enabled.
29-
>
30-
> However, the App Service authentication/authorization is designed for more basic authentication scenarios. For more complex scenarios (handling custom claims, for example), you need the Microsoft.Identity.Web library or [Microsoft Authentication Library](../active-directory/develop/msal-overview.md). There's a little more setup and configuration work in the beginning, but the Microsoft.Identity.Web library can run alongside the App Service authentication/authorization module. Later, when your web app needs to handle more complex scenarios, you can disable the App Service authentication/authorization module and Microsoft.Identity.Web will already be a part of your app.
29+
> The Microsoft.Identity.Web library isn't required in your web app for basic authentication/authorization or to authenticate requests with Microsoft Graph. It's possible to [securely call downstream APIs](tutorial-auth-aad.md) with only the App Service authentication/authorization module enabled.
30+
>
31+
> However, the App Service authentication/authorization is designed for more basic authentication scenarios. For more complex scenarios (handling custom claims, for example), you need the Microsoft.Identity.Web library or [Microsoft Authentication Library](/entra/identity-platform/msal-overview). There's a little more setup and configuration work in the beginning, but the Microsoft.Identity.Web library can run alongside the App Service authentication/authorization module. Later, when your web app needs to handle more complex scenarios, you can disable the App Service authentication/authorization module, and Microsoft.Identity.Web will already be a part of your app.
3132
3233
### Install client library packages
3334

@@ -50,6 +51,7 @@ dotnet add package Microsoft.Identity.Web
5051
Open the project/solution in Visual Studio, and open the console by using the **Tools** > **NuGet Package Manager** > **Package Manager Console** command.
5152

5253
Run the install commands.
54+
5355
```powershell
5456
Install-Package Microsoft.Identity.Web.GraphServiceClient
5557
@@ -58,7 +60,7 @@ Install-Package Microsoft.Identity.Web
5860

5961
### Startup.cs
6062

61-
In the *Startup.cs* file, the ```AddMicrosoftIdentityWebApp``` method adds Microsoft.Identity.Web to your web app. The ```AddMicrosoftGraph``` method adds Microsoft Graph support. For info on managing incremental consent and conditional access, [read this](https://github.com/AzureAD/microsoft-identity-web/wiki/Managing-incremental-consent-and-conditional-access).
63+
In the *Startup.cs* file, the ```AddMicrosoftIdentityWebApp``` method adds Microsoft.Identity.Web to your web app. The ```AddMicrosoftGraph``` method adds Microsoft Graph support. For info on managing incremental consent and conditional access, [read this article](https://github.com/AzureAD/microsoft-identity-web/wiki/Managing-incremental-consent-and-conditional-access).
6264

6365
```csharp
6466
using Microsoft.AspNetCore.Builder;
@@ -102,7 +104,7 @@ public class Startup
102104

103105
### appsettings.json
104106

105-
*AzureAd* specifies the configuration for the Microsoft.Identity.Web library. In the [Microsoft Entra admin center](https://entra.microsoft.com), select **Applications** from the portal menu and then select **App registrations**. Select the app registration created when you enabled the App Service authentication/authorization module. (The app registration should have the same name as your web app.) You can find the tenant ID and client ID in the app registration overview page. The domain name can be found in the Microsoft Entra overview page for your tenant.
107+
*AzureAd* specifies the configuration for the Microsoft.Identity.Web library. In the [Microsoft Entra admin center](https://entra.microsoft.com), select **Entra ID** from the portal menu and then select **App registrations**. Select the app registration created when you enabled the App Service authentication/authorization module. (The app registration should have the same name as your web app.) You can find the tenant ID and client ID in the app registration overview page. The domain name can be found in the Microsoft Entra overview page for your tenant.
106108

107109
*Graph* specifies the Microsoft Graph endpoint and the initial scopes needed by the app.
108110

@@ -197,5 +199,4 @@ public class IndexModel : PageModel
197199
}
198200
```
199201

200-
201202
[!INCLUDE [second-part](./includes/tutorial-connect-app-access-microsoft-graph-as-user/end.md)]

articles/app-service/scenario-secure-app-access-storage.md

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ author: cephalin
55
ms.author: cephalin
66
ms.service: azure-app-service
77
ms.topic: tutorial
8-
ms.date: 07/31/2023
8+
ms.date: 03/17/2026
99
ms.devlang: csharp
1010
# ms.devlang: csharp, azurecli
1111
ms.custom: azureday1, devx-track-azurecli, devx-track-azurepowershell, subject-rbac-steps, devx-track-dotnet, AppServiceIdentity
@@ -18,7 +18,6 @@ ms.custom: azureday1, devx-track-azurecli, devx-track-azurepowershell, subject-r
1818

1919
## Access Blob Storage
2020

21-
2221
The [DefaultAzureCredential](/dotnet/api/azure.identity.defaultazurecredential) class is used to get a token credential for your code to authorize requests to Azure Storage. Create an instance of the [DefaultAzureCredential](/dotnet/api/azure.identity.defaultazurecredential) class, which uses the managed identity to fetch tokens and attach them to the service client. The following code example gets the authenticated token credential and uses it to create a service client object, which uploads a new blob.
2322

2423
To see this code as part of a sample application, see the [sample on GitHub](https://github.com/Azure-Samples/ms-identity-easyauth-dotnet-storage-graphapi/tree/main/1-WebApp-storage-managed-identity).
@@ -76,7 +75,7 @@ static public async Task UploadBlob(string accountName, string containerName, st
7675
7776
try
7877
{
79-
// Create the container if it does not exist.
78+
// Create the container if it doesn't exist.
8079
await containerClient.CreateIfNotExistsAsync();
8180
8281
// Upload text to a new block blob.

0 commit comments

Comments
 (0)