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/azure-functions/functions-hybrid-powershell.md
+54-54Lines changed: 54 additions & 54 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -16,13 +16,13 @@ ms.author: eamono
16
16
The Azure App Service Hybrid Connections enables access to resources in other networks. You can learn more about this capability on the [Hybrid Connections](../app-service/app-service-hybrid-connections.md) documentation. The following information describes how to use this capability to run PowerShell functions targeting an on-premises server. This server can then be used to manage all resources within the on-premises environment from an Azure PowerShell function.
17
17
18
18
19
-
## Configure an on-premises server to be used for PowerShell remoting
19
+
## Configure an on-premises server for PowerShell remoting
20
20
21
21
The below script enables PowerShell remoting, creates a new firewall rule, and a WinRM https listener. For testing purposes, a self-signed cert is used. It is recommended to use a signed certificate for production.
@@ -79,7 +79,7 @@ App Service Hybrid Connections are only available in Basic, Standard, and Isolat
79
79
80
80
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.
81
81
82
-
## Create a hybrid connection for the PowerShell function app
82
+
## Create a hybrid connection for the function app
83
83
84
84
Hybrid connections are configured from the networking section of the function app.
85
85
@@ -92,21 +92,21 @@ Hybrid connections are configured from the networking section of the function ap
92
92
1. Enter information about for the hybrid connection as shown below. The Endpoint Host can optionally match the hostname of the on-premises server to make it easier to remember the server later when running remote commands. The port matches the default Windows remote management service port defined on the server earlier.
# This is the name of the hybrid connection Endpoint.
156
+
$HybridEndpoint = "finance1"
157
+
158
+
$Script = {
159
+
Param(
160
+
[Parameter(Mandatory=$True)]
161
+
[String] $Service
162
+
)
163
+
Get-Service $Service
164
+
}
165
+
166
+
Write-Output "Scenario 1: Running command via Invoke-Command"
167
+
Invoke-Command -ComputerName $HybridEndpoint `
168
+
-Credential $Credential `
169
+
-Port 5986 `
170
+
-UseSSL `
171
+
-ScriptBlock $Script `
172
+
-ArgumentList "*" `
173
+
-SessionOption (New-PSSessionOption -SkipCACheck)
174
+
```
175
+
176
+
3. Click Save and run to test the function
177
177

178
178
179
-
## Managing other systems on-premises from the hybrid connection server
179
+
## Managing other systems on-premises
180
180
181
181
You can use the connected on-premises server to connect to other servers and management systems in the local environment. This lets you manage your data center operations from Azure using your PowerShell functions. The following script registers a PowerShell configuration session that runs under the supplied credentials. These credentials need to be an administrator on the remote servers. You can then use this configuration to access other endpoints in the local server or data center.
182
182
@@ -253,7 +253,7 @@ The above two scenarios enable you to connect and manage your on-premises enviro
253
253
254
254
You can also use Azure [virtual networks](./functions-create-vnet.md) to connect to your on-premises environment using Azure Functions.
255
255
256
-
## Next Steps
256
+
## Next steps
257
257
258
258
> [!div class="nextstepaction"]
259
259
> [Learn more about working with PowerShell functions](functions-reference-powershell.md)
0 commit comments