Создание или обновление серверного компонента.
PUT https://management.azure.com/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiManagement/service/{serviceName}/backends/{backendId}?api-version=2022-08-01
Параметры URI
Имя |
В |
Обязательно |
Тип |
Описание |
backendId
|
path |
True
|
string
|
Идентификатор сущности Backend. Должен быть уникальным в текущем экземпляре службы Управление API.
|
resourceGroupName
|
path |
True
|
string
|
Имя группы ресурсов. Регистр букв в имени не учитывается.
|
serviceName
|
path |
True
|
string
|
Имя службы Управление API.
Шаблон регулярного выражения: ^[a-zA-Z](?:[a-zA-Z0-9-]*[a-zA-Z0-9])?$
|
subscriptionId
|
path |
True
|
string
|
Идентификатор целевой подписки.
|
api-version
|
query |
True
|
string
|
Версия API, используемая для данной операции.
|
Имя |
Обязательно |
Тип |
Описание |
If-Match
|
|
string
|
ETag сущности. Не требуется при создании сущности, но требуется при обновлении сущности.
|
Текст запроса
Имя |
Обязательно |
Тип |
Описание |
properties.protocol
|
True
|
BackendProtocol
|
Серверный протокол связи.
|
properties.url
|
True
|
string
|
URL-адрес среды выполнения серверной части.
|
properties.credentials
|
|
BackendCredentialsContract
|
Свойства контракта учетных данных серверной части
|
properties.description
|
|
string
|
Описание серверной части.
|
properties.properties
|
|
BackendProperties
|
Контракт свойств серверной части
|
properties.proxy
|
|
BackendProxyContract
|
Свойства контракта внутреннего шлюза
|
properties.resourceId
|
|
string
|
URI управления ресурсом во внешней системе. Этот URL-адрес может быть идентификатором ресурса Arm приложений логики, приложений-функций или приложений API.
|
properties.title
|
|
string
|
Название серверной части.
|
properties.tls
|
|
BackendTlsProperties
|
Свойства TLS серверной части
|
Ответы
Имя |
Тип |
Описание |
200 OK
|
BackendContract
|
Существующая серверная часть успешно обновлена.
Заголовки
ETag: string
|
201 Created
|
BackendContract
|
Серверная часть успешно создана.
Заголовки
ETag: string
|
Other Status Codes
|
ErrorResponse
|
Ответ об ошибке, описывающий причину сбоя операции.
|
Безопасность
azure_auth
Поток OAuth2 в Azure Active Directory.
Тип:
oauth2
Flow:
implicit
URL-адрес авторизации:
https://login.microsoftonline.com/common/oauth2/authorize
Области
Имя |
Описание |
user_impersonation
|
олицетворения учетной записи пользователя
|
Примеры
ApiManagementCreateBackendProxyBackend
Образец запроса
PUT https://management.azure.com/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.ApiManagement/service/apimService1/backends/proxybackend?api-version=2022-08-01
{
"properties": {
"description": "description5308",
"url": "https://backendname2644/",
"protocol": "http",
"tls": {
"validateCertificateChain": true,
"validateCertificateName": true
},
"proxy": {
"url": "http://192.168.1.1:8080",
"username": "Contoso\\admin",
"password": "<password>"
},
"credentials": {
"query": {
"sv": [
"xx",
"bb",
"cc"
]
},
"header": {
"x-my-1": [
"val1",
"val2"
]
},
"authorization": {
"scheme": "Basic",
"parameter": "opensesma"
}
}
}
}
import com.azure.resourcemanager.apimanagement.models.BackendAuthorizationHeaderCredentials;
import com.azure.resourcemanager.apimanagement.models.BackendCredentialsContract;
import com.azure.resourcemanager.apimanagement.models.BackendProtocol;
import com.azure.resourcemanager.apimanagement.models.BackendProxyContract;
import com.azure.resourcemanager.apimanagement.models.BackendTlsProperties;
import java.util.Arrays;
import java.util.HashMap;
import java.util.Map;
/** Samples for Backend CreateOrUpdate. */
public final class Main {
/*
* x-ms-original-file: specification/apimanagement/resource-manager/Microsoft.ApiManagement/stable/2022-08-01/examples/ApiManagementCreateBackendProxyBackend.json
*/
/**
* Sample code: ApiManagementCreateBackendProxyBackend.
*
* @param manager Entry point to ApiManagementManager.
*/
public static void apiManagementCreateBackendProxyBackend(
com.azure.resourcemanager.apimanagement.ApiManagementManager manager) {
manager
.backends()
.define("proxybackend")
.withExistingService("rg1", "apimService1")
.withUrl("https://backendname2644/")
.withProtocol(BackendProtocol.HTTP)
.withDescription("description5308")
.withCredentials(
new BackendCredentialsContract()
.withQuery(mapOf("sv", Arrays.asList("xx", "bb", "cc")))
.withHeaderProperty(mapOf("x-my-1", Arrays.asList("val1", "val2")))
.withAuthorization(
new BackendAuthorizationHeaderCredentials().withScheme("Basic").withParameter("opensesma")))
.withProxy(
new BackendProxyContract()
.withUrl("http://192.168.1.1:8080")
.withUsername("Contoso\\admin")
.withPassword("fakeTokenPlaceholder"))
.withTls(new BackendTlsProperties().withValidateCertificateChain(true).withValidateCertificateName(true))
.create();
}
// Use "Map.of" if available
@SuppressWarnings("unchecked")
private static <T> Map<String, T> mapOf(Object... inputs) {
Map<String, T> map = new HashMap<>();
for (int i = 0; i < inputs.length; i += 2) {
String key = (String) inputs[i];
T value = (T) inputs[i + 1];
map.put(key, value);
}
return map;
}
}
To use the Azure SDK library in your project, see this documentation. To provide feedback on this code sample, open a GitHub issue
from typing import Any, IO, Union
from azure.identity import DefaultAzureCredential
from azure.mgmt.apimanagement import ApiManagementClient
"""
# PREREQUISITES
pip install azure-identity
pip install azure-mgmt-apimanagement
# USAGE
python api_management_create_backend_proxy_backend.py
Before run the sample, please set the values of the client ID, tenant ID and client secret
of the AAD application as environment variables: AZURE_CLIENT_ID, AZURE_TENANT_ID,
AZURE_CLIENT_SECRET. For more info about how to get the value, please see:
https://docs.microsoft.com/azure/active-directory/develop/howto-create-service-principal-portal
"""
def main():
client = ApiManagementClient(
credential=DefaultAzureCredential(),
subscription_id="subid",
)
response = client.backend.create_or_update(
resource_group_name="rg1",
service_name="apimService1",
backend_id="proxybackend",
parameters={
"properties": {
"credentials": {
"authorization": {"parameter": "opensesma", "scheme": "Basic"},
"header": {"x-my-1": ["val1", "val2"]},
"query": {"sv": ["xx", "bb", "cc"]},
},
"description": "description5308",
"protocol": "http",
"proxy": {"password": "<password>", "url": "http://192.168.1.1:8080", "username": "Contoso\\admin"},
"tls": {"validateCertificateChain": True, "validateCertificateName": True},
"url": "https://backendname2644/",
}
},
)
print(response)
# x-ms-original-file: specification/apimanagement/resource-manager/Microsoft.ApiManagement/stable/2022-08-01/examples/ApiManagementCreateBackendProxyBackend.json
if __name__ == "__main__":
main()
To use the Azure SDK library in your project, see this documentation. To provide feedback on this code sample, open a GitHub issue
package armapimanagement_test
import (
"context"
"log"
"github.com/Azure/azure-sdk-for-go/sdk/azcore/to"
"github.com/Azure/azure-sdk-for-go/sdk/azidentity"
"github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/apimanagement/armapimanagement/v2"
)
// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/4cd95123fb961c68740565a1efcaa5e43bd35802/specification/apimanagement/resource-manager/Microsoft.ApiManagement/stable/2022-08-01/examples/ApiManagementCreateBackendProxyBackend.json
func ExampleBackendClient_CreateOrUpdate_apiManagementCreateBackendProxyBackend() {
cred, err := azidentity.NewDefaultAzureCredential(nil)
if err != nil {
log.Fatalf("failed to obtain a credential: %v", err)
}
ctx := context.Background()
clientFactory, err := armapimanagement.NewClientFactory("<subscription-id>", cred, nil)
if err != nil {
log.Fatalf("failed to create client: %v", err)
}
res, err := clientFactory.NewBackendClient().CreateOrUpdate(ctx, "rg1", "apimService1", "proxybackend", armapimanagement.BackendContract{
Properties: &armapimanagement.BackendContractProperties{
Description: to.Ptr("description5308"),
Credentials: &armapimanagement.BackendCredentialsContract{
Authorization: &armapimanagement.BackendAuthorizationHeaderCredentials{
Parameter: to.Ptr("opensesma"),
Scheme: to.Ptr("Basic"),
},
Header: map[string][]*string{
"x-my-1": {
to.Ptr("val1"),
to.Ptr("val2")},
},
Query: map[string][]*string{
"sv": {
to.Ptr("xx"),
to.Ptr("bb"),
to.Ptr("cc")},
},
},
Proxy: &armapimanagement.BackendProxyContract{
Password: to.Ptr("<password>"),
URL: to.Ptr("http://192.168.1.1:8080"),
Username: to.Ptr("Contoso\\admin"),
},
TLS: &armapimanagement.BackendTLSProperties{
ValidateCertificateChain: to.Ptr(true),
ValidateCertificateName: to.Ptr(true),
},
URL: to.Ptr("https://backendname2644/"),
Protocol: to.Ptr(armapimanagement.BackendProtocolHTTP),
},
}, &armapimanagement.BackendClientCreateOrUpdateOptions{IfMatch: nil})
if err != nil {
log.Fatalf("failed to finish the request: %v", err)
}
// You could use response here. We use blank identifier for just demo purposes.
_ = res
// If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes.
// res.BackendContract = armapimanagement.BackendContract{
// Name: to.Ptr("proxybackend"),
// Type: to.Ptr("Microsoft.ApiManagement/service/backends"),
// ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.ApiManagement/service/apimService1/backends/proxybackend"),
// Properties: &armapimanagement.BackendContractProperties{
// Description: to.Ptr("description5308"),
// Credentials: &armapimanagement.BackendCredentialsContract{
// Authorization: &armapimanagement.BackendAuthorizationHeaderCredentials{
// Parameter: to.Ptr("opensesma"),
// Scheme: to.Ptr("Basic"),
// },
// Header: map[string][]*string{
// "x-my-1": []*string{
// to.Ptr("val1"),
// to.Ptr("val2")},
// },
// Query: map[string][]*string{
// "sv": []*string{
// to.Ptr("xx"),
// to.Ptr("bb"),
// to.Ptr("cc")},
// },
// },
// Proxy: &armapimanagement.BackendProxyContract{
// Password: to.Ptr("<password>"),
// URL: to.Ptr("http://192.168.1.1:8080"),
// Username: to.Ptr("Contoso\\admin"),
// },
// TLS: &armapimanagement.BackendTLSProperties{
// ValidateCertificateChain: to.Ptr(false),
// ValidateCertificateName: to.Ptr(false),
// },
// URL: to.Ptr("https://backendname2644/"),
// Protocol: to.Ptr(armapimanagement.BackendProtocolHTTP),
// },
// }
}
To use the Azure SDK library in your project, see this documentation. To provide feedback on this code sample, open a GitHub issue
const { ApiManagementClient } = require("@azure/arm-apimanagement");
const { DefaultAzureCredential } = require("@azure/identity");
/**
* This sample demonstrates how to Creates or Updates a backend.
*
* @summary Creates or Updates a backend.
* x-ms-original-file: specification/apimanagement/resource-manager/Microsoft.ApiManagement/stable/2022-08-01/examples/ApiManagementCreateBackendProxyBackend.json
*/
async function apiManagementCreateBackendProxyBackend() {
const subscriptionId = process.env["APIMANAGEMENT_SUBSCRIPTION_ID"] || "subid";
const resourceGroupName = process.env["APIMANAGEMENT_RESOURCE_GROUP"] || "rg1";
const serviceName = "apimService1";
const backendId = "proxybackend";
const parameters = {
description: "description5308",
credentials: {
authorization: { parameter: "opensesma", scheme: "Basic" },
header: { xMy1: ["val1", "val2"] },
query: { sv: ["xx", "bb", "cc"] },
},
proxy: {
password: "<password>",
url: "http://192.168.1.1:8080",
username: "Contoso\\admin",
},
tls: { validateCertificateChain: true, validateCertificateName: true },
url: "https://backendname2644/",
protocol: "http",
};
const credential = new DefaultAzureCredential();
const client = new ApiManagementClient(credential, subscriptionId);
const result = await client.backend.createOrUpdate(
resourceGroupName,
serviceName,
backendId,
parameters
);
console.log(result);
}
To use the Azure SDK library in your project, see this documentation. To provide feedback on this code sample, open a GitHub issue
Пример ответа
{
"id": "/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.ApiManagement/service/apimService1/backends/proxybackend",
"type": "Microsoft.ApiManagement/service/backends",
"name": "proxybackend",
"properties": {
"description": "description5308",
"url": "https://backendname2644/",
"protocol": "http",
"credentials": {
"query": {
"sv": [
"xx",
"bb",
"cc"
]
},
"header": {
"x-my-1": [
"val1",
"val2"
]
},
"authorization": {
"scheme": "Basic",
"parameter": "opensesma"
}
},
"proxy": {
"url": "http://192.168.1.1:8080",
"username": "Contoso\\admin",
"password": "<password>"
},
"tls": {
"validateCertificateChain": false,
"validateCertificateName": false
}
}
}
{
"id": "/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.ApiManagement/service/apimService1/backends/proxybackend",
"type": "Microsoft.ApiManagement/service/backends",
"name": "proxybackend",
"properties": {
"description": "description5308",
"url": "https://backendname2644/",
"protocol": "http",
"credentials": {
"query": {
"sv": [
"xx",
"bb",
"cc"
]
},
"header": {
"x-my-1": [
"val1",
"val2"
]
},
"authorization": {
"scheme": "Basic",
"parameter": "opensesma"
}
},
"proxy": {
"url": "http://192.168.1.1:8080",
"username": "Contoso\\admin",
"password": "<password>"
},
"tls": {
"validateCertificateChain": false,
"validateCertificateName": false
}
}
}
ApiManagementCreateBackendServiceFabric
Образец запроса
PUT https://management.azure.com/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.ApiManagement/service/apimService1/backends/sfbackend?api-version=2022-08-01
{
"properties": {
"description": "Service Fabric Test App 1",
"protocol": "http",
"url": "fabric:/mytestapp/mytestservice",
"properties": {
"serviceFabricCluster": {
"managementEndpoints": [
"https://somecluster.com"
],
"clientCertificateId": "/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.ApiManagement/service/apimService1/certificates/cert1",
"serverX509Names": [
{
"name": "ServerCommonName1",
"issuerCertificateThumbprint": "IssuerCertificateThumbprint1"
}
],
"maxPartitionResolutionRetries": 5
}
}
}
}
import com.azure.resourcemanager.apimanagement.models.BackendProperties;
import com.azure.resourcemanager.apimanagement.models.BackendProtocol;
import com.azure.resourcemanager.apimanagement.models.BackendServiceFabricClusterProperties;
import com.azure.resourcemanager.apimanagement.models.X509CertificateName;
import java.util.Arrays;
import java.util.HashMap;
import java.util.Map;
/** Samples for Backend CreateOrUpdate. */
public final class Main {
/*
* x-ms-original-file: specification/apimanagement/resource-manager/Microsoft.ApiManagement/stable/2022-08-01/examples/ApiManagementCreateBackendServiceFabric.json
*/
/**
* Sample code: ApiManagementCreateBackendServiceFabric.
*
* @param manager Entry point to ApiManagementManager.
*/
public static void apiManagementCreateBackendServiceFabric(
com.azure.resourcemanager.apimanagement.ApiManagementManager manager) {
manager
.backends()
.define("sfbackend")
.withExistingService("rg1", "apimService1")
.withUrl("fabric:/mytestapp/mytestservice")
.withProtocol(BackendProtocol.HTTP)
.withDescription("Service Fabric Test App 1")
.withProperties(
new BackendProperties()
.withServiceFabricCluster(
new BackendServiceFabricClusterProperties()
.withClientCertificateId(
"/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.ApiManagement/service/apimService1/certificates/cert1")
.withMaxPartitionResolutionRetries(5)
.withManagementEndpoints(Arrays.asList("https://somecluster.com"))
.withServerX509Names(
Arrays
.asList(
new X509CertificateName()
.withName("ServerCommonName1")
.withIssuerCertificateThumbprint("IssuerCertificateThumbprint1")))))
.create();
}
// Use "Map.of" if available
@SuppressWarnings("unchecked")
private static <T> Map<String, T> mapOf(Object... inputs) {
Map<String, T> map = new HashMap<>();
for (int i = 0; i < inputs.length; i += 2) {
String key = (String) inputs[i];
T value = (T) inputs[i + 1];
map.put(key, value);
}
return map;
}
}
To use the Azure SDK library in your project, see this documentation. To provide feedback on this code sample, open a GitHub issue
from typing import Any, IO, Union
from azure.identity import DefaultAzureCredential
from azure.mgmt.apimanagement import ApiManagementClient
"""
# PREREQUISITES
pip install azure-identity
pip install azure-mgmt-apimanagement
# USAGE
python api_management_create_backend_service_fabric.py
Before run the sample, please set the values of the client ID, tenant ID and client secret
of the AAD application as environment variables: AZURE_CLIENT_ID, AZURE_TENANT_ID,
AZURE_CLIENT_SECRET. For more info about how to get the value, please see:
https://docs.microsoft.com/azure/active-directory/develop/howto-create-service-principal-portal
"""
def main():
client = ApiManagementClient(
credential=DefaultAzureCredential(),
subscription_id="subid",
)
response = client.backend.create_or_update(
resource_group_name="rg1",
service_name="apimService1",
backend_id="sfbackend",
parameters={
"properties": {
"description": "Service Fabric Test App 1",
"properties": {
"serviceFabricCluster": {
"clientCertificateId": "/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.ApiManagement/service/apimService1/certificates/cert1",
"managementEndpoints": ["https://somecluster.com"],
"maxPartitionResolutionRetries": 5,
"serverX509Names": [
{"issuerCertificateThumbprint": "IssuerCertificateThumbprint1", "name": "ServerCommonName1"}
],
}
},
"protocol": "http",
"url": "fabric:/mytestapp/mytestservice",
}
},
)
print(response)
# x-ms-original-file: specification/apimanagement/resource-manager/Microsoft.ApiManagement/stable/2022-08-01/examples/ApiManagementCreateBackendServiceFabric.json
if __name__ == "__main__":
main()
To use the Azure SDK library in your project, see this documentation. To provide feedback on this code sample, open a GitHub issue
package armapimanagement_test
import (
"context"
"log"
"github.com/Azure/azure-sdk-for-go/sdk/azcore/to"
"github.com/Azure/azure-sdk-for-go/sdk/azidentity"
"github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/apimanagement/armapimanagement/v2"
)
// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/4cd95123fb961c68740565a1efcaa5e43bd35802/specification/apimanagement/resource-manager/Microsoft.ApiManagement/stable/2022-08-01/examples/ApiManagementCreateBackendServiceFabric.json
func ExampleBackendClient_CreateOrUpdate_apiManagementCreateBackendServiceFabric() {
cred, err := azidentity.NewDefaultAzureCredential(nil)
if err != nil {
log.Fatalf("failed to obtain a credential: %v", err)
}
ctx := context.Background()
clientFactory, err := armapimanagement.NewClientFactory("<subscription-id>", cred, nil)
if err != nil {
log.Fatalf("failed to create client: %v", err)
}
res, err := clientFactory.NewBackendClient().CreateOrUpdate(ctx, "rg1", "apimService1", "sfbackend", armapimanagement.BackendContract{
Properties: &armapimanagement.BackendContractProperties{
Description: to.Ptr("Service Fabric Test App 1"),
Properties: &armapimanagement.BackendProperties{
ServiceFabricCluster: &armapimanagement.BackendServiceFabricClusterProperties{
ClientCertificateID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.ApiManagement/service/apimService1/certificates/cert1"),
ManagementEndpoints: []*string{
to.Ptr("https://somecluster.com")},
MaxPartitionResolutionRetries: to.Ptr[int32](5),
ServerX509Names: []*armapimanagement.X509CertificateName{
{
Name: to.Ptr("ServerCommonName1"),
IssuerCertificateThumbprint: to.Ptr("IssuerCertificateThumbprint1"),
}},
},
},
URL: to.Ptr("fabric:/mytestapp/mytestservice"),
Protocol: to.Ptr(armapimanagement.BackendProtocolHTTP),
},
}, &armapimanagement.BackendClientCreateOrUpdateOptions{IfMatch: nil})
if err != nil {
log.Fatalf("failed to finish the request: %v", err)
}
// You could use response here. We use blank identifier for just demo purposes.
_ = res
// If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes.
// res.BackendContract = armapimanagement.BackendContract{
// Name: to.Ptr("sfbackend"),
// Type: to.Ptr("Microsoft.ApiManagement/service/backends"),
// ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.ApiManagement/service/apimService1/backends/sfbackend"),
// Properties: &armapimanagement.BackendContractProperties{
// Description: to.Ptr("Service Fabric Test App 1"),
// Properties: &armapimanagement.BackendProperties{
// ServiceFabricCluster: &armapimanagement.BackendServiceFabricClusterProperties{
// ClientCertificateID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.ApiManagement/service/apimService1/certificates/cert1"),
// ManagementEndpoints: []*string{
// to.Ptr("https://somecluster.com")},
// MaxPartitionResolutionRetries: to.Ptr[int32](5),
// ServerX509Names: []*armapimanagement.X509CertificateName{
// {
// Name: to.Ptr("ServerCommonName1"),
// IssuerCertificateThumbprint: to.Ptr("IssuerCertificateThumbprint1"),
// }},
// },
// },
// URL: to.Ptr("fabric:/mytestapp/mytestservice"),
// Protocol: to.Ptr(armapimanagement.BackendProtocolHTTP),
// },
// }
}
To use the Azure SDK library in your project, see this documentation. To provide feedback on this code sample, open a GitHub issue
const { ApiManagementClient } = require("@azure/arm-apimanagement");
const { DefaultAzureCredential } = require("@azure/identity");
/**
* This sample demonstrates how to Creates or Updates a backend.
*
* @summary Creates or Updates a backend.
* x-ms-original-file: specification/apimanagement/resource-manager/Microsoft.ApiManagement/stable/2022-08-01/examples/ApiManagementCreateBackendServiceFabric.json
*/
async function apiManagementCreateBackendServiceFabric() {
const subscriptionId = process.env["APIMANAGEMENT_SUBSCRIPTION_ID"] || "subid";
const resourceGroupName = process.env["APIMANAGEMENT_RESOURCE_GROUP"] || "rg1";
const serviceName = "apimService1";
const backendId = "sfbackend";
const parameters = {
description: "Service Fabric Test App 1",
properties: {
serviceFabricCluster: {
clientCertificateId:
"/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.ApiManagement/service/apimService1/certificates/cert1",
managementEndpoints: ["https://somecluster.com"],
maxPartitionResolutionRetries: 5,
serverX509Names: [
{
name: "ServerCommonName1",
issuerCertificateThumbprint: "IssuerCertificateThumbprint1",
},
],
},
},
url: "fabric:/mytestapp/mytestservice",
protocol: "http",
};
const credential = new DefaultAzureCredential();
const client = new ApiManagementClient(credential, subscriptionId);
const result = await client.backend.createOrUpdate(
resourceGroupName,
serviceName,
backendId,
parameters
);
console.log(result);
}
To use the Azure SDK library in your project, see this documentation. To provide feedback on this code sample, open a GitHub issue
Пример ответа
{
"id": "/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.ApiManagement/service/apimService1/backends/sfbackend",
"type": "Microsoft.ApiManagement/service/backends",
"name": "sfbackend",
"properties": {
"description": "Service Fabric Test App 1",
"url": "fabric:/mytestapp/mytestservice",
"protocol": "http",
"properties": {
"serviceFabricCluster": {
"managementEndpoints": [
"https://somecluster.com"
],
"clientCertificateId": "/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.ApiManagement/service/apimService1/certificates/cert1",
"serverX509Names": [
{
"name": "ServerCommonName1",
"issuerCertificateThumbprint": "IssuerCertificateThumbprint1"
}
],
"maxPartitionResolutionRetries": 5
}
}
}
}
{
"id": "/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.ApiManagement/service/apimService1/backends/sfbackend",
"type": "Microsoft.ApiManagement/service/backends",
"name": "sfbackend",
"properties": {
"description": "Service Fabric Test App 1",
"url": "fabric:/mytestapp/mytestservice",
"protocol": "http",
"properties": {
"serviceFabricCluster": {
"managementEndpoints": [
"https://somecluster.com"
],
"clientCertificateId": "/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.ApiManagement/service/apimService1/certificates/cert1",
"serverX509Names": [
{
"name": "ServerCommonName1",
"issuerCertificateThumbprint": "IssuerCertificateThumbprint1"
}
],
"maxPartitionResolutionRetries": 5
}
}
}
}
Определения
Сведения о заголовке авторизации.
Имя |
Тип |
Описание |
parameter
|
string
|
Значение параметра проверки подлинности.
|
scheme
|
string
|
Имя схемы проверки подлинности.
|
BackendContract
Сведения о серверной части.
Имя |
Тип |
Описание |
id
|
string
|
Полный идентификатор ресурса. Пример : /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}
|
name
|
string
|
Имя ресурса.
|
properties.credentials
|
BackendCredentialsContract
|
Свойства контракта учетных данных серверной части
|
properties.description
|
string
|
Описание серверной части.
|
properties.properties
|
BackendProperties
|
Контракт свойств серверной части
|
properties.protocol
|
BackendProtocol
|
Серверный протокол связи.
|
properties.proxy
|
BackendProxyContract
|
Свойства контракта внутреннего шлюза
|
properties.resourceId
|
string
|
URI управления ресурсом во внешней системе. Этот URL-адрес может быть идентификатором ресурса Arm приложений логики, приложений-функций или приложений API.
|
properties.title
|
string
|
Название серверной части.
|
properties.tls
|
BackendTlsProperties
|
Свойства TLS серверной части
|
properties.url
|
string
|
URL-адрес среды выполнения серверной части.
|
type
|
string
|
Тип ресурса. Например, "Microsoft.Compute/virtualMachines" или "Microsoft.Storage/storageAccounts"
|
BackendCredentialsContract
Сведения об учетных данных, используемых для подключения к серверной части.
Имя |
Тип |
Описание |
authorization
|
BackendAuthorizationHeaderCredentials
|
Проверка подлинности в заголовке авторизации
|
certificate
|
string[]
|
Список отпечатков сертификатов клиента. Игнорируется, если указаны идентификаторы сертификатов.
|
certificateIds
|
string[]
|
Список идентификаторов сертификатов клиента.
|
header
|
object
|
Описание параметра заголовка.
|
query
|
object
|
Описание параметра запроса.
|
BackendProperties
Свойства, относящиеся к типу серверной части.
BackendProtocol
Серверный протокол связи.
Имя |
Тип |
Описание |
http
|
string
|
Серверная часть — это служба RESTful.
|
soap
|
string
|
Серверная часть — это служба SOAP.
|
BackendProxyContract
Сведения о серверном сервере WebProxy для использования в запросе к серверной части.
Имя |
Тип |
Описание |
password
|
string
|
Пароль для подключения к серверу WebProxy
|
url
|
string
|
Свойство AbsoluteUri сервера WebProxy, которое включает весь URI, хранящийся в экземпляре URI, включая все фрагменты и строки запроса.
|
username
|
string
|
Имя пользователя для подключения к серверу WebProxy
|
BackendServiceFabricClusterProperties
Свойства серверной части типа Service Fabric.
Имя |
Тип |
Описание |
clientCertificateId
|
string
|
Идентификатор сертификата клиента для конечной точки управления.
|
clientCertificatethumbprint
|
string
|
Отпечаток сертификата клиента для конечной точки управления. Игнорируется при предоставлении идентификаторов сертификатов
|
managementEndpoints
|
string[]
|
Конечная точка управления кластером.
|
maxPartitionResolutionRetries
|
integer
|
Максимальное количество повторных попыток при попытке разрешения секции.
|
serverCertificateThumbprints
|
string[]
|
Отпечатки сертификатов, которые служба управления кластером использует для обмена данными по протоколу TLS
|
serverX509Names
|
X509CertificateName[]
|
Коллекция имен сертификатов Server X509
|
BackendTlsProperties
Свойства, управляющие проверкой сертификата TLS.
Имя |
Тип |
Default value |
Описание |
validateCertificateChain
|
boolean
|
True
|
Флаг, указывающий, следует ли выполнять проверку цепочки SSL-сертификатов при использовании самозаверяющих сертификатов для этого серверного узла.
|
validateCertificateName
|
boolean
|
True
|
Флаг, указывающий, следует ли проверять имя SSL-сертификата при использовании самозаверяющих сертификатов для этого серверного узла.
|
ErrorFieldContract
Контракт поля ошибки.
Имя |
Тип |
Описание |
code
|
string
|
Код ошибки уровня свойства.
|
message
|
string
|
Понятное представление ошибки на уровне свойств.
|
target
|
string
|
Имя свойства.
|
ErrorResponse
Ответ на ошибку.
Имя |
Тип |
Описание |
error.code
|
string
|
Код ошибки, определяемый службой. Это код служит в качестве подсостояния для кода ошибки HTTP, указанного в ответе.
|
error.details
|
ErrorFieldContract[]
|
Список недопустимых полей, отправляемых в запросе, в случае ошибки проверки.
|
error.message
|
string
|
Читаемое представление ошибки.
|
X509CertificateName
Свойства сервера X509Names.
Имя |
Тип |
Описание |
issuerCertificateThumbprint
|
string
|
Отпечаток для издателя сертификата.
|
name
|
string
|
Общее имя сертификата.
|