Skip to content

Commit 28a9b04

Browse files
author
RoseHJM
committed
image fixes
1 parent 854f0a5 commit 28a9b04

21 files changed

+131
-30
lines changed

articles/dev-box/configure-conditional-access-policies-for-dev-tunnels-service.md

Lines changed: 37 additions & 30 deletions
Original file line numberDiff line numberDiff line change
@@ -3,89 +3,96 @@ title: Configure Conditional Access Policies for Dev Tunnels Service
33
description: Learn how to configure conditional access policies for the Dev tunnels service in Microsoft Entra ID to secure remote development environments and restrict access based on device management and IP ranges.
44
author: RoseHJM
55
contributors:
6-
ms.topic: concept-article
6+
ms.topic: how-to
77
ms.date: 05/16/2025
88
ms.author: rosemalcolm
99
ms.reviewer: rosemalcolm
1010
---
1111

1212
# Background
1313

14-
The Dev Box service gives you an alternative connectivity method on top of Dev tunnels. You can develop remotely while coding locally or keep development going during AVD outages or poor network performance. Many large enterprises using Dev Box have strict security and compliance policies, and their code is valuable to their business. Restricting Dev tunnels with conditional access policies is crucial for these controls.
14+
The Dev Box service gives you an alternative connectivity method on top of Dev tunnels. You can develop remotely while coding locally or keep development going during Azure Virtual Desktop (AVD) outages or poor network performance. Many large enterprises using Dev Box have strict security and compliance policies, and their code is valuable to their business. Restricting Dev tunnels with conditional access policies is crucial for these controls.
1515

16-
## Goals
16+
Conditional access policies for the Dev tunnels service:
1717

1818
- Let Dev tunnels connect from managed devices, but deny connections from unmanaged devices.
19-
2019
- Let Dev tunnels connect from specific IP ranges, but deny connections from other IP ranges.
20+
- Support other regular conditional access configurations.
21+
- Apply to both the Visual Studio Code application and VS Code web.
2122

22-
- Support other regular CA configurations.
23-
24-
- Conditional access policies apply to both the VSCode application and VSCode web.
25-
23+
## Configure conditional access
2624

27-
28-
## CA Configurations
29-
30-
The conditional access policies work correctly for the Dev tunnels service. Because registering the Dev tunnels service app to a tenant and making it available to the CA picker is unique, this article documents the steps.
25+
The conditional access policies work correctly for the Dev tunnels service. Because registering the Dev tunnels service app to a tenant and making it available to the conditional access picker is unique, this article documents the steps.
3126

3227
### Register Dev tunnels service to a tenant
3328

