From ffde1199ec32615000ec386115fdfff3d4e8a304 Mon Sep 17 00:00:00 2001 From: Leo Liu Date: Tue, 15 Oct 2024 14:03:20 -0400 Subject: [PATCH] add private only feature to azure bastion service (#30807) * add private only feature to azure bastion service * fix Swagger PrettierCheck * fix the swagger PrettierCheck * modify the api version * modify file name --------- Co-authored-by: Leo Liu (from Dev Box) --- .../stable/2024-05-01/bastionHost.json | 17 ++- .../examples/BastionHostDelete.json | 1 - .../examples/BastionHostDeveloperDelete.json | 1 - .../examples/BastionHostDeveloperGet.json | 1 - .../examples/BastionHostDeveloperPut.json | 1 - .../2024-05-01/examples/BastionHostGet.json | 2 +- .../BastionHostGetWithPrivateOnly.json | 53 +++++++++ .../examples/BastionHostGetWithZones.json | 8 +- .../BastionHostListByResourceGroup.json | 41 ++++++- .../BastionHostListBySubscription.json | 41 ++++++- .../2024-05-01/examples/BastionHostPatch.json | 4 +- .../2024-05-01/examples/BastionHostPut.json | 7 +- .../BastionHostPutWithPrivateOnly.json | 107 ++++++++++++++++++ .../examples/BastionHostPutWithZones.json | 3 +- 14 files changed, 266 insertions(+), 21 deletions(-) create mode 100644 specification/network/resource-manager/Microsoft.Network/stable/2024-05-01/examples/BastionHostGetWithPrivateOnly.json create mode 100644 specification/network/resource-manager/Microsoft.Network/stable/2024-05-01/examples/BastionHostPutWithPrivateOnly.json diff --git a/specification/network/resource-manager/Microsoft.Network/stable/2024-05-01/bastionHost.json b/specification/network/resource-manager/Microsoft.Network/stable/2024-05-01/bastionHost.json index 96d34bfd6efe..f72e631fdfcc 100644 --- a/specification/network/resource-manager/Microsoft.Network/stable/2024-05-01/bastionHost.json +++ b/specification/network/resource-manager/Microsoft.Network/stable/2024-05-01/bastionHost.json @@ -128,6 +128,9 @@ }, "Get Bastion Host With Zones": { "$ref": "./examples/BastionHostGetWithZones.json" + }, + "Get Bastion Host With Private Only": { + "$ref": "./examples/BastionHostGetWithPrivateOnly.json" } } }, @@ -187,6 +190,9 @@ "Create Bastion Host With Zones": { "$ref": "./examples/BastionHostPutWithZones.json" }, + "Create Bastion Host With Private Only": { + "$ref": "./examples/BastionHostPutWithPrivateOnly.json" + }, "Create Developer Bastion Host": { "$ref": "./examples/BastionHostDeveloperPut.json" } @@ -681,7 +687,7 @@ }, "publicIPAddress": { "$ref": "./network.json#/definitions/SubResource", - "description": "Reference of the PublicIP resource." + "description": "Reference of the PublicIP resource. Null for private only bastion" }, "provisioningState": { "readOnly": true, @@ -694,8 +700,7 @@ } }, "required": [ - "subnet", - "publicIPAddress" + "subnet" ], "description": "Properties of IP configuration of an Bastion Host." }, @@ -803,6 +808,11 @@ "type": "boolean", "default": false, "description": "Enable/Disable Session Recording feature of the Bastion Host resource." + }, + "enablePrivateOnlyBastion": { + "type": "boolean", + "default": false, + "description": "Enable/Disable Private Only feature of the Bastion Host resource." } }, "description": "Properties of the Bastion Host." @@ -1112,4 +1122,3 @@ } } } - diff --git a/specification/network/resource-manager/Microsoft.Network/stable/2024-05-01/examples/BastionHostDelete.json b/specification/network/resource-manager/Microsoft.Network/stable/2024-05-01/examples/BastionHostDelete.json index 31fc12363925..2f9f769fae6e 100644 --- a/specification/network/resource-manager/Microsoft.Network/stable/2024-05-01/examples/BastionHostDelete.json +++ b/specification/network/resource-manager/Microsoft.Network/stable/2024-05-01/examples/BastionHostDelete.json @@ -15,4 +15,3 @@ "204": {} } } - diff --git a/specification/network/resource-manager/Microsoft.Network/stable/2024-05-01/examples/BastionHostDeveloperDelete.json b/specification/network/resource-manager/Microsoft.Network/stable/2024-05-01/examples/BastionHostDeveloperDelete.json index 713b1192aa03..7f2f0edf2e06 100644 --- a/specification/network/resource-manager/Microsoft.Network/stable/2024-05-01/examples/BastionHostDeveloperDelete.json +++ b/specification/network/resource-manager/Microsoft.Network/stable/2024-05-01/examples/BastionHostDeveloperDelete.json @@ -15,4 +15,3 @@ "204": {} } } - diff --git a/specification/network/resource-manager/Microsoft.Network/stable/2024-05-01/examples/BastionHostDeveloperGet.json b/specification/network/resource-manager/Microsoft.Network/stable/2024-05-01/examples/BastionHostDeveloperGet.json index e84957e763fa..f79b78f426a6 100644 --- a/specification/network/resource-manager/Microsoft.Network/stable/2024-05-01/examples/BastionHostDeveloperGet.json +++ b/specification/network/resource-manager/Microsoft.Network/stable/2024-05-01/examples/BastionHostDeveloperGet.json @@ -35,4 +35,3 @@ } } } - diff --git a/specification/network/resource-manager/Microsoft.Network/stable/2024-05-01/examples/BastionHostDeveloperPut.json b/specification/network/resource-manager/Microsoft.Network/stable/2024-05-01/examples/BastionHostDeveloperPut.json index ddf8adea2579..6c2286a75734 100644 --- a/specification/network/resource-manager/Microsoft.Network/stable/2024-05-01/examples/BastionHostDeveloperPut.json +++ b/specification/network/resource-manager/Microsoft.Network/stable/2024-05-01/examples/BastionHostDeveloperPut.json @@ -80,4 +80,3 @@ } } } - diff --git a/specification/network/resource-manager/Microsoft.Network/stable/2024-05-01/examples/BastionHostGet.json b/specification/network/resource-manager/Microsoft.Network/stable/2024-05-01/examples/BastionHostGet.json index 8adc88470326..b604cdc39be0 100644 --- a/specification/network/resource-manager/Microsoft.Network/stable/2024-05-01/examples/BastionHostGet.json +++ b/specification/network/resource-manager/Microsoft.Network/stable/2024-05-01/examples/BastionHostGet.json @@ -30,6 +30,7 @@ "enableShareableLink": false, "enableKerberos": false, "enableSessionRecording": false, + "enablePrivateOnlyBastion": false, "ipConfigurations": [ { "name": "bastionHostIpConfiguration", @@ -53,4 +54,3 @@ } } } - diff --git a/specification/network/resource-manager/Microsoft.Network/stable/2024-05-01/examples/BastionHostGetWithPrivateOnly.json b/specification/network/resource-manager/Microsoft.Network/stable/2024-05-01/examples/BastionHostGetWithPrivateOnly.json new file mode 100644 index 000000000000..2ec3a36e94d6 --- /dev/null +++ b/specification/network/resource-manager/Microsoft.Network/stable/2024-05-01/examples/BastionHostGetWithPrivateOnly.json @@ -0,0 +1,53 @@ +{ + "parameters": { + "api-version": "2024-05-01", + "subscriptionId": "subid", + "resourceGroupName": "rg1", + "bastionHostName": "bastionhosttenant" + }, + "responses": { + "200": { + "body": { + "name": "bastionhosttenant", + "id": "/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/bastionHosts/bastionhosttenant'", + "type": "Microsoft.Network/bastionHosts", + "etag": "w/\\00000000-0000-0000-0000-000000000000\\", + "location": "West US", + "tags": { + "key1": "value1" + }, + "sku": { + "name": "Premium" + }, + "zones": [], + "properties": { + "provisioningState": "Succeeded", + "dnsName": "bst-9d89d361-100e-4c01-b92d-466548c476dc.bastion.azure.com", + "scaleUnits": 2, + "disableCopyPaste": false, + "enableTunneling": false, + "enableIpConnect": false, + "enableShareableLink": false, + "enableKerberos": false, + "enableSessionRecording": false, + "enablePrivateOnlyBastion": true, + "ipConfigurations": [ + { + "name": "bastionHostIpConfiguration", + "id": "/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/bastionHosts/bastionhosttenant/bastionHostIpConfigurations/bastionHostIpConfiguration", + "etag": "w/\\00000000-0000-0000-0000-000000000000\\", + "type": "Microsoft.Network/bastionHosts/bastionHostIpConfigurations", + "properties": { + "provisioningState": "Succeeded", + "privateIPAllocationMethod": "Dynamic", + "subnet": { + "id": "/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/virtualNetworks/vnet2/subnets/BastionHostSubnet" + } + } + } + ] + } + } + } + } +} diff --git a/specification/network/resource-manager/Microsoft.Network/stable/2024-05-01/examples/BastionHostGetWithZones.json b/specification/network/resource-manager/Microsoft.Network/stable/2024-05-01/examples/BastionHostGetWithZones.json index 7d1fffeb2aa6..3a9fcaf79e5c 100644 --- a/specification/network/resource-manager/Microsoft.Network/stable/2024-05-01/examples/BastionHostGetWithZones.json +++ b/specification/network/resource-manager/Microsoft.Network/stable/2024-05-01/examples/BastionHostGetWithZones.json @@ -3,13 +3,13 @@ "api-version": "2024-05-01", "subscriptionId": "subid", "resourceGroupName": "rg1", - "bastionHostName": "bastionhosttenant'" + "bastionHostName": "bastionhosttenant" }, "responses": { "200": { "body": { - "name": "bastionhost'", - "id": "/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/bastionHosts/bastionhosttenant'", + "name": "bastionhosttenant", + "id": "/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/bastionHosts/bastionhosttenant", "type": "Microsoft.Network/bastionHosts", "etag": "w/\\00000000-0000-0000-0000-000000000000\\", "location": "West US", @@ -33,6 +33,7 @@ "enableShareableLink": false, "enableKerberos": false, "enableSessionRecording": false, + "enablePrivateOnlyBastion": false, "ipConfigurations": [ { "name": "bastionHostIpConfiguration", @@ -56,4 +57,3 @@ } } } - diff --git a/specification/network/resource-manager/Microsoft.Network/stable/2024-05-01/examples/BastionHostListByResourceGroup.json b/specification/network/resource-manager/Microsoft.Network/stable/2024-05-01/examples/BastionHostListByResourceGroup.json index 2b718572d7f4..2da77dbfc5e8 100644 --- a/specification/network/resource-manager/Microsoft.Network/stable/2024-05-01/examples/BastionHostListByResourceGroup.json +++ b/specification/network/resource-manager/Microsoft.Network/stable/2024-05-01/examples/BastionHostListByResourceGroup.json @@ -28,6 +28,7 @@ "enableShareableLink": false, "enableKerberos": false, "enableSessionRecording": false, + "enablePrivateOnlyBastion": false, "ipConfigurations": [ { "name": "bastionHostIpConfiguration", @@ -68,6 +69,7 @@ "enableShareableLink": false, "enableKerberos": false, "enableSessionRecording": true, + "enablePrivateOnlyBastion": false, "ipConfigurations": [ { "name": "bastionHostIpConfiguration", @@ -87,10 +89,47 @@ } ] } + }, + { + "name": "bastionhost3", + "id": "/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/bastionHosts/bastionhost3", + "type": "Microsoft.Network/bastionHosts", + "etag": "w/\\00000000-0000-0000-0000-000000000000\\", + "location": "West US", + "sku": { + "name": "Premium" + }, + "zones": [], + "properties": { + "provisioningState": "Succeeded", + "dnsName": "bst-9d89d361-100e-4c01-b92d-466548c476dc.bastion.azure.com", + "scaleUnits": 2, + "disableCopyPaste": false, + "enableTunneling": false, + "enableIpConnect": false, + "enableShareableLink": false, + "enableKerberos": false, + "enableSessionRecording": false, + "enablePrivateOnlyBastion": true, + "ipConfigurations": [ + { + "name": "bastionHostIpConfiguration", + "id": "/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/bastionHosts/bastionhost3/bastionHostIpConfigurations/IpConf", + "etag": "w/\\00000000-0000-0000-0000-000000000000\\", + "type": "Microsoft.Network/bastionHosts/bastionHostIpConfigurations", + "properties": { + "provisioningState": "Succeeded", + "privateIPAllocationMethod": "Dynamic", + "subnet": { + "id": "/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/virtualNetworks/vnet3/subnets/AzureBastionSubnet" + } + } + } + ] + } } ] } } } } - diff --git a/specification/network/resource-manager/Microsoft.Network/stable/2024-05-01/examples/BastionHostListBySubscription.json b/specification/network/resource-manager/Microsoft.Network/stable/2024-05-01/examples/BastionHostListBySubscription.json index 729f7b5f3f93..63f63871eb31 100644 --- a/specification/network/resource-manager/Microsoft.Network/stable/2024-05-01/examples/BastionHostListBySubscription.json +++ b/specification/network/resource-manager/Microsoft.Network/stable/2024-05-01/examples/BastionHostListBySubscription.json @@ -27,6 +27,7 @@ "enableShareableLink": false, "enableKerberos": false, "enableSessionRecording": false, + "enablePrivateOnlyBastion": false, "ipConfigurations": [ { "name": "bastionHostIpConfiguration", @@ -92,6 +93,7 @@ "enableShareableLink": false, "enableKerberos": false, "enableSessionRecording": true, + "enablePrivateOnlyBastion": false, "ipConfigurations": [ { "name": "bastionHostIpConfiguration", @@ -111,10 +113,47 @@ } ] } + }, + { + "name": "bastionhost4", + "id": "/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/bastionHosts/bastionhost4", + "type": "Microsoft.Network/bastionHosts", + "etag": "w/\\00000000-0000-0000-0000-000000000000\\", + "location": "West US", + "sku": { + "name": "Premium" + }, + "zones": [], + "properties": { + "provisioningState": "Succeeded", + "dnsName": "bst-9d89d361-100e-4c01-b92d-466548c476dc.bastion.azure.com", + "scaleUnits": 2, + "disableCopyPaste": false, + "enableTunneling": false, + "enableIpConnect": false, + "enableShareableLink": false, + "enableKerberos": false, + "enableSessionRecording": false, + "enablePrivateOnlyBastion": true, + "ipConfigurations": [ + { + "name": "bastionHostIpConfiguration", + "id": "/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/bastionHosts/bastionhost4/bastionHostIpConfigurations/IpConf", + "etag": "w/\\00000000-0000-0000-0000-000000000000\\", + "type": "Microsoft.Network/bastionHosts/bastionHostIpConfigurations", + "properties": { + "provisioningState": "Succeeded", + "privateIPAllocationMethod": "Dynamic", + "subnet": { + "id": "/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/virtualNetworks/vnet4/subnets/AzureBastionSubnet" + } + } + } + ] + } } ] } } } } - diff --git a/specification/network/resource-manager/Microsoft.Network/stable/2024-05-01/examples/BastionHostPatch.json b/specification/network/resource-manager/Microsoft.Network/stable/2024-05-01/examples/BastionHostPatch.json index 9f1256406209..c440e731a0f3 100644 --- a/specification/network/resource-manager/Microsoft.Network/stable/2024-05-01/examples/BastionHostPatch.json +++ b/specification/network/resource-manager/Microsoft.Network/stable/2024-05-01/examples/BastionHostPatch.json @@ -20,7 +20,7 @@ "200": { "body": { "name": "bastionhosttenant", - "id": "/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/bastionHosts/bastionhosttenant'", + "id": "/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/bastionHosts/bastionhosttenant", "type": "Microsoft.Network/bastionHosts", "etag": "w/\\00000000-0000-0000-0000-000000000000\\", "location": "West US", @@ -38,6 +38,7 @@ "enableShareableLink": false, "enableKerberos": false, "enableSessionRecording": false, + "enablePrivateOnlyBastion": false, "ipConfigurations": [ { "name": "bastionHostIpConfiguration", @@ -64,4 +65,3 @@ } } } - diff --git a/specification/network/resource-manager/Microsoft.Network/stable/2024-05-01/examples/BastionHostPut.json b/specification/network/resource-manager/Microsoft.Network/stable/2024-05-01/examples/BastionHostPut.json index 5b0a852a6e4c..197b05744d3a 100644 --- a/specification/network/resource-manager/Microsoft.Network/stable/2024-05-01/examples/BastionHostPut.json +++ b/specification/network/resource-manager/Microsoft.Network/stable/2024-05-01/examples/BastionHostPut.json @@ -47,6 +47,7 @@ "enableShareableLink": false, "enableKerberos": false, "enableSessionRecording": false, + "enablePrivateOnlyBastion": false, "ipConfigurations": [ { "name": "bastionHostIpConfiguration", @@ -70,8 +71,8 @@ }, "201": { "body": { - "name": "bastionhost'", - "id": "/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/bastionHosts/bastionhosttenant'", + "name": "bastionhosttenant'", + "id": "/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/bastionHosts/bastionhosttenant", "type": "Microsoft.Network/bastionHosts", "etag": "w/\\00000000-0000-0000-0000-000000000000\\", "location": "West US", @@ -88,6 +89,7 @@ "enableShareableLink": false, "enableKerberos": false, "enableSessionRecording": false, + "enablePrivateOnlyBastion": false, "ipConfigurations": [ { "name": "bastionHostIpConfiguration", @@ -111,4 +113,3 @@ } } } - diff --git a/specification/network/resource-manager/Microsoft.Network/stable/2024-05-01/examples/BastionHostPutWithPrivateOnly.json b/specification/network/resource-manager/Microsoft.Network/stable/2024-05-01/examples/BastionHostPutWithPrivateOnly.json new file mode 100644 index 000000000000..6f10cad017d8 --- /dev/null +++ b/specification/network/resource-manager/Microsoft.Network/stable/2024-05-01/examples/BastionHostPutWithPrivateOnly.json @@ -0,0 +1,107 @@ +{ + "parameters": { + "api-version": "2024-05-01", + "subscriptionId": "subid", + "resourceGroupName": "rg1", + "bastionHostName": "bastionhosttenant", + "sku": { + "name": "Premium" + }, + "zones": [], + "parameters": { + "properties": { + "enablePrivateOnlyBastion": true, + "ipConfigurations": [ + { + "name": "bastionHostIpConfiguration", + "properties": { + "subnet": { + "id": "/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/virtualNetworks/vnet2/subnets/BastionHostSubnet" + } + } + } + ] + } + } + }, + "responses": { + "200": { + "body": { + "name": "bastionhosttenant", + "id": "/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/bastionHosts/bastionhosttenant", + "type": "Microsoft.Network/bastionHosts", + "etag": "w/\\00000000-0000-0000-0000-000000000000\\", + "location": "West US", + "sku": { + "name": "Premium" + }, + "properties": { + "provisioningState": "Succeeded", + "dnsName": "bst-9d89d361-100e-4c01-b92d-466548c476dc.bastion.azure.com", + "scaleUnits": 2, + "disableCopyPaste": false, + "enableTunneling": false, + "enableIpConnect": false, + "enableShareableLink": false, + "enableKerberos": false, + "enableSessionRecording": false, + "enablePrivateOnlyBastion": true, + "ipConfigurations": [ + { + "name": "bastionHostIpConfiguration", + "id": "/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/bastionHosts/bastionhosttenant/bastionHostIpConfigurations/bastionHostIpConfiguration", + "etag": "w/\\00000000-0000-0000-0000-000000000000\\", + "type": "Microsoft.Network/bastionHosts/bastionHostIpConfigurations", + "properties": { + "provisioningState": "Succeeded", + "privateIPAllocationMethod": "Dynamic", + "subnet": { + "id": "/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/virtualNetworks/vnet2/subnets/BastionHostSubnet" + } + } + } + ] + } + } + }, + "201": { + "body": { + "name": "bastionhosttenant", + "id": "/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/bastionHosts/bastionhosttenant", + "type": "Microsoft.Network/bastionHosts", + "etag": "w/\\00000000-0000-0000-0000-000000000000\\", + "location": "West US", + "sku": { + "name": "Premium" + }, + "properties": { + "provisioningState": "Succeeded", + "dnsName": "bst-9d89d361-100e-4c01-b92d-466548c476dc.bastion.azure.com", + "scaleUnits": 2, + "disableCopyPaste": false, + "enableTunneling": false, + "enableIpConnect": false, + "enableShareableLink": false, + "enableKerberos": false, + "enableSessionRecording": false, + "enablePrivateOnlyBastion": true, + "ipConfigurations": [ + { + "name": "bastionHostIpConfiguration", + "id": "/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/bastionHosts/bastionhosttenant/bastionHostIpConfigurations/bastionHostIpConfiguration", + "etag": "w/\\00000000-0000-0000-0000-000000000000\\", + "type": "Microsoft.Network/bastionHosts/bastionHostIpConfigurations", + "properties": { + "provisioningState": "Succeeded", + "privateIPAllocationMethod": "Dynamic", + "subnet": { + "id": "/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/virtualNetworks/vnet2/subnets/BastionHostSubnet" + } + } + } + ] + } + } + } + } +} diff --git a/specification/network/resource-manager/Microsoft.Network/stable/2024-05-01/examples/BastionHostPutWithZones.json b/specification/network/resource-manager/Microsoft.Network/stable/2024-05-01/examples/BastionHostPutWithZones.json index f64fbd0d4e1b..1d438ee90757 100644 --- a/specification/network/resource-manager/Microsoft.Network/stable/2024-05-01/examples/BastionHostPutWithZones.json +++ b/specification/network/resource-manager/Microsoft.Network/stable/2024-05-01/examples/BastionHostPutWithZones.json @@ -50,6 +50,7 @@ "enableShareableLink": false, "enableKerberos": false, "enableSessionRecording": false, + "enablePrivateOnlyBastion": false, "ipConfigurations": [ { "name": "bastionHostIpConfiguration", @@ -91,6 +92,7 @@ "enableShareableLink": false, "enableKerberos": false, "enableSessionRecording": false, + "enablePrivateOnlyBastion": false, "ipConfigurations": [ { "name": "bastionHostIpConfiguration", @@ -114,4 +116,3 @@ } } } -