---
title: "Creates or updates a Gateway resource."
method: PUT
path: "/Resources/Gateways/{gatewayResourceName}"
tags: ["MeshGateways"]
---

# Creates or updates a Gateway resource.

`PUT /Resources/Gateways/{gatewayResourceName}`

Creates a Gateway resource with the specified name, description and properties. If Gateway resource with the same name exists, then it is updated with the specified description and properties. Use Gateway resource to provide public connectivity to application services.

## Path parameters

- `gatewayResourceName` string, required

## Query parameters

- `api-version` '6.4-preview', required

## Request body

- GatewayResourceDescription — This type describes a gateway resource.
  - `name` string, required — Name of the Gateway resource.
  - `properties` GatewayProperties, required — Describes properties of a gateway resource.
    - `description` string — User readable description of the gateway.
    - `sourceNetwork` NetworkRef, required — Describes a network reference in a service.
      - `name` string — Name of the network
      - `endpointRefs` EndpointRef[] — A list of endpoints that are exposed on this network.
        - `name` string — Name of the endpoint.
    - `destinationNetwork` NetworkRef, required — Describes a network reference in a service.
      - `name` string — Name of the network
      - `endpointRefs` EndpointRef[] — A list of endpoints that are exposed on this network.
        - `name` string — Name of the endpoint.
    - `tcp` TcpConfig[] — Configuration for tcp connectivity for this gateway.
      - `name` string, required — tcp gateway config name.
      - `port` integer, required — Specifies the port at which the service endpoint below needs to be exposed.
      - `destination` GatewayDestination, required — Describes destination endpoint for routing traffic.
        - `applicationName` string, required — Name of the service fabric Mesh application.
        - `serviceName` string, required — service that contains the endpoint.
        - `endpointName` string, required — name of the endpoint in the service.
    - `http` HttpConfig[] — Configuration for http connectivity for this gateway.
      - `name` string, required — http gateway config name.
      - `port` integer, required — Specifies the port at which the service endpoint below needs to be exposed.
      - `hosts` HttpHostConfig[], required — description for routing.
        - `name` string, required — http hostname config name.
        - `routes` HttpRouteConfig[], required — Route information to use for routing. Routes are processed in the order they are specified. Specify routes that are more specific before routes that can handle general cases.
          - `name` string, required — http route name.
          - `match` HttpRouteMatchRule, required — Describes a rule for http route matching.
            - `path` HttpRouteMatchPath, required — Path to match for routing.
              - …
            - `headers` HttpRouteMatchHeader[] — headers and their values to match in request.
              - …
          - `destination` GatewayDestination, required — Describes destination endpoint for routing traffic.
            - `applicationName` string, required — Name of the service fabric Mesh application.
            - `serviceName` string, required — service that contains the endpoint.
            - `endpointName` string, required — name of the endpoint in the service.
    - `status` 'Unknown' | 'Ready' | 'Upgrading' | 'Creating' | 'Deleting' | 'Failed' — Status of the resource.
    - `statusDetails` string — Gives additional information about the current status of the gateway.
    - `ipAddress` string — IP address of the gateway. This is populated in the response and is ignored for incoming requests.

## Response `200`

OK

- GatewayResourceDescription — This type describes a gateway resource.
  - `name` string, required — Name of the Gateway resource.
  - `properties` GatewayProperties, required — Describes properties of a gateway resource.
    - `description` string — User readable description of the gateway.
    - `sourceNetwork` NetworkRef, required — Describes a network reference in a service.
      - `name` string — Name of the network
      - `endpointRefs` EndpointRef[] — A list of endpoints that are exposed on this network.
        - `name` string — Name of the endpoint.
    - `destinationNetwork` NetworkRef, required — Describes a network reference in a service.
      - `name` string — Name of the network
      - `endpointRefs` EndpointRef[] — A list of endpoints that are exposed on this network.
        - `name` string — Name of the endpoint.
    - `tcp` TcpConfig[] — Configuration for tcp connectivity for this gateway.
      - `name` string, required — tcp gateway config name.
      - `port` integer, required — Specifies the port at which the service endpoint below needs to be exposed.
      - `destination` GatewayDestination, required — Describes destination endpoint for routing traffic.
        - `applicationName` string, required — Name of the service fabric Mesh application.
        - `serviceName` string, required — service that contains the endpoint.
        - `endpointName` string, required — name of the endpoint in the service.
    - `http` HttpConfig[] — Configuration for http connectivity for this gateway.
      - `name` string, required — http gateway config name.
      - `port` integer, required — Specifies the port at which the service endpoint below needs to be exposed.
      - `hosts` HttpHostConfig[], required — description for routing.
        - `name` string, required — http hostname config name.
        - `routes` HttpRouteConfig[], required — Route information to use for routing. Routes are processed in the order they are specified. Specify routes that are more specific before routes that can handle general cases.
          - `name` string, required — http route name.
          - `match` HttpRouteMatchRule, required — Describes a rule for http route matching.
            - `path` HttpRouteMatchPath, required — Path to match for routing.
              - …
            - `headers` HttpRouteMatchHeader[] — headers and their values to match in request.
              - …
          - `destination` GatewayDestination, required — Describes destination endpoint for routing traffic.
            - `applicationName` string, required — Name of the service fabric Mesh application.
            - `serviceName` string, required — service that contains the endpoint.
            - `endpointName` string, required — name of the endpoint in the service.
    - `status` 'Unknown' | 'Ready' | 'Upgrading' | 'Creating' | 'Deleting' | 'Failed' — Status of the resource.
    - `statusDetails` string — Gives additional information about the current status of the gateway.
    - `ipAddress` string — IP address of the gateway. This is populated in the response and is ignored for incoming requests.

## Other responses

- `201` — Created
- `202` — Accepted
- `default` — Error

---

[API](https://skmtc.net/azure/apis/service-fabric-client-apis.md) · [All operations](https://skmtc.net/azure/apis/service-fabric-client-apis/llms.txt) · [OpenAPI document](https://skmtc-service-staging.skmtc.workers.dev/v1/apis/azure/service-fabric-client-apis/versions/6df9f2f4d542/schema)
