共用方式為


Bastion Hosts - Create Or Update

建立或更新指定的 Bastion 主機。

PUT https://management.azure.com/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/bastionHosts/{bastionHostName}?api-version=2024-05-01

URI 參數

名稱 位於 必要 類型 Description
bastionHostName
path True

string

Bastion 主機的名稱。

resourceGroupName
path True

string

資源群組的名稱。

subscriptionId
path True

string

可唯一識別Microsoft Azure 訂用帳戶的訂用帳戶認證。 訂用帳戶標識碼會形成每個服務呼叫 URI 的一部分。

api-version
query True

string

用戶端 API 版本。

要求本文

名稱 類型 Description
id

string

資源標識碼。

location

string

資源位置。

properties.disableCopyPaste

boolean

啟用/停用 Bastion 主機資源的複製/貼上功能。

properties.dnsName

string

可存取防禦主機之端點的 FQDN。

properties.enableFileCopy

boolean

啟用/停用 Bastion 主機資源的檔案複製功能。

properties.enableIpConnect

boolean

啟用/停用 Bastion 主機資源的 IP Connect 功能。

properties.enableKerberos

boolean

啟用/停用 Bastion 主機資源的 Kerberos 功能。

properties.enablePrivateOnlyBastion

boolean

啟用/停用 Bastion 主機資源的僅限私人功能。

properties.enableSessionRecording

boolean

啟用/停用 Bastion 主機資源的會話錄製功能。

properties.enableShareableLink

boolean

啟用/停用 Bastion 主機資源的可共享連結。

properties.enableTunneling

boolean

啟用/停用 Bastion 主機資源的通道功能。

properties.ipConfigurations

BastionHostIPConfiguration[]

Bastion 主機資源的IP組態。

properties.networkAcls

NetworkAcls

properties.scaleUnits

integer

Bastion 主機資源的縮放單位。

properties.virtualNetwork

SubResource

僅限開發人員 Bastion 主機所需的現有虛擬網路參考。

sku

Sku

此 Bastion 主機的 SKU。

tags

object

資源標籤。

zones

string[]

可用性區域清單,表示資源需要來自何處。

回應

名稱 類型 Description
200 OK

BastionHost

更新成功。 此作業會傳回產生的 Bastion 主機資源。

201 Created

BastionHost

建立成功。 此作業會傳回產生的 Bastion 主機資源。

Other Status Codes

CloudError

描述作業失敗原因的錯誤回應。

安全性

azure_auth

Azure Active Directory OAuth2 Flow。

類型: oauth2
Flow: implicit
授權 URL: https://login.microsoftonline.com/common/oauth2/authorize

範圍

名稱 Description
user_impersonation 模擬您的用戶帳戶

範例

Create Bastion Host
Create Bastion Host With Private Only
Create Bastion Host With Zones
Create Developer Bastion Host

Create Bastion Host

範例要求

PUT https://management.azure.com/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/bastionHosts/bastionhosttenant?api-version=2024-05-01

{
  "properties": {
    "ipConfigurations": [
      {
        "name": "bastionHostIpConfiguration",
        "properties": {
          "subnet": {
            "id": "/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/virtualNetworks/vnet2/subnets/BastionHostSubnet"
          },
          "publicIPAddress": {
            "id": "/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/publicIPAddresses/pipName"
          }
        }
      }
    ]
  }
}

範例回覆

{
  "name": "bastionhost",
  "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": "Standard"
  },
  "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": false,
    "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"
          },
          "publicIPAddress": {
            "id": "/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/publicIPAddresses/pipName"
          }
        }
      }
    ]
  }
}
{
  "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": "Standard"
  },
  "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": false,
    "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"
          },
          "publicIPAddress": {
            "id": "/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/publicIPAddresses/pipName"
          }
        }
      }
    ]
  }
}

Create Bastion Host With Private Only

範例要求

PUT https://management.azure.com/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/bastionHosts/bastionhosttenant?api-version=2024-05-01

