Skip to content

Commit 1abf0fc

Browse files
committed
inital edits and new screenshots
1 parent 3ddf750 commit 1abf0fc

File tree

3 files changed

+24
-17
lines changed

3 files changed

+24
-17
lines changed
57.6 KB
Loading
62.4 KB
Loading

articles/spring-apps/tutorial-managed-identities-functions.md

Lines changed: 24 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ ms.date: 07/10/2020
1818

1919
This article shows you how to create a managed identity for an Azure Spring Apps app and use it to invoke HTTP triggered Functions.
2020

21-
Both Azure Functions and App Services have built in support for Azure Active Directory (Azure AD) authentication. By using this built-in authentication capability along with Managed Identities for Azure Spring Apps, we can invoke RESTful services using modern OAuth semantics. This method doesn't require storing secrets in code and provides more granular controls for controlling access to external resources.
21+
Both Azure Functions and App Services have built in support for Azure Active Directory (Azure AD) authentication. By using this built-in authentication capability along with Managed Identities for Azure Spring Apps, you can invoke RESTful services using modern OAuth semantics. This method doesn't require storing secrets in code and provides more granular controls for controlling access to external resources.
2222

2323
## Prerequisites
2424

@@ -29,53 +29,60 @@ Both Azure Functions and App Services have built in support for Azure Active Dir
2929

3030
## Create a resource group
3131

32-
A resource group is a logical container into which Azure resources are deployed and managed. Create a resource group to contain both the Function app and Spring Cloud using the command [az group create](/cli/azure/group#az-group-create):
32+
A resource group is a logical container into which Azure resources are deployed and managed. Use the following command to create a resource group to contain a Function app. For more information, see [az group create](/cli/azure/group#az-group-create):
3333

3434
```azurecli
35-
az group create --name myResourceGroup --location eastus
35+
az group create --name <resource-group-name> --location <location>
3636
```
3737

3838
## Create a Function App
3939

4040
To create a Function app you must first create a backing storage account, use the command [az storage account create](/cli/azure/storage/account#az-storage-account-create):
4141

4242
> [!IMPORTANT]
43-
> Each Function app and Storage Account must have a unique name. Replace *\<your-functionapp-name>* with the name of your Function app and *\<your-storageaccount-name>* with the name of your Storage Account in the following examples.
43+
> Each Function app and Storage Account must have a unique name. In the following command, replace *\<function-app-name>* with the name of your Function app and *\<storage-account-name>* with the name of your Storage Account.
4444
4545
```azurecli
4646
az storage account create \
47-
--resource-group myResourceGroup \
48-
--name <your-storageaccount-name> \
49-
--location eastus \
47+
--resource-group <resource-group-name> \
48+
--name <storage-account-name> \
49+
--location <location> \
5050
--sku Standard_LRS
5151
```
5252

53-
After the Storage Account is created, you can create the Function app.
53+
After the Storage Account is created, use the following command to create the Function app.
5454

5555
```azurecli
5656
az functionapp create \
57-
--resource-group myResourceGroup \
58-
--name <your-functionapp-name> \
59-
--consumption-plan-location eastus \
57+
--resource-group <resource-group-name> \
58+
--name <function-app-name> \
59+
--consumption-plan-location <location> \
6060
--os-type windows \
6161
--runtime node \
62-
--storage-account <your-storageaccount-name> \
62+
--storage-account <storage-account-name> \
6363
--functions-version 3
6464
```
6565

6666
Make a note of the returned `hostNames` value, which is in the format *https://\<your-functionapp-name>.azurewebsites.net*. You use this value in a following step.
6767

6868
## Enable Azure Active Directory Authentication
6969

70-
Access the newly created Function app from the [Azure portal](https://portal.azure.com) and select **Authentication / Authorization** from the settings menu. Enable App Service Authentication and set the **Action to take when request is not authenticated** to **Log in with Azure Active Directory**. This setting ensures that all unauthenticated requests are denied (401 response).
70+
Use the following steps to enable Azure Active Directory authentication to access your Function app.
71+
72+
1. In the Azure portal, navigate to your resource group and open the Function app you created.
73+
1. In the navigation pane, select **Authentication** and then select **Add identity provider** on the main pane.
74+
1. On the **Add an identity provider** page, select **Microsoft** from the **Identity provider** dropdown menu.
75+
76+
:::image type="content" source="media/spring-cloud-tutorial-managed-identities-functions/add-identity-provider.png" alt-text="Screenshot of the Azure portal showing the Add an identity provider page with Microsoft highlighted in the identity provider dropdown menu." lightbox="media/spring-cloud-tutorial-managed-identities-functions/add-identity-provider.png":::
7177

72-
:::image type="content" source="media/spring-cloud-tutorial-managed-identities-functions/function-auth-config-1.jpg" alt-text="Screenshot of the Azure portal showing Authentication / Authorization page with Azure Active Directory set as the default provider." lightbox="media/spring-cloud-tutorial-managed-identities-functions/function-auth-config-1.jpg":::
78+
1. On the **Basics** settings for the **Add an identity provider** page, set **Supported account type** to **Any Azure AD directory - Multi-tenant**.
79+
1. Set **Unauthorized requests** to **HTTP 401 Unauthorized: recommended for APIs**. This setting ensures that all unauthenticated requests are denied (401 response).
7380

74-
Under **Authentication Providers**, select **Azure Active Directory** to configure the application registration. Selecting **Express Management Mode** automatically creates an application registration in your Azure AD tenant with the correct configuration.
81+
:::image type="content" source="media/spring-cloud-tutorial-managed-identities-functions/identity-provider-settings.png" alt-text="Screenshot of the Azure portal showing the settings page for adding an identity provider with the Any Azure AD directory Multi tenant option highlighted for the account type setting, and also showing the HTTP 401 Unauthorized recommended for APIs option highlighted for the Unauthenticated requests setting." lightbox="media/spring-cloud-tutorial-managed-identities-functions/identity-provider-settings.png":::
7582

76-
:::image type="content" source="media/spring-cloud-tutorial-managed-identities-functions/function-auth-config-2.jpg" alt-text="Screenshot of the Azure portal showing the Azure Active Directory provider set to Express Management Mode." lightbox="media/spring-cloud-tutorial-managed-identities-functions/function-auth-config-2.jpg":::
83+
1. Select **Add**.
7784

78-
After you save the settings, the function app restarts and all subsequent requests are prompted to log in via Azure AD. You can test that unauthenticated requests are now being rejected by navigating to the function apps root URL (returned in the `hostNames` output in a previous step). You should be redirected to your organizations Azure AD login screen.
85+
After you add the settings, the Function app restarts and all subsequent requests are prompted to sign in through Azure AD. You can test that unauthenticated requests are currently being rejected by navigating to the Function app's root URL (returned in the `hostNames` output in a previous step). You should be redirected to your organization's Azure Active Directory sign-in screen.
7986

8087
## Create an HTTP Triggered Function
8188

0 commit comments

Comments
 (0)