Skip to content

Commit 22ed1f6

Browse files
authored
Merge pull request #112789 from damabe/1697055-damabe12
Update for Azure Functions portal UX refresh: User Story 1697055, Part 12
2 parents 75724f9 + 31e93b3 commit 22ed1f6

14 files changed

+102
-56
lines changed

articles/azure-functions/functions-hybrid-powershell.md

Lines changed: 102 additions & 56 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ description: Learn how to configure Hybrid Connections in Azure Relay to connect
44
author: eamono
55

66
ms.topic: conceptual
7-
ms.date: 9/5/2019
7+
ms.date: 04/26/2020
88
ms.author: eamono
99
# Customer intent: As solution architect, I want to be able to connect my function app in Azure to on-premises resources so I can remotely manage those resources by using PowerShell functions.
1010
---
@@ -47,94 +47,135 @@ cmd.exe /C $Cmd
4747

4848
The App Service Hybrid Connections feature is available only in Basic, Standard, and Isolated pricing plans. When you create the function app with PowerShell, create or select one of these plans.
4949

50-
1. In the [Azure portal](https://portal.azure.com), select **+ Create a resource** in the menu on the left, and then select **Function app**.
50+
1. From the Azure portal menu or the **Home** page, select **Create a resource**.
5151

52-
1. For **Hosting plan**, select **App Service plan**, and then select **App Service plan/Location**.
52+
1. In the **New** page, select **Compute** > **Function App**.
5353

54-
1. Select **Create new**, type an **App Service plan** name, choose a **Location** in a [region](https://azure.microsoft.com/regions/) near you or near other services your functions access, and then select **Pricing tier**.
54+
1. On the **Basics** page, use the function app settings as specified in the following table.
5555

56-
1. Choose the S1 Standard plan, and then select **Apply**.
56+
| Setting | Suggested value | Description |
57+
| ------------ | ---------------- | ----------- |
58+
| **Subscription** | Your subscription | The subscription under which this new function app is created. |
59+
| **[Resource Group](../azure-resource-manager/management/overview.md)** | *myResourceGroup* | Name for the new resource group in which to create your function app. |
60+
| **Function App name** | Globally unique name | Name that identifies your new function app. Valid characters are `a-z` (case insensitive), `0-9`, and `-`. |
61+
|**Publish**| Code | Option to publish code files or a Docker container. |
62+
| **Runtime stack** | Preferred language | Choose PowerShell Core. |
63+
|**Version**| Version number | Choose the version of your installed runtime. |
64+
|**Region**| Preferred region | Choose a [region](https://azure.microsoft.com/regions/) near you or near other services your functions access. |
5765

58-
1. Select **OK** to create the plan, and then configure the remaining **Function App** settings as specified in the table immediately after the following screenshot:
66+
:::image type="content" source="./media/functions-hybrid-powershell/function-app-create-basics.png" alt-text="Create a function app - Basics." border="true":::
5967

60-
![PowerShell Core function app](./media/functions-hybrid-powershell/create-function-powershell-app.png)
68+
1. Select **Next : Hosting**. On the **Hosting** page, enter the following settings.
6169

62-
| Setting | Suggested value | Description |
63-
| ------------ | ------- | -------------------------------------------------- |
64-
| **App name** | Globally unique name | Name that identifies your new function app. Valid characters are `a-z`, `0-9`, and `-`. |
65-
| **Subscription** | Your subscription | The subscription under which this new function app is created. |
66-
| **Resource Group** | myResourceGroup | Name for the new resource group in which to create your function app. You can also use the suggested value. |
67-
| **OS** | Preferred OS | Select Windows. |
68-
| **Runtime stack** | Preferred language | Choose PowerShell Core. |
69-
| **Storage** | Globally unique name | Create a storage account used by your function app. Storage account names must be from 3 to 24 characters in length and can contain numbers and lowercase letters only. You can also use an existing account.
70-
| **Application Insights** | Default | Creates an Application Insights resource of the same *App name* in the nearest supported region. By expanding this setting, you can change the **New resource name** or choose a different **Location** in an [Azure geography](https://azure.microsoft.com/global-infrastructure/geographies/) region where you want to store your data. |
70+
| Setting | Suggested value | Description |
71+
| ------------ | ---------------- | ----------- |
72+
| **[Storage account](../storage/common/storage-account-create.md)** | Globally unique name | Create a storage account used by your function app. Storage account names must be between 3 and 24 characters in length and can contain numbers and lowercase letters only. You can also use an existing account, which must meet the [storage account requirements](../azure-functions/functions-scale.md#storage-account-requirements). |
73+
|**Operating system**| Preferred operating system | An operating system is pre-selected for you based on your runtime stack selection, but you can change the setting if necessary. |
74+
| **[Plan type](../azure-functions/functions-scale.md)** | **App service plan** | Choose **App service plan**. When you run in an App Service plan, you must manage the [scaling of your function app](../azure-functions/functions-scale.md). |
75+
76+
:::image type="content" source="./media/functions-hybrid-powershell/function-app-create-hosting.png" alt-text="Create a function app - Hosting." border="true":::
7177

72-
1. After your settings are validated, select **Create**.
78+
1. Select **Next : Monitoring**. On the **Monitoring** page, enter the following settings.
7379

74-
1. Select the **Notification** icon in the upper-right corner of the portal, and wait for the "Deployment succeeded" message.
80+
| Setting | Suggested value | Description |
81+
| ------------ | ---------------- | ----------- |
82+
| **[Application Insights](../azure-functions/functions-monitoring.md)** | Default | Creates an Application Insights resource of the same *App name* in the nearest supported region. By expanding this setting or selecting **Create new**, you can change the Application Insights name or choose a different region in an [Azure geography](https://azure.microsoft.com/global-infrastructure/geographies/) where you want to store your data. |
83+
84+
:::image type="content" source="./media/functions-hybrid-powershell/function-app-create-monitoring.png" alt-text="Create a function app - Monitoring." border="true":::
85+
86+
1. Select **Review + create** to review the app configuration selections.
87+
88+
1. On the **Review + create** page, review your settings, and then select **Create** to provision and deploy the function app.
89+
90+
1. Select the **Notifications** icon in the upper-right corner of the portal and watch for the **Deployment succeeded** message.
7591

7692
1. Select **Go to resource** to view your new function app. You can also select **Pin to dashboard**. Pinning makes it easier to return to this function app resource from your dashboard.
7793

7894
## Create a hybrid connection for the function app
7995

8096
Hybrid connections are configured from the networking section of the function app:
8197

82-
1. Select the **Platform features** tab in the function app, and then select **Networking**.
83-
![App Overview for platform networking](./media/functions-hybrid-powershell/app-overview-platform-networking.png)
98+
1. Under **Settings** in the function app you just created, select **Networking**.
8499
1. Select **Configure your hybrid connections endpoints**.
85-
![Networking](./media/functions-hybrid-powershell/select-network-feature.png)
100+
101+
:::image type="content" source="./media/functions-hybrid-powershell/configure-hybrid-connection-endpoint.png" alt-text="Configure the hybrid connection endpoints." border="true":::
102+
86103
1. Select **Add hybrid connection**.
87-
![Hybrid Connection](./media/functions-hybrid-powershell/hybrid-connection-overview.png)
104+
105+
:::image type="content" source="./media/functions-hybrid-powershell/hybrid-connection-overview.png" alt-text="Add a hybrid connection." border="true":::
106+
88107
1. Enter information about the hybrid connection as shown right after the following screenshot. You have the option of making the **Endpoint Host** setting match the host name of the on-premises server to make it easier to remember the server later when you're running remote commands. The port matches the default Windows remote management service port that was defined on the server earlier.
89-
![Add Hybrid Connection](./media/functions-hybrid-powershell/add-hybrid-connection.png)
108+
109+
:::image type="content" source="./media/functions-hybrid-powershell/add-hybrid-connection.png" alt-text="Add hybrid connection." border="true":::
90110

91-
**Hybrid connection name**: ContosoHybridOnPremisesServer
92-
93-
**Endpoint Host**: finance1
94-
95-
**Endpoint Port**: 5986
96-
97-
**Servicebus namespace**: Create New
98-
99-
**Location**: Pick an available location
100-
101-
**Name**: contosopowershellhybrid
111+
| Setting | Suggested value |
112+
| ------------ | ---------------- |
113+
| **Hybrid connection name** | ContosoHybridOnPremisesServer |
114+
| **Endpoint Host** | finance1 |
115+
| **Endpoint Port** | 5986 |
116+
| **Servicebus namespace** | Create New |
117+
| **Location** | Pick an available location |
118+
| **Name** | contosopowershellhybrid |
102119

103-
5. Select **OK** to create the hybrid connection.
120+
1. Select **OK** to create the hybrid connection.
104121

105122
## Download and install the hybrid connection
106123

107-
1. Select **Download connection manager** to save the .msi file locally on your computer.
108-
![Download installer](./media/functions-hybrid-powershell/download-hybrid-connection-installer.png)
109-
1. Copy the .msi file from your local computer to the on-premises server.
124+
1. Select **Download connection manager** to save the *.msi* file locally on your computer.
125+
126+
:::image type="content" source="./media/functions-hybrid-powershell/download-hybrid-connection-installer.png" alt-text="Download the installer." border="true":::
127+
128+
1. Copy the *.msi* file from your local computer to the on-premises server.
110129
1. Run the Hybrid Connection Manager installer to install the service on the on-premises server.
111-
![Install Hybrid Connection](./media/functions-hybrid-powershell/hybrid-installation.png)
130+
131+
:::image type="content" source="./media/functions-hybrid-powershell/hybrid-installation.png" alt-text="Install the hybrid connection." border="true":::
132+
112133
1. From the portal, open the hybrid connection and then copy the gateway connection string to the clipboard.
113-
![Copy hybrid connection string](./media/functions-hybrid-powershell/copy-hybrid-connection.png)
134+
135+
:::image type="content" source="./media/functions-hybrid-powershell/copy-hybrid-connection.png" alt-text="Copy the hybrid connection string." border="true":::
136+
114137
1. Open the Hybrid Connection Manager UI on the on-premises server.
115-
![Open Hybrid Connection UI](./media/functions-hybrid-powershell/hybrid-connection-ui.png)
116-
1. Select the **Enter Manually** button and paste the connection string from the clipboard.
117-
![Paste connection](./media/functions-hybrid-powershell/enter-manual-connection.png)
138+
139+
:::image type="content" source="./media/functions-hybrid-powershell/hybrid-connection-ui.png" alt-text="Open the Hybrid Connection UI." border="true":::
140+
141+
1. Select **Enter Manually** and paste the connection string from the clipboard.
142+
143+
:::image type="content" source="./media/functions-hybrid-powershell/enter-manual-connection.png" alt-text="Paste the hybrid connection." border="true":::
144+
118145
1. Restart the Hybrid Connection Manager from PowerShell if it doesn't show as connected.
119146
```powershell
120147
Restart-Service HybridConnectionManager
121148
```
122149
123150
## Create an app setting for the password of an administrator account
124151
125-
1. Select the **Platform features** tab in the function app.
126-
1. Under **General Settings**, select **Configuration**.
127-
![Select Platform configuration](./media/functions-hybrid-powershell/select-configuration.png)
128-
1. Expand **New application setting** to create a new setting for the password.
129-
1. Name the setting _ContosoUserPassword_, and enter the password.
130-
1. Select **OK** and then save to store the password in the function application.
131-
![Add app setting for password](./media/functions-hybrid-powershell/add-appsetting-password.png)
152+
1. Under **Settings** for your function app, select **Configuration**.
153+
1. Select **+ New application setting**.
154+
155+
:::image type="content" source="./media/functions-hybrid-powershell/select-configuration.png" alt-text="Configure a password for the administrator account." border="true":::
156+
157+
1. Name the setting **ContosoUserPassword**, and enter the password. Select **OK**.
158+
1. Select **Save** to store the password in the function application.
159+
160+
:::image type="content" source="./media/functions-hybrid-powershell/save-administrator-password.png" alt-text="Save the password for the administrator account." border="true":::
161+
162+
## Create a function HTTP trigger
132163
133-
## Create a function http trigger to test
164+
1. In your function app, select **Functions**, and then select **+ Add**.
134165
135-
1. Create a new HTTP trigger function from the function app.
136-
![Create new HTTP trigger](./media/functions-hybrid-powershell/create-http-trigger-function.png)
137-
1. Replace the PowerShell code from the template with the following code:
166+
:::image type="content" source="./media/functions-hybrid-powershell/create-http-trigger-function.png" alt-text="Create new HTTP trigger." border="true":::
167+
168+
1. Select the **HTTP trigger** template.
169+
170+
:::image type="content" source="./media/functions-hybrid-powershell/select-http-trigger-template.png" alt-text="Select the HTTP trigger template." border="true":::
171+
172+
1. Name the new function and select **Create Function**.
173+
174+
:::image type="content" source="./media/functions-hybrid-powershell/create-new-http-function.png" alt-text="Name and create the new HTTP trigger function." border="true":::
175+
176+
## Test the function
177+
178+
1. In the new function, select **Code + Test**. Replace the PowerShell code from the template with the following code:
138179
139180
```powershell
140181
# Input bindings are passed in via param block.
@@ -169,8 +210,13 @@ Hybrid connections are configured from the networking section of the function ap
169210
-SessionOption (New-PSSessionOption -SkipCACheck)
170211
```
171212
172-
3. Select **Save** and **Run** to test the function.
173-
![Test the function app](./media/functions-hybrid-powershell/test-function-hybrid.png)
213+
1. Select **Save**.
214+
215+
:::image type="content" source="./media/functions-hybrid-powershell/save-http-function.png" alt-text="Change the PowerShell code and save the HTTP trigger function." border="true":::
216+
217+
1. Select **Test**, and then select **Run** to test the function. Review the logs to verify that the test was successful.
218+
219+
:::image type="content" source="./media/functions-hybrid-powershell/test-function-hybrid.png" alt-text="Test HTTP trigger function." border="true":::
174220
175221
## Managing other systems on-premises
176222
-49.2 KB
Loading
98.1 KB
Loading
-30.9 KB
Loading
16.1 KB
Loading
59.1 KB
Loading
60.1 KB
Loading
38.2 KB
Loading
-503 KB
Loading
128 KB
Loading

0 commit comments

Comments
 (0)