{
  "properties": {
    "enablePrivateOnlyBastion": true,
    "ipConfigurations": [
      {
        "name": "bastionHostIpConfiguration",
        "properties": {
          "subnet": {
            "id": "/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/virtualNetworks/vnet2/subnets/BastionHostSubnet"
          }
        }
      }
    ]
  }
}

範例回覆

{
  "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"
          }
        }
      }
    ]
  }
}
{
  "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"
          }
        }
      }
    ]
  }
}

Create Bastion Host With Zones

範例要求

PUT https://management.azure.com/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/bastionHosts/bastionhosttenant?api-version=2024-05-01

{
  "properties": {
    "ipConfigurations": [
      {
        "name": "bastionHostIpConfiguration",
        "properties": {
          "subnet": {
            "id": "/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/virtualNetworks/vnet2/subnets/BastionHostSubnet"
          },
          "publicIPAddress": {
            "id": "/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/publicIPAddresses/pipName"
          }
        }
      }
    ]
  }
}

範例回覆

{
  "name": "bastionhost",
  "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": "Standard"
  },
  "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": false,
    "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"
          },
          "publicIPAddress": {
            "id": "/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/publicIPAddresses/pipName"
          }
        }
      }
    ]
  }
}
{
  "name": "bastionhost'",
  "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": "Standard"
  },
  "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": false,
    "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"
          },
          "publicIPAddress": {
            "id": "/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/publicIPAddresses/pipName"
          }
        }
      }
    ]
  }
}

Create Developer Bastion Host

範例要求

PUT https://management.azure.com/subscriptions/subid/resourceGroups/rg2/providers/Microsoft.Network/bastionHosts/bastionhostdeveloper?api-version=2024-05-01

{
  "properties": {
    "virtualNetwork": {
      "id": "/subscriptions/subid/resourceGroups/rg2/providers/Microsoft.Network/virtualNetworks/vnet2"
    },
    "networkAcls": {
      "ipRules": [
        {
          "addressPrefix": "1.1.1.1/16"
        }
      ]
    },
    "ipConfigurations": []
  }
}

範例回覆

{
  "name": "bastionhostdeveloper",
  "id": "/subscriptions/subid/resourceGroups/rg2/providers/Microsoft.Network/bastionHosts/bastionhostdeveloper'",
  "type": "Microsoft.Network/bastionHosts",
  "etag": "w/\\00000000-0000-0000-0000-000000000000\\",
  "location": "West US",
  "sku": {
    "name": "Developer"
  },
  "properties": {
    "provisioningState": "Succeeded",
    "dnsName": "omnibrain.uswest.bastionglobal.azure.com",
    "virtualNetwork": {
      "id": "/subscriptions/subid/resourceGroups/rg2/providers/Microsoft.Network/virtualNetworks/vnet2"
    },
    "networkAcls": {
      "ipRules": [
        {
          "addressPrefix": "1.1.1.1/16"
        }
      ]
    },
    "ipConfigurations": []
  }
}
{
  "name": "bastionhostdeveloper'",
  "id": "/subscriptions/subid/resourceGroups/rg2/providers/Microsoft.Network/bastionHosts/bastionhostdeveloper'",
  "type": "Microsoft.Network/bastionHosts",
  "etag": "w/\\00000000-0000-0000-0000-000000000000\\",
  "location": "West US",
  "sku": {
    "name": "Developer"
  },
  "properties": {
    "provisioningState": "Succeeded",
    "dnsName": "omnibrain.uswest.bastionglobal.azure.com",
    "virtualNetwork": {
      "id": "/subscriptions/subid/resourceGroups/rg2/providers/Microsoft.Network/virtualNetworks/vnet2"
    },
    "networkAcls": {
      "ipRules": [
        {
          "addressPrefix": "1.1.1.1/16"
        }
      ]
    },
    "ipConfigurations": []
  }
}

定義

名稱 Description
BastionHost

Bastion 主機資源。

BastionHostIPConfiguration

Bastion 主機的IP組態。

BastionHostSkuName

這個 Bastion 主機的 SKU 名稱。

CloudError

來自服務的錯誤回應。

CloudErrorBody

來自服務的錯誤回應。

IPAllocationMethod

IP 位址配置方法。