34-
According to [Apps & service principals in Microsoft Entra ID](/entra/identity-platform/app-objects-and-service-principals?tabs=browser), a service principal is created in each tenant where the application is used. However, this doesn't apply to the Dev tunnels service. This article doesn't explore the root cause. If you know about app definitions, review the [Dev tunnels service app registration specification](https://msazure.visualstudio.com/One/_git/AAD-FirstPartyApps?path=/Customers/Configs/AppReg/46da2f7e-b5ef-422a-88d4-2a7f9de6a0b2/AppReg.Parameters.Production.json&version=GBmaster&_a=contents).
29+
According to [Apps & service principals in Microsoft Entra ID](/entra/identity-platform/app-objects-and-service-principals?tabs=browser), a service principal is created in each tenant where the application is used. However, this doesn't apply to the Dev tunnels service. This article doesn't explore the root conditional access use. If you know about app definitions, review the [Dev tunnels service app registration specification](https://msazure.visualstudio.com/One/_git/AAD-FirstPartyApps?path=/Customers/Configs/AppReg/46da2f7e-b5ef-422a-88d4-2a7f9de6a0b2/AppReg.Parameters.Production.json&version=GBmaster&_a=contents).
3530

36-
Therefore, we are using [Microsoft.Graph PowerShell](/powershell/module/microsoft.graph.authentication/connect-mggraph?view=graph-powershell-1.0&preserve-view=true) to register the app to a tenant.
31+
Therefore, we're using [Microsoft.Graph PowerShell](/powershell/module/microsoft.graph.authentication/connect-mggraph?view=graph-powershell-1.0&preserve-view=true) to register the app to a tenant.
3732

3833
1. Install PowerShell 7.x
3934

40-
1. Follow [Install the Microsoft Graph PowerShell SDK | Microsoft Learn](/powershell/microsoftgraph/installation?view=graph-powershell-1.0&preserve-view=true) to install Microsoft.Graph PowerShell
35+
1. Follow [Install the Microsoft Graph PowerShell SDK | Microsoft Learn](/powershell/microsoftgraph/installation?view=graph-powershell-1.0&preserve-view=true) to install Microsoft.Graph PowerShell.
4136

42-
1. Run the following commands
37+
1. Run the following commands:
38+
```powershell
39+
# Connect to Microsoft Graph
40+
Connect-MgGraph -TenatnId <TenantID> -Scopes "Application.ReadWrite.All"
41+
42+
# Register the Dev tunnels service app to the tenant
43+
$TunnelServiceAppId = "46da2f7e-b5ef-422a-88d4-2a7f9de6a0b2"
44+
New-MgServicePrincipal -AppId $TunnelServiceAppId
45+
```
4346
4447
1. Go to "Microsoft Entra ID" -> "Manage" -> "Enterprise applications" to verify if the Dev tunnels service is registered.
4548
46-
:::image type="content" source="media/configure-conditional-access-policies-for-dev-tunnels-service/image1.png" alt-text="Screenshot of the Enterprise applications page in Microsoft Entra ID, showing the Dev tunnels service registration.":::
49+
:::image type="content" source="media/configure-conditional-access-policies-for-dev-tunnels-service/dev-tunnels-register-service.png" alt-text="Screenshot of the Enterprise applications page in Microsoft Entra ID, showing the Dev tunnels service registration.":::
4750
48-
### Enable the Dev tunnels service for the CA picker
51+
### Enable the Dev tunnels service for the conditional access picker
4952
50-
The Entra ID team is working on removing the need to onboard apps for them to appear in the app picker, with delivery expected in May. Therefore, we are not onboarding Dev tunnel service to the CA picker. Instead, target the Dev tunnels service in a CA policy using [Custom Security Attributes](/entra/identity/conditional-access/concept-filter-for-applications).
53+
The Microsoft Entra IDteam is working on removing the need to onboard apps for them to appear in the app picker, with delivery expected in May. Therefore, we aren't onboarding Dev tunnel service to the conditional access picker. Instead, target the Dev tunnels service in a conditional access policy using [Custom Security Attributes](/entra/identity/conditional-access/concept-filter-for-applications).
5154
5255
1. Follow [Add or deactivate custom security attribute definitions in Microsoft Entra ID](/entra/fundamentals/custom-security-attributes-add?tabs=ms-powershell) to add the following Attribute set and New attributes.
5356
54-
:::image type="content" source="media/configure-conditional-access-policies-for-dev-tunnels-service/image2.png" alt-text="Screenshot of the custom security attribute definition process in Microsoft Entra ID.":::
57+
:::image type="content" source="media/configure-conditional-access-policies-for-dev-tunnels-service/dev-tunnels-custom-attributes.png" alt-text="Screenshot of the custom security attribute definition process in Microsoft Entra ID.":::
5558
56-
:::image type="content" source="media/configure-conditional-access-policies-for-dev-tunnels-service/image3.png" alt-text="Screenshot of the new attribute creation in Microsoft Entra ID.":::
59+
:::image type="content" source="media/configure-conditional-access-policies-for-dev-tunnels-service/dev-tunnels-attribute.png" alt-text="Screenshot of the new attribute creation in Microsoft Entra ID.":::
5760
5861
1. Follow [Create a conditional access policy](/entra/identity/conditional-access/concept-filter-for-applications#create-a-conditional-access-policy) to create a conditional access policy.
5962
60-
:::image type="content" source="media/configure-conditional-access-policies-for-dev-tunnels-service/image4.png" alt-text="Screenshot of the conditional access policy creation process for Dev tunnels service.":::
63+
:::image type="content" source="media/configure-conditional-access-policies-for-dev-tunnels-service/dev-tunnels-conditional-access-policy.png" alt-text="Screenshot of the conditional access policy creation process for Dev tunnels service.":::
6164
6265
1. Follow [Configure custom attributes](/entra/identity/conditional-access/concept-filter-for-applications#configure-custom-attributes) to configure the custom attribute for the Dev tunnels service.
6366
64-
:::image type="content" source="media/configure-conditional-access-policies-for-dev-tunnels-service/image5.png" alt-text="Screenshot of configuring custom attributes for the Dev tunnels service in Microsoft Entra ID.":::
67+
:::image type="content" source="media/configure-conditional-access-policies-for-dev-tunnels-service/dev-tunnels-security-attributes.png" alt-text="Screenshot of configuring custom attributes for the Dev tunnels service in Microsoft Entra ID.":::
6568
6669
### Testing
6770
6871
1. Turn off the BlockDevTunnelCA
6972
7073
1. Create a DevBox in the test tenant and run the following commands inside it. Dev tunnels can be created and connected externally.
74+
```
75+
code tunnel user login --provider microsoft
76+
code tunnel
77+
```
7178
7279
1. Enable the BlockDevTunnelCA.
7380
74-
1. New connections to the existing Dev tunnels can't be established. Please test with an alternate browser if a connection has already been established.
81+
1. New connections to the existing Dev tunnels can't be established. Test with an alternate browser if a connection has already been established.
7582
7683
1. Any new attempts to execute the commands in step #2 will fail. Both errors are:
7784
78-
:::image type="content" source="media/configure-conditional-access-policies-for-dev-tunnels-service/image6.png" alt-text="Screenshot of error message when Dev tunnels connection is blocked by conditional access policy.":::
85+
:::image type="content" source="media/configure-conditional-access-policies-for-dev-tunnels-service/dev-tunnels-no-access.png" alt-text="Screenshot of error message when Dev tunnels connection is blocked by conditional access policy.":::
7986
80-
1. The Entra ID sign-in logs show these entries.
87+
1. The Microsoft Entra ID sign-in logs show these entries.
8188
82-
:::image type="content" source="media/configure-conditional-access-policies-for-dev-tunnels-service/image7.png" alt-text="Screenshot of Entra ID sign-in logs showing entries related to Dev tunnels conditional access policy.":::
89+
:::image type="content" source="media/configure-conditional-access-policies-for-dev-tunnels-service/dev-tunnels-activity-logs.png" alt-text="Screenshot of Microsoft Entra ID sign-in logs showing entries related to Dev tunnels conditional access policy.":::
8390
8491
## Limitations
8592
86-
- Configure conditional access policies for Dev Box service to manage Dev tunnels for Dev Box users.
87-
88-
- Limit Dev tunnels that are not managed by the Dev Box service. In the context of Dev Boxes, if the Dev tunnels GPO is configured **to allow only selected Microsoft Entra tenant IDs**, Conditional Access policies can also restrict self-created Dev tunnels.
93+
With Dev Tunnels, the following limitations apply:
94+
- You can't configure conditional access policies for Dev Box service to manage Dev tunnels for Dev Box users.
95+
- You can't limit Dev tunnels that aren't managed by the Dev Box service. In the context of Dev Boxes, if the Dev tunnels GPO is configured **to allow only selected Microsoft Entra tenant IDs**, Conditional Access policies can also restrict self-created Dev tunnels.
8996
9097
## Related content
9198
- [Conditional Access policies](/entra/identity/conditional-access/concept-conditional-access-policies)
Lines changed: 92 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,92 @@
1+
---
2+
title: Set Up and Connect to Azure Dev Box Using VS Code
3+
description: Learn how to set up and connect to your Azure Dev Box using the Open in VS Code feature. Follow step-by-step instructions to provision a Dev Box, install the Dev Box extension, enable tunnels, and connect remotely for development.
4+
author: RoseHJM
5+
contributors:
6+
ms.topic: concept-article
7+
ms.date: 05/16/2025
8+
ms.author: rosemalcolm
9+
ms.reviewer: rosemalcolm
10+
---
11+
12+
# Setup & Connect to your Dev Box via VS Code
13+
14+
Azure Dev Box makes it easy to provision and manage cloud-based development environments. This article shows you how to set up and connect to your Azure Dev Box using Visual Studio Code. You learn how to register for the Open in VS Code feature, install the required extension, enable secure tunnels, and connect remotely for a seamless development experience. Follow these steps to get started quickly and work efficiently from anywhere.
15+
16+
**Target audience**: Dev Box Users/Developers
17+
18+
In this doc, we walk you through the steps to connect to Dev Box with Open in VS Code feature.
19+
20+
1. Provision a new Dev Box with Dev Box Tunnel or create a Dev Box Tunnel on an existing Dev Box.
21+
22+
1. Enable the Dev Box Tunnel.
23+
24+
1. Connect to the Dev Box Tunnel.
25+
26+
1. Disable the Dev Box Tunnel.
27+
28+
Steps to connect to Dev Box with Open in VS Code Feature
29+
30+
1. Provision a Dev Box
31+
32+
You can skip this step if you already have a Dev Box.
33+
34+
Sign in to [<u>Developer Portal</u>](https://devportal.microsoft.com/) with your Microsoft account, and create a Dev Box in the project you have access to.
35+
36+
1. Install VS Code Extension
37+
38+
Search for **Dev Box** in the VS Code Extension Marketplace and install the latest version (2.0.0 as of 05/15/2025) in your **local** VS Code - **NOT** in the Dev Box you want to connect to.
39+
40+
:::image type="content" source="media/how-to-setup-dev-tunnels/image1.png" alt-text="Screenshot of the Dev Box extension in the VS Code Extension Marketplace.":::
41+
42+
1. Sign in to Dev Box Extension
43+
44+
Select the Dev Box icon in the left sidebar, and select Sign In.
45+
46+
:::image type="content" source="media/how-to-setup-dev-tunnels/image2.png" alt-text="Screenshot of the Dev Box extension sign-in screen in VS Code.":::
47+
48+
1. Create and Enable Dev Box Tunnel
49+
50+
After signing in, you'll see all the projects you have access to. Choose the project where you created the Dev Box, and select the Dev Box you want to connect to.
51+
52+
If you see **No Tunnel** in the description, you need to manually create a tunnel resource first.
53+
54+
:::image type="content" source="media/how-to-setup-dev-tunnels/image3.png" alt-text="Screenshot of the Dev Box extension showing the option to create a tunnel.":::
55+
56+
Before enabling the tunnel, you **MUST** log into the Dev Box at least once using any client (for example, browser, Windows App, Remote Desktop client). This step is **mandatory** after each shutdown and restart to establish the required user session for setting up the tunnel. Once logged in, you can disconnect from the Dev Box.
57+
58+
You **DO NOT** need to sign-in every time you enable or connect to the tunnel—only after a shutdown or restart.
59+
60+
:::image type="content" source="media/how-to-setup-dev-tunnels/image4.png" alt-text="Screenshot of enabling the tunnel in the Dev Box extension.":::
61+
62+
Then, you can enable the tunnel. This process might take up to 1-3 minutes, as it installs VS Code on the Dev Box (if not already installed) and set up the tunnel.
63+
64+
1. Connect to the Dev Box in VS Code
65+
66+
Once everything is set up, you can open the Dev Box in VS Code by clicking the **Connect to Tunnel** button.
67+
68+
:::image type="content" source="media/how-to-setup-dev-tunnels/image5.png" alt-text="Screenshot of the Connect to Tunnel button in the Dev Box extension.":::
69+
70+
1. Dev Box Remote experience in VS Code
71+
72+
You can open any folder or workspace on the remote Dev Box using **File > Open File/Folder/Workspace** just as you would locally!
73+
74+
If you have WSL environment on the Dev Box, you can connect to it using **Remote Explorer**.
75+
76+
:::image type="content" source="media/how-to-setup-dev-tunnels/image6.png" alt-text="Screenshot of the Remote Explorer in VS Code showing WSL targets.":::
77+
78+
Select WSL targets from the dropdown and all the WSL distributions are listed. You can open any WSL distribution in the current or new window.
79+
80+
:::image type="content" source="media/how-to-setup-dev-tunnels/image7.png" alt-text="Screenshot of a WSL distribution terminal in VS Code.":::
81+
82+
For more information on the WSL development experience, refer to the [<u>Remote - WSL</u>](https://code.visualstudio.com/docs/remote/wsl) and [<u>Set up a WSL development environment</u>](https://learn.microsoft.com/en-us/windows/wsl/setup/environment) documentation.
83+
84+
FAQ
85+
86+
1. Why do I need to sign-in to the Dev Box before enabling the tunnel?
87+
88+
> This step is required to establish a user session for setting up the tunnel. After the initial login, you can just disconnect from the Dev Box. Then you can enable or connect to the tunnel without logging in again, unless the Dev Box is shut down or restarted.
89+
90+
1. Why can't I connect to the Dev Box even if the tunnel is enabled?
91+
92+
> Refresh the Dev Box extension explorer view with the button on the top right corner to check the latest status of the tunnel. If the tunnel is enabled, but you still can't connect, try disabling the tunnel, logging into the Dev Box, and then re-enabling the tunnel.
Loading
Loading
21 KB
Loading
Loading

0 commit comments

Comments
 (0)