Skip to content

Commit 14f31d4

Browse files
Merge pull request #9797 from MicrosoftDocs/main638355171846331239sync_temp
For protected branch, push strategy should use PR and merge to target branch method to work around git push error
2 parents 0392c1d + 6173dac commit 14f31d4

File tree

5 files changed

+50
-12
lines changed

5 files changed

+50
-12
lines changed

bridge/articles/bridge-to-kubernetes-vs-code.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -113,7 +113,7 @@ Select **Run** then **Stop Debugging** or press **Shift**+**F5** to stop the deb
113113

114114
Bridge to Kubernetes can handle routing traffic and replicating environment variables without any additional configuration. If you need to download any files that are mounted to the container in your Kubernetes cluster, such as a ConfigMap file, you can create a `KubernetesLocalProcessConfig.yaml` to download those files to your development computer. For more information, see [Configure Bridge to Kubernetes][kubernetesLocalProcessConfig-yaml].
115115

116-
If you're using an AKS cluster that uses managed identity, a security feature provided by Azure Active Directory, see [Use managed identity with Bridge to Kubernetes](managed-identity.md) for information about how to configure Bridge to Kubernetes for this scenario.
116+
If you're using an AKS cluster that uses managed identity, a security feature provided by Microsoft Entra ID, see [Use managed identity with Bridge to Kubernetes](managed-identity.md) for information about how to configure Bridge to Kubernetes for this scenario.
117117

118118
## Using logging and diagnostics
119119

bridge/articles/managed-identity.md

Lines changed: 8 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -3,14 +3,14 @@ title: "How to use managed identity with Bridge to Kubernetes"
33
ms.technology: bridge
44
ms.date: 08/11/2022
55
ms.topic: "conceptual"
6-
description: "Learn how to use Azure Active Directory (Azure AD) managed identity in an AKS cluster with Bridge to Kubernetes"
6+
description: "Learn how to use Microsoft Entra managed identity in an AKS cluster with Bridge to Kubernetes"
77
manager: jmartens
88
author: ghogen
99
ms.author: ghogen
1010
---
1111
# Use managed identity with Bridge to Kubernetes
1212

13-
If your AKS cluster uses [managed identity](/azure/active-directory/managed-identities-azure-resources/overview) security features to secure access to secrets and resources, Bridge to Kubernetes needs some special configuration to ensure it can work with these features. An Azure Active Directory (AD) token needs to be downloaded to the local machine to ensure that local execution and debugging is properly secured, and this requires some special configuration in Bridge to Kubernetes. This article shows how to configure Bridge to Kubernetes to work with services that use managed identity.
13+
If your AKS cluster uses [managed identity](/azure/active-directory/managed-identities-azure-resources/overview) security features to secure access to secrets and resources, Bridge to Kubernetes needs some special configuration to ensure it can work with these features. A Microsoft Entra token needs to be downloaded to the local machine to ensure that local execution and debugging is properly secured, and this requires some special configuration in Bridge to Kubernetes. This article shows how to configure Bridge to Kubernetes to work with services that use managed identity.
1414

1515
## How to configure your service to use managed identity
1616

