Skip to content

Commit bfb83ab

Browse files
Merge pull request #10524 from Mikejo5000/mikejo-br18
Debug .NET Core in AKS on Linux using SSH
2 parents 08232d5 + 1c79d56 commit bfb83ab

File tree

4 files changed

+62
-14
lines changed

4 files changed

+62
-14
lines changed
Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,25 @@
1+
---
2+
title: Prerequisites for .NET Core on Linux and SSH
3+
description: Prerequisites for debugging .NET Core on Linux and SSH by attaching to a process
4+
services: ""
5+
author: mikejo5000
6+
ms.service: ""
7+
ms.topic: include
8+
ms.date: 10/19/2022
9+
ms.author: mikejo
10+
ms.custom: include file
11+
---
12+
13+
- On the Visual Studio computer, you need to install either the **ASP.NET and web development** workload or the **.NET Core cross-platform development** workload.
14+
15+
- On the Linux server, you need to install SSH server, unzip and install with either curl or wget. For example, on Ubuntu you can do that by running:
16+
17+
``` cmd
18+
sudo apt-get install openssh-server unzip curl
19+
```
20+
21+
SFTP must be enabled as well as SSH. Most SSH distributions install and enable SFTP by default, but that is not always the case.
22+
23+
- On the Linux server, [install the .NET runtime on Linux](/dotnet/core/install/linux), and find the page matching your Linux distribution (such as Ubuntu). The .NET SDK is not required.
24+
25+
- For comprehensive ASP.NET Core instructions, see [Host ASP.NET Core on Linux with Nginx](/aspnet/core/host-and-deploy/linux-nginx) and [Host ASP.NET Core on Linux with Apache](/aspnet/core/host-and-deploy/linux-apache).
Lines changed: 33 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,33 @@
1+
---
2+
title: "Remote debug AKS on Linux using SSH"
3+
description: Remote debug ASP.NET Core running in Azure Kubernetes Service (AKS) on Linux using Secure Shell (SSH) by attaching to a process. Prepare your app for debugging. Build and deploy the app. Attach the debugger.
4+
ms.date: "10/19/2022"
5+
ms.topic: "conceptual"
6+
helpviewer_keywords:
7+
- "remote debugging, linux"
8+
author: "mikejo5000"
9+
ms.author: "mikejo"
10+
manager: jmartens
11+
ms.technology: vs-ide-debug
12+
ms.workload:
13+
- "multiple"
14+
---
15+
# Remote debug .NET Core running in AKS on Linux using SSH by attaching to a process
16+
17+
[!INCLUDE [Visual Studio](~/includes/applies-to-version/vs-windows-only.md)]
18+
19+
Starting in Visual Studio 2017, you can attach to an ASP.NET Core process running in Azure Kubernetes Service (AKS) on a remote Linux deployment over Secure Shell (SSH).
20+
21+
## Prerequisites
22+
23+
[!INCLUDE [prerequisites-dotnet-linux-ssh](../debugger/includes/prerequisites-dotnet-linux-ssh.md)]
24+
25+
## Prepare to debug
26+
27+
1. Expose the AKS pod to the SSH port using an SSH key pair.
28+
29+
>[!NOTE]
30+
> Depending on your security configuration, health probes may detect an unhealthy service and tear down the pod.
31+
32+
2. To debug, follow instructions described in [Debug .NET Core on Linux using SSH by attaching to a process](../debugger/remote-debugging-dotnet-core-linux-with-ssh.md).
33+

docs/debugger/remote-debugging-dotnet-core-linux-with-ssh.md

Lines changed: 2 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -17,23 +17,11 @@ ms.workload:
1717

1818
[!INCLUDE [Visual Studio](~/includes/applies-to-version/vs-windows-only.md)]
1919

20-
Starting in Visual Studio 2017, you can attach to .NET Core processes running on a local or remote Linux deployment over SSH. This article describes how to set up debugging and how to debug. For debugging scenarios using Docker containers, see [Attach to a process running on a Docker container](../debugger/attach-to-process-running-in-docker-container.md) and the [container tools](../containers/edit-and-refresh.md) articles instead. To debug Linux on WSL 2 from Visual Studio (no attach to process), see [Debug .NET Core Apps in WSL 2 with Visual Studio](../debugger/debug-dotnet-core-in-wsl-2.md).
20+
Starting in Visual Studio 2017, you can attach to .NET Core processes running on a local or remote Linux deployment over Secure Shell (SSH). This article describes how to set up debugging and how to debug. For debugging scenarios using Docker containers, see [Attach to a process running on a Docker container](../debugger/attach-to-process-running-in-docker-container.md) and the [container tools](../containers/edit-and-refresh.md) articles instead. To debug Linux on WSL 2 from Visual Studio (no attach to process), see [Debug .NET Core Apps in WSL 2 with Visual Studio](../debugger/debug-dotnet-core-in-wsl-2.md).
2121

2222
## Prerequisites
2323

24-
- On the Visual Studio computer, you need to install either the **ASP.NET and web development** workload or the **.NET Core cross-platform development** workload.
25-
26-
- On the Linux server, you need to install SSH server, unzip and install with either curl or wget. For example, on Ubuntu you can do that by running:
27-
28-
``` cmd
29-
sudo apt-get install openssh-server unzip curl
30-
```
31-
32-
SFTP must be enabled as well as SSH. Most SSH distributions install and enable SFTP by default, but that is not always the case.
33-
34-
- On the Linux server, [install the .NET runtime on Linux](/dotnet/core/install/linux), and find the page matching your Linux distribution (such as Ubuntu). The .NET SDK is not required.
35-
36-
- For comprehensive ASP.NET Core instructions, see [Host ASP.NET Core on Linux with Nginx](/aspnet/core/host-and-deploy/linux-nginx) and [Host ASP.NET Core on Linux with Apache](/aspnet/core/host-and-deploy/linux-apache).
24+
[!INCLUDE [prerequisites-dotnet-linux-ssh](../debugger/includes/prerequisites-dotnet-linux-ssh.md)]
3725

3826
## Prepare your application for debugging
3927

docs/debugger/toc.yml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -438,6 +438,8 @@
438438
href: debug-dotnet-core-in-wsl-2.md
439439
- name: Debug .NET Core on Linux using SSH
440440
href: remote-debugging-dotnet-core-linux-with-ssh.md
441+
- name: Remote debug .NET Core running in AKS on Linux using SSH
442+
href: remote-debugging-aks-on-linux-with-ssh.md
441443
- name: Debug with Container Tools >>
442444
href: ../containers/edit-and-refresh.md
443445
- name: Application types

0 commit comments

Comments
 (0)