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
Copy file name to clipboardExpand all lines: articles/app-service/includes/tutorial-connect-app-access-microsoft-graph-as-user/intro.md
+3-3Lines changed: 3 additions & 3 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -35,7 +35,7 @@ In this tutorial, you learn how to:
35
35
36
36
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.)
37
37
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**.
39
39
40
40
1. Select **App registrations** > **Owned applications** > **View all applications in this directory**. Select your web app name, and then select **API permissions**.
41
41
@@ -51,11 +51,11 @@ The web app now has the required permissions to access Microsoft Graph as the si
51
51
> 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.
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`.
55
55
56
56
The Azure Resource Explorer is now opened with your web app selected in the resource tree.
57
57
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.
59
59
60
60
1. In the left browser, drill down to **config** > **authsettingsV2**.
Copy file name to clipboardExpand all lines: articles/app-service/includes/tutorial-dotnet-storage-managed-identity/introduction.md
+7-8Lines changed: 7 additions & 8 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -14,15 +14,15 @@ ms.custom:
14
14
---
15
15
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.
16
16
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:
18
18
19
19
* Azure Storage
20
20
* Azure SQL Database
21
21
* Azure Key Vault
22
22
23
23
:::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":::
24
24
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).
26
26
27
27
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.
28
28
@@ -64,7 +64,7 @@ Blobs in Azure Storage are organized into containers. Before you can upload a bl
64
64
65
65
To create a general-purpose v2 storage account in the Azure portal, follow these steps.
66
66
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**.
68
68
69
69
1. In the **Storage Accounts** window that appears, select **Create**.
70
70
@@ -76,15 +76,14 @@ To create a general-purpose v2 storage account in the Azure portal, follow these
76
76
77
77
1. Select a location (region) for your storage account, or use the default value.
78
78
79
+
1. Under **Preferred storage type** field, select **Azure Blob Storage or Azure Data Lake Storage Gen2**.
80
+
79
81
1. Leave these fields set to their default values:
1. Select **Review + Create** to review your storage account settings and create the account.
90
89
@@ -96,7 +95,7 @@ To create a Blob Storage container in Azure Storage, follow these steps.
96
95
97
96
1. In the left menu for the storage account, scroll to the **Data storage** section, and then select **Containers**.
98
97
99
-
1. Select the **+ Container** button.
98
+
1. Select the **+ Add Container** button.
100
99
101
100
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.
Copy file name to clipboardExpand all lines: articles/app-service/includes/tutorial-microsoft-graph-as-app/introduction.md
+2-2Lines changed: 2 additions & 2 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -13,7 +13,7 @@ Learn how to access Microsoft Graph from a web app running on Azure App Service.
13
13
14
14
:::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":::
15
15
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.
17
17
18
18
In this tutorial, you learn how to:
19
19
@@ -115,6 +115,6 @@ When accessing the Microsoft Graph, the managed identity needs to have proper pe
115
115
116
116
:::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":::
117
117
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.
119
119
120
120
:::image type="content" alt-text="Screenshot that shows the Permissions pane." source="../../media/scenario-secure-app-access-microsoft-graph/enterprise-apps-permissions.png":::
#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
21
21
22
22
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.
23
23
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
+
25
26
*[Sample on GitHub](https://github.com/Azure-Samples/ms-identity-easyauth-dotnet-storage-graphapi/tree/main/2-WebApp-graphapi-on-behalf).
26
27
27
28
> [!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.
Open the project/solution in Visual Studio, and open the console by using the **Tools** > **NuGet Package Manager** > **Package Manager Console** command.
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).
62
64
63
65
```csharp
64
66
usingMicrosoft.AspNetCore.Builder;
@@ -102,7 +104,7 @@ public class Startup
102
104
103
105
### appsettings.json
104
106
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.
106
108
107
109
*Graph* specifies the Microsoft Graph endpoint and the initial scopes needed by the app.
108
110
@@ -197,5 +199,4 @@ public class IndexModel : PageModel
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.
23
22
24
23
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
0 commit comments