@@ -22,11 +22,13 @@ enableFeatures:
2222
```
2323
2424
> [!WARNING]
25-
> Be sure to only use managed identity for Bridge to Kubernetes when working with dev clusters, not production clusters, because the Azure AD token is fetched to the local machine, which presents a potential security risk.
25+
> Be sure to only use managed identity for Bridge to Kubernetes when working with dev clusters, not production clusters, because the Microsoft Entra token is fetched to the local machine, which presents a potential security risk.
2626
2727
If you don't have a *KubernetesLocalConfig.yaml* file, you can create one; see [How to: Configure Bridge to Kubernetes](configure-bridge-to-kubernetes.md).
2828
29-
## How to fetch the Azure Active Directory tokens
29+
<a name='how-to-fetch-the-azure-active-directory-tokens'></a>
30+
31+
## How to fetch the Microsoft Entra tokens
3032
3133
You must ensure that you are relying on either `Azure.Identity.DefaultAzureCredential` or `Azure.Identity.ManagedIdentityCredential` in code when fetching the token.
3234

@@ -52,7 +54,7 @@ To learn how to access other Azure resources using managed identity, see the [Ne
5254

5355
## Receive Azure alerts when tokens are downloaded
5456

55-
Whenever you use Bridge to Kubernetes on a service, the Azure AD token is downloaded to the local machine. You can enable Azure alerts to be notified when this occurs. For information, see [Enable Azure Defender](/azure/security-center/enable-azure-defender). Please be aware that there is a charge (after a 30-day trial period).
57+
Whenever you use Bridge to Kubernetes on a service, the Microsoft Entra token is downloaded to the local machine. You can enable Azure alerts to be notified when this occurs. For information, see [Enable Azure Defender](/azure/security-center/enable-azure-defender). Please be aware that there is a charge (after a 30-day trial period).
5658

5759
## Next steps
5860

@@ -68,4 +70,4 @@ There are other tutorials in that section as well for using managed identity to
6870

6971
## See also
7072

71-
[Azure Active Directory](/azure/active-directory/managed-identities-azure-resources/)
73+
[Microsoft Entra ID](/azure/active-directory/managed-identities-azure-resources/)

bridge/articles/toc.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@
2222
href: kubernetes-environment-variables.md
2323
- name: Configure Bridge to Kubernetes
2424
href: configure-bridge-to-kubernetes.md
25-
- name: Use Azure AD managed identities
25+
- name: Use Microsoft Entra managed identities
2626
href: managed-identity.md
2727
- name: Resources
2828
expanded: true

docs/containers/edit-and-refresh.md

Lines changed: 38 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ ms.author: ghogen
55
author: ghogen
66
manager: jmartens
77
ms.topic: how-to
8-
ms.date: 10/17/2023
8+
ms.date: 11/08/2023
99
ms.technology: vs-container-tools
1010
---
1111
# Debug apps in a local Docker container
@@ -157,12 +157,48 @@ The following procedure demonstrates how to add orchestration support to a .NET
157157
![Screenshot of the code window for Program.cs in Visual Studio with a breakpoint set to the left of a code line that is highlighted in yellow.](media/edit-and-refresh/breakpoint-console.png)
158158
::: moniker-end
159159

160+
:::moniker range=">=vs-2022"
161+
## Authenticating to Azure services using the token proxy
162+
163+
When you're using Azure services from a container, you can use [DefaultAzureCredential](/dotnet/api/azure.identity.defaultazurecredential) (with the [VisualStudioCredential](/dotnet/api/azure.identity.visualstudiocredential) enabled) to authenticate with Azure services with your Microsoft Entra account without any additional configuration in the container. To enable this, see [How to configure Visual Studio Container Tools](container-tools-configure.md). Also, you need to set up Azure authentication in Visual Studio by following the instructions at [Authenticate Visual Studio with Azure](/dotnet/azure/configure-visual-studio#authenticate-visual-studio-with-azure). The support for VisualStudioCredential in a container is available in Visual Studio version 17.6 and later.
164+
165+
### Azure Functions
166+
167+
If you're debugging an integrated Azure Functions project and using the token proxy in the container to handle authentication to Azure services, you need to copy the .NET runtime onto the container for the token proxy to run. If you're debugging an isolated Azure Functions project, it already has the .NET runtime, so there's no need for this extra step.
168+
169+
To ensure the .NET runtime is available to the token proxy, add or modify the `debug` layer in the Dockerfile that copies the .NET runtime into the container image. For Linux containers, you can add the following code to the Dockerfile:
170+
171+
```dockerfile
172+
# This layer is to support debugging, VS's Token Proxy requires the runtime to be installed in the container
173+
FROM mcr.microsoft.com/dotnet/runtime:8.0 AS runtime
174+
FROM base as debug
175+
COPY --from=runtime /usr/share/dotnet /usr/share/dotnet
176+
RUN ln -s /usr/share/dotnet/dotnet /usr/bin/dotnet
177+
```
178+
179+
Also, in the Visual Studio project, you need to make some changes to specify this as the layer to use when debugging in Fast Mode. For an explanation of Fast Mode, see [Customize Docker containers in Visual Studio](container-build.md#debugging). For single container scenarios (not Docker Compose), set the MSBuild property `DockerfileFastModeStage` to `debug` in order to use that layer for debugging. For Docker Compose, modify the `docker-compose.vs.debug.yml` as follows:
180+
181+
```yml
182+
# Set the stage to debug to use an image with the .NET runtime in it
183+
services:
184+
functionappintegrated:
185+
build:
186+
target: debug
187+
```
188+
189+
For a code sample of authentication with Azure Functions, including both integrated and isolated scenarios, see [VisualStudioCredentialExample](https://github.com/NCarlsonMSFT/VisualStudioCredentialExample).
190+
:::moniker-end
191+
160192
## Container reuse
161193

162-
During the development cycle, Visual Studio rebuilds only your container images and the container itself when you change the Dockerfile. If you don't change the Dockerfile, Visual Studio reuses the container from an earlier run.
194+
When you use [Fast Mode](container-build.md#debugging), which Visual Studio normally uses for the Debug configuration, Visual Studio rebuilds only your container images and the container itself when you change the Dockerfile. If you don't change the Dockerfile, Visual Studio reuses the container from an earlier run.
163195

164196
If you manually modified your container and want to restart with a clean container image, use the **Build** > **Clean** command in Visual Studio, and then build as normal.
165197

198+
When you're not using Fast Mode, which is typical for the Release configuration, Visual Studio rebuilds the container each time the project is built.
199+
200+
You can configure when Fast Mode is used; see [How to configure Visual Studio Container Tools](container-tools-configure.md).
201+
166202
## Troubleshoot
167203

168204
Learn how to [troubleshoot Visual Studio Docker development](troubleshooting-docker-errors.md).

docs/debugger/index.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -30,6 +30,8 @@ landingContent:
3030
url: getting-started-with-the-debugger-cpp.md
3131
- text: Learn to debug Visual Basic
3232
url: ../get-started/visual-basic/tutorial-debugger.md?toc=%252fvisualstudio%252fdebugger%252ftoc.json
33+
- text: Try AI-assisted debugging
34+
url: debug-with-copilot.md
3335
- text: Run Python code in the debugger >>
3436
url: ../python/tutorial-working-with-python-in-visual-studio-step-04-debugging.md
3537
- text: Debugging for absolute beginners
@@ -63,8 +65,6 @@ landingContent:
6365
links:
6466
- text: Debugger tips and tricks
6567
url: debugger-tips-and-tricks.md
66-
- text: Debug with Copilot
67-
url: debug-with-copilot.md
6868
- text: Write and debug running XAML code
6969
url: ../xaml-tools/xaml-hot-reload.md
7070
- text: Debug a live Azure app

0 commit comments

Comments
 (0)