Skip to content

Commit 0a62d10

Browse files
authored
Remove VM (#1852)
1 parent 3dc31ce commit 0a62d10

File tree

8 files changed

+1
-226
lines changed

8 files changed

+1
-226
lines changed

docs/deploy_private.md

Lines changed: 1 addition & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -3,17 +3,13 @@
33

44
If you want to disable public access when deploying the Chat App, you can do so by setting `azd` environment values.
55

6-
[📺 Watch a video overview of the VM provisioning process](https://www.youtube.com/watch?v=RbITd0a5who)
7-
86
## Before you begin
97

108
Deploying with public access disabled adds additional cost to your deployment. Please see pricing for the following products:
119

1210
1. [Private Endpoints](https://azure.microsoft.com/pricing/details/private-link/)
1311
1. The exact number of private endpoints created depends on the [optional features](./deploy_features.md) used.
1412
1. [Private DNS Zones](https://azure.microsoft.com/pricing/details/dns/)
15-
1. (Optional, but recommended)[Azure Virtual Machines](https://azure.microsoft.com/pricing/details/virtual-machines/windows/)
16-
1. (Optional, but recommended)[Azure Bastion](https://azure.microsoft.com/pricing/details/azure-bastion/)
1713

1814
## Environment variables controlling private access
1915

@@ -23,13 +19,6 @@ Deploying with public access disabled adds additional cost to your deployment. P
2319
1. `AZURE_USE_PRIVATE_ENDPOINT`: Controls deployment of [private endpoints](https://learn.microsoft.com/azure/private-link/private-endpoint-overview) which connect Azure resources to the virtual network.
2420
1. When set to 'true', ensures private endpoints are deployed for connectivity even when `AZURE_PUBLIC_NETWORK_ACCESS` is 'Disabled'.
2521
1. Note that private endpoints do not make the chat app accessible from the internet. Connections must be initiated from inside the virtual network.
26-
1. `AZURE_PROVISION_VM`: Controls deployment of a [virtual machine](https://learn.microsoft.com/azure/virtual-machines/overview) and [Azure Bastion](https://learn.microsoft.com/azure/bastion/bastion-overview). Azure Bastion allows you to securely connect to the virtual machine, without being connected virtual network. Since the virtual machine is connected to the virtual network, you are able to access the chat app.
27-
1. You must set `AZURE_VM_USERNAME` and `AZURE_VM_PASSWORD` to provision the built-in administrator account with the virtual machine so you can log in through Azure Bastion.
28-
1. By default, a server version of Windows is used for the VM. If you need to [enroll your device in Microsoft Intune](https://learn.microsoft.com/mem/intune/user-help/enroll-windows-10-device), you should use a desktop version of Windows by setting the following environment variables:
29-
30-
* `azd env set AZURE_VM_OS_PUBLISHER MicrosoftWindowsDesktop`
31-
* `azd env set AZURE_VM_OS_OFFER Windows-11`
32-
* `azd env set AZURE_VM_OS_VERSION win11-23h2-pro`
3322

3423
## Recommended deployment strategy for private access
3524

@@ -46,10 +35,7 @@ Deploying with public access disabled adds additional cost to your deployment. P
4635

4736
```shell
4837
azd env set AZURE_PUBLIC_NETWORK_ACCESS Disabled
49-
azd env set AZURE_PROVISION_VM true # Optional but recommended
50-
azd env set AZURE_VM_USERNAME myadminusername # https://learn.microsoft.com/azure/virtual-machines/windows/faq#what-are-the-username-requirements-when-creating-a-vm-
51-
azd env set AZURE_VM_PASSWORD mypassword # https://learn.microsoft.com/azure/virtual-machines/windows/faq#what-are-the-password-requirements-when-creating-a-vm-
5238
azd provision
5339
```
5440

55-
1. Log into your new VM using [Azure Bastion](https://learn.microsoft.com/azure/bastion/tutorial-create-host-portal#connect). Validate the chat app is accessible from the virtual machine using a web browser.
41+
1. Log into your network using a tool like [Azure VPN Gateway](https://azure.microsoft.com/services/vpn-gateway/) and validate that you can connect to the chat app from inside the network.

infra/core/host/vm.bicep

Lines changed: 0 additions & 68 deletions
This file was deleted.

infra/core/networking/bastion.bicep

Lines changed: 0 additions & 24 deletions
This file was deleted.

infra/core/networking/ip.bicep

Lines changed: 0 additions & 15 deletions
This file was deleted.

infra/core/networking/nic.bicep

Lines changed: 0 additions & 23 deletions
This file was deleted.

infra/main.bicep

Lines changed: 0 additions & 29 deletions
Original file line numberDiff line numberDiff line change
@@ -151,17 +151,6 @@ param publicNetworkAccess string = 'Enabled'
151151
@description('Add a private endpoints for network connectivity')
152152
param usePrivateEndpoint bool = false
153153

154-
@description('Provision a VM to use for private endpoint connectivity')
155-
param provisionVm bool = false
156-
param vmUserName string = ''
157-
@secure()
158-
param vmPassword string = ''
159-
param vmOsVersion string = ''
160-
param vmOsPublisher string = ''
161-
param vmOsOffer string = ''
162-
@description('Size of the virtual machine.')
163-
param vmSize string = 'Standard_DS1_v2'
164-
165154
@description('Id of the user or app to assign application roles')
166155
param principalId string = ''
167156

@@ -716,10 +705,8 @@ module isolation 'network-isolation.bicep' = {
716705
params: {
717706
location: location
718707
tags: tags
719-
resourceToken: resourceToken
720708
vnetName: '${abbrs.virtualNetworks}${resourceToken}'
721709
appServicePlanName: appServicePlan.outputs.name
722-
provisionVm: provisionVm
723710
usePrivateEndpoint: usePrivateEndpoint
724711
}
725712
}
@@ -774,22 +761,6 @@ module privateEndpoints 'private-endpoints.bicep' = if (usePrivateEndpoint) {
774761
}
775762
}
776763

777-
module vm 'core/host/vm.bicep' = if (provisionVm && usePrivateEndpoint) {
778-
name: 'vm'
779-
scope: resourceGroup
780-
params: {
781-
name: '${abbrs.computeVirtualMachines}${resourceToken}'
782-
location: location
783-
adminUsername: vmUserName
784-
adminPassword: vmPassword
785-
nicId: isolation.outputs.nicId
786-
osVersion: vmOsVersion
787-
osPublisher: vmOsPublisher
788-
osOffer: vmOsOffer
789-
vmSize: vmSize
790-
}
791-
}
792-
793764
// Used to read index definitions (required when using authentication)
794765
// https://learn.microsoft.com/azure/search/search-security-rbac
795766
module searchReaderRoleBackend 'core/security/role.bicep' = if (useAuthentication) {

infra/main.parameters.json

Lines changed: 0 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -215,24 +215,6 @@
215215
"bypass": {
216216
"value": "${AZURE_NETWORK_BYPASS=AzureServices}"
217217
},
218-
"provisionVm": {
219-
"value": "${AZURE_PROVISION_VM=false}"
220-
},
221-
"vmUserName": {
222-
"value": "${AZURE_VM_USERNAME}"
223-
},
224-
"vmPassword": {
225-
"value": "${AZURE_VM_PASSWORD}"
226-
},
227-
"vmOsVersion": {
228-
"value": "${AZURE_VM_OS_VERSION=2022-datacenter-azure-edition}"
229-
},
230-
"vmOsPublisher": {
231-
"value": "${AZURE_VM_OS_PUBLISHER=MicrosoftWindowsServer}"
232-
},
233-
"vmOsOffer": {
234-
"value": "${AZURE_VM_OS_OFFER=WindowsServer}"
235-
},
236218
"useIntegratedVectorization": {
237219
"value": "${USE_FEATURE_INT_VECTORIZATION}"
238220
},

infra/network-isolation.bicep

Lines changed: 0 additions & 34 deletions
Original file line numberDiff line numberDiff line change
@@ -12,15 +12,8 @@ param tags object = {}
1212
@description('The name of an existing App Service Plan to connect to the VNet')
1313
param appServicePlanName string
1414

15-
@description('A unique token to append to the end of all resource names')
16-
param resourceToken string
17-
18-
param provisionVm bool = false
19-
2015
param usePrivateEndpoint bool = false
2116

22-
var abbrs = loadJsonContent('abbreviations.json')
23-
2417
resource appServicePlan 'Microsoft.Web/serverfarms@2022-03-01' existing = {
2518
name: appServicePlanName
2619
}
@@ -75,34 +68,7 @@ module vnet './core/networking/vnet.bicep' = if (usePrivateEndpoint) {
7568
}
7669
}
7770

78-
module nic 'core/networking/nic.bicep' = if (usePrivateEndpoint && provisionVm) {
79-
name: 'nic'
80-
params: {
81-
name: '${abbrs.networkNetworkInterfaces}${resourceToken}'
82-
location: location
83-
subnetId: usePrivateEndpoint ? vnet.outputs.vnetSubnets[3].id : ''
84-
}
85-
}
86-
87-
module publicIp 'core/networking/ip.bicep' = if (usePrivateEndpoint && provisionVm) {
88-
name: 'ip'
89-
params: {
90-
name: '${abbrs.networkPublicIPAddresses}${resourceToken}'
91-
location: location
92-
}
93-
}
94-
95-
module bastion 'core/networking/bastion.bicep' = if (usePrivateEndpoint && provisionVm) {
96-
name: 'bastion'
97-
params: {
98-
name: '${abbrs.networkBastionHosts}${resourceToken}'
99-
location: location
100-
subnetId: usePrivateEndpoint ? vnet.outputs.vnetSubnets[1].id : ''
101-
publicIPId: provisionVm ? publicIp.outputs.id : ''
102-
}
103-
}
10471

10572
output appSubnetId string = usePrivateEndpoint ? vnet.outputs.vnetSubnets[2].id : ''
10673
output backendSubnetId string = usePrivateEndpoint ? vnet.outputs.vnetSubnets[0].id : ''
10774
output vnetName string = usePrivateEndpoint ? vnet.outputs.name : ''
108-
output nicId string = provisionVm && usePrivateEndpoint ? nic.outputs.id : ''

0 commit comments

Comments
 (0)