IPRule
NetworkAcls
ProvisioningState

目前的布建狀態。

Sku

此 Bastion 主機的 SKU。

SubResource

另一個子資源的參考。

BastionHost

Bastion 主機資源。

名稱 類型 預設值 Description
etag

string

每當更新資源時變更的唯一隻讀字串。

id

string

資源標識碼。

location

string

資源位置。

name

string

資源名稱。

properties.disableCopyPaste

boolean

False

啟用/停用 Bastion 主機資源的複製/貼上功能。

properties.dnsName

string

可存取防禦主機之端點的 FQDN。

properties.enableFileCopy

boolean

False

啟用/停用 Bastion 主機資源的檔案複製功能。

properties.enableIpConnect

boolean

False

啟用/停用 Bastion 主機資源的 IP Connect 功能。

properties.enableKerberos

boolean

False

啟用/停用 Bastion 主機資源的 Kerberos 功能。

properties.enablePrivateOnlyBastion

boolean

False

啟用/停用 Bastion 主機資源的僅限私人功能。

properties.enableSessionRecording

boolean

False

啟用/停用 Bastion 主機資源的會話錄製功能。

properties.enableShareableLink

boolean

False

啟用/停用 Bastion 主機資源的可共享連結。

properties.enableTunneling

boolean

False

啟用/停用 Bastion 主機資源的通道功能。

properties.ipConfigurations

BastionHostIPConfiguration[]

Bastion 主機資源的IP組態。

properties.networkAcls

NetworkAcls

properties.provisioningState

ProvisioningState

防禦主機資源的布建狀態。

properties.scaleUnits

integer

Bastion 主機資源的縮放單位。

properties.virtualNetwork

SubResource

僅限開發人員 Bastion 主機所需的現有虛擬網路參考。

sku

Sku

此 Bastion 主機的 SKU。

tags

object

資源標籤。

type

string

資源類型。

zones

string[]

可用性區域清單,表示資源需要來自何處。

BastionHostIPConfiguration

Bastion 主機的IP組態。

名稱 類型 Description
etag

string

每當更新資源時變更的唯一隻讀字串。

id

string

資源標識碼。

name

string

資源群組內唯一的資源名稱。 此名稱可用來存取資源。

properties.privateIPAllocationMethod

IPAllocationMethod

私人IP配置方法。

properties.provisioningState

ProvisioningState

防禦主機 IP 組態資源的布建狀態。

properties.publicIPAddress

SubResource

PublicIP 資源的參考。 僅限私人防禦的 Null

properties.subnet

SubResource

子網資源的參考。

type

string

Ip 組態類型。

BastionHostSkuName

這個 Bastion 主機的 SKU 名稱。

名稱 類型 Description
Basic

string

Developer

string

Premium

string

Standard

string

CloudError

來自服務的錯誤回應。

名稱 類型 Description
error

CloudErrorBody

雲端錯誤本文。

CloudErrorBody

來自服務的錯誤回應。

名稱 類型 Description
code

string

錯誤的識別碼。 程序代碼是不變的,而且是要以程序設計方式取用。

details

CloudErrorBody[]

錯誤的其他詳細數據清單。

message

string

描述錯誤的訊息,適用於在使用者介面中顯示。

target

string

特定錯誤的目標。 例如,錯誤中的屬性名稱。

IPAllocationMethod

IP 位址配置方法。

名稱 類型 Description
Dynamic

string

Static

string

IPRule

名稱 類型 Description
addressPrefix

string

以 CIDR 格式指定 IP 或 IP 範圍。 只允許 IPV4 位址。

NetworkAcls

名稱 類型 Description
ipRules

IPRule[]

設定開發人員 Bastion 主機的 IP ACL 規則。

ProvisioningState

目前的布建狀態。

名稱 類型 Description
Deleting

string

Failed

string

Succeeded

string

Updating

string

Sku

此 Bastion 主機的 SKU。

名稱 類型 預設值 Description
name

BastionHostSkuName

Standard

這個 Bastion 主機的 SKU 名稱。

SubResource

另一個子資源的參考。

名稱 類型 Description
id

string

資源標識碼。