Crea o actualiza un servicio API Management. Esta operación es de larga duración y puede tardar varios minutos en completarse.
PUT https://management.azure.com/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiManagement/service/{serviceName}?api-version=2022-08-01
Parámetros de identificador URI
Nombre |
En |
Requerido |
Tipo |
Description |
resourceGroupName
|
path |
True
|
string
|
Nombre del grupo de recursos. El nombre distingue mayúsculas de minúsculas.
|
serviceName
|
path |
True
|
string
|
Nombre del servicio API Management.
Regex pattern: ^[a-zA-Z](?:[a-zA-Z0-9-]*[a-zA-Z0-9])?$
|
subscriptionId
|
path |
True
|
string
|
Identificador de la suscripción de destino.
|
api-version
|
query |
True
|
string
|
Versión de API que se usará para la operación.
|
Cuerpo de la solicitud
Nombre |
Requerido |
Tipo |
Description |
location
|
True
|
string
|
Ubicación del recurso
|
properties.publisherEmail
|
True
|
string
|
Correo electrónico del publicador.
|
properties.publisherName
|
True
|
string
|
Nombre del publicador.
|
sku
|
True
|
ApiManagementServiceSkuProperties
|
Propiedades de SKU del servicio API Management.
|
identity
|
|
ApiManagementServiceIdentity
|
Identidad de servicio administrada del servicio Api Management.
|
properties.additionalLocations
|
|
AdditionalLocation[]
|
Ubicaciones adicionales del centro de datos del servicio API Management.
|
properties.apiVersionConstraint
|
|
ApiVersionConstraint
|
Restricción de versión de api de plano de control para el servicio API Management.
|
properties.certificates
|
|
CertificateConfiguration[]
|
Lista de certificados que deben instalarse en el servicio API Management. El número máximo de certificados admitidos que se pueden instalar es 10.
|
properties.customProperties
|
|
object
|
Propiedades personalizadas del servicio API Management. La configuración Microsoft.WindowsAzure.ApiManagement.Gateway.Security.Ciphers.TripleDes168 deshabilitará el cifrado TLS_RSA_WITH_3DES_EDE_CBC_SHA para todas las TLS(1.0, 1.1 y 1.2). La configuración Microsoft.WindowsAzure.ApiManagement.Gateway.Security.Protocols.Tls11 se puede usar para deshabilitar solo TLS 1.1. La configuración Microsoft.WindowsAzure.ApiManagement.Gateway.Security.Protocols.Tls10 se puede usar para deshabilitar TLS 1.0 en un servicio API Management. La configuración Microsoft.WindowsAzure.ApiManagement.Gateway.Security.Backend.Protocols.Tls11 se puede usar para deshabilitar solo TLS 1.1 para las comunicaciones con back-end. La configuración Microsoft.WindowsAzure.ApiManagement.Gateway.Security.Backend.Protocols.Tls10 se puede usar para deshabilitar TLS 1.0 para las comunicaciones con back-end. La configuración Microsoft.WindowsAzure.ApiManagement.Gateway.Protocols.Server.Http2 se puede usar para habilitar el protocolo HTTP2 en un servicio API Management. No especificar ninguna de estas propiedades en la operación PATCH restablecerá los valores de las propiedades omitidas en sus valores predeterminados. Para todas las configuraciones, excepto Http2, el valor predeterminado es True si el servicio se creó el 1 de abril de 2018 o antes de False lo contrario. El valor predeterminado de la configuración http2 es False .
Puede deshabilitar cualquiera de los siguientes cifrados mediante la configuración Microsoft.WindowsAzure.ApiManagement.Gateway.Security.Ciphers.[cipher_name] : TLS_ECDHE_ECDSA_WITH_AES_256_CBC_SHA, TLS_ECDHE_ECDSA_WITH_AES_128_CBC_SHA, TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA, TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA, TLS_RSA_WITH_AES_128_GCM_SHA256, TLS_RSA_WITH_AES_256_CBC_SHA256, TLS_RSA_WITH_AES_256_CBC_SHA256, TLS_RSA_WITH_AES_128_CBC_SHA256, TLS_RSA_WITH_AES_256_CBC_SHA, TLS_RSA_WITH_AES_128_CBC_SHA. Por ejemplo, Microsoft.WindowsAzure.ApiManagement.Gateway.Security.Ciphers.TLS_RSA_WITH_AES_128_CBC_SHA256 :false . El valor predeterminado es true para ellos. Nota: Los siguientes cifrados no se pueden deshabilitar porque son necesarios para los componentes de la plataforma interna: TLS_AES_256_GCM_SHA384,TLS_AES_128_GCM_SHA256,TLS_ECDHE_ECDSA_WITH_AES_256_GCM_SHA384,TLS_ECDHE_ECDSA_WITH_AES_128_GCM_SHA256,TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384,TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256, TLS_ECDHE_ECDSA_WITH_AES_256_CBC_SHA384,TLS_ECDHE_ECDSA_WITH_AES_128_CBC_SHA256,TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA384 TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA256
|
properties.disableGateway
|
|
boolean
|
La propiedad solo es válida para un servicio api Management implementado en varias ubicaciones. Esto se puede usar para deshabilitar la puerta de enlace en la región maestra.
|
properties.enableClientCertificate
|
|
boolean
|
Propiedad solo diseñada para usarse para el servicio de SKU de consumo. Esto exige que se presente un certificado de cliente en cada solicitud a la puerta de enlace. Esto también permite autenticar el certificado en la directiva de la puerta de enlace.
|
properties.hostnameConfigurations
|
|
HostnameConfiguration[]
|
Configuración de nombre de host personalizada del servicio API Management.
|
properties.natGatewayState
|
|
NatGatewayState
|
La propiedad se puede usar para habilitar nat Gateway para este servicio de API Management.
|
properties.notificationSenderEmail
|
|
string
|
Email dirección desde la que se enviará la notificación.
|
properties.privateEndpointConnections
|
|
RemotePrivateEndpointConnectionWrapper[]
|
Lista de conexiones de punto de conexión privado de este servicio.
|
properties.publicIpAddressId
|
|
string
|
Dirección IP V4 basada en la SKU estándar pública que se va a asociar con Virtual Network servicio implementado en la región. Solo se admite para la implementación de SKU Developer y Premium en Virtual Network.
|
properties.publicNetworkAccess
|
|
PublicNetworkAccess
|
Si se permite o no el acceso al punto de conexión público para este servicio API Management. El valor es opcional, pero si se pasa, debe ser "Habilitado" o "Deshabilitado". Si "Disabled", los puntos de conexión privados son el método de acceso exclusivo. El valor predeterminado es "Enabled"
|
properties.restore
|
|
boolean
|
Quite el servicio Api Management si anteriormente se eliminó temporalmente. Si se especifica esta marca y se establece en True se omitirán todas las demás propiedades.
|
properties.virtualNetworkConfiguration
|
|
VirtualNetworkConfiguration
|
Configuración de red virtual del servicio API Management.
|
properties.virtualNetworkType
|
|
VirtualNetworkType
|
Tipo de VPN en el que se debe configurar API Management servicio. Ninguno (valor predeterminado) significa que el servicio API Management no forma parte de ninguna Virtual Network, external significa que la implementación de API Management se configura dentro de un Virtual Network que tiene un punto de conexión accesible desde Internet y significa internamente que API Management la implementación se configura dentro de un Virtual Network tener solo un punto de conexión accesible desde la intranet.
|
tags
|
|
object
|
Etiquetas del recurso.
|
zones
|
|
string[]
|
Una lista de zonas de disponibilidad que indica dónde debe proceder el recurso.
|
Respuestas
Seguridad
azure_auth
Flujo de OAuth2 de Azure Active Directory.
Type:
oauth2
Flow:
implicit
Authorization URL:
https://login.microsoftonline.com/common/oauth2/authorize
Scopes
Nombre |
Description |
user_impersonation
|
suplantación de su cuenta de usuario
|
Ejemplos
ApiManagementCreateMultiRegionServiceWithCustomHostname
Sample Request
PUT https://management.azure.com/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.ApiManagement/service/apimService1?api-version=2022-08-01
{
"properties": {
"hostnameConfigurations": [
{
"type": "Proxy",
"hostName": "gateway1.msitesting.net",
"encodedCertificate": "****** Base 64 Encoded Certificate ************",
"certificatePassword": "Password",
"defaultSslBinding": true
},
{
"type": "Management",
"hostName": "mgmt.msitesting.net",
"encodedCertificate": "****** Base 64 Encoded Certificate ************",
"certificatePassword": "Password"
},
{
"type": "Portal",
"hostName": "portal1.msitesting.net",
"encodedCertificate": "****** Base 64 Encoded Certificate ************",
"certificatePassword": "Password"
}
],
"publisherEmail": "apim@autorestsdk.com",
"publisherName": "autorestsdk",
"additionalLocations": [
{
"location": "East US",
"sku": {
"name": "Premium",
"capacity": 1
},
"disableGateway": true
}
],
"virtualNetworkType": "None",
"apiVersionConstraint": {
"minApiVersion": "2019-01-01"
}
},
"sku": {
"name": "Premium",
"capacity": 1
},
"location": "West US",
"tags": {
"tag1": "value1",
"tag2": "value2",
"tag3": "value3"
}
}
import com.azure.resourcemanager.apimanagement.models.AdditionalLocation;
import com.azure.resourcemanager.apimanagement.models.ApiManagementServiceSkuProperties;
import com.azure.resourcemanager.apimanagement.models.ApiVersionConstraint;
import com.azure.resourcemanager.apimanagement.models.HostnameConfiguration;
import com.azure.resourcemanager.apimanagement.models.HostnameType;
import com.azure.resourcemanager.apimanagement.models.SkuType;
import com.azure.resourcemanager.apimanagement.models.VirtualNetworkType;
import java.util.Arrays;
import java.util.HashMap;
import java.util.Map;
/** Samples for ApiManagementService CreateOrUpdate. */
public final class Main {
/*
* x-ms-original-file: specification/apimanagement/resource-manager/Microsoft.ApiManagement/stable/2022-08-01/examples/ApiManagementCreateMultiRegionServiceWithCustomHostname.json
*/
/**
* Sample code: ApiManagementCreateMultiRegionServiceWithCustomHostname.
*
* @param manager Entry point to ApiManagementManager.
*/
public static void apiManagementCreateMultiRegionServiceWithCustomHostname(
com.azure.resourcemanager.apimanagement.ApiManagementManager manager) {
manager
.apiManagementServices()
.define("apimService1")
.withRegion("West US")
.withExistingResourceGroup("rg1")
.withSku(new ApiManagementServiceSkuProperties().withName(SkuType.PREMIUM).withCapacity(1))
.withPublisherEmail("apim@autorestsdk.com")
.withPublisherName("autorestsdk")
.withTags(mapOf("tag1", "value1", "tag2", "value2", "tag3", "value3"))
.withHostnameConfigurations(
Arrays
.asList(
new HostnameConfiguration()
.withType(HostnameType.PROXY)
.withHostname("gateway1.msitesting.net")
.withEncodedCertificate("fakeTokenPlaceholder")
.withCertificatePassword("fakeTokenPlaceholder")
.withDefaultSslBinding(true),
new HostnameConfiguration()
.withType(HostnameType.MANAGEMENT)
.withHostname("mgmt.msitesting.net")
.withEncodedCertificate("fakeTokenPlaceholder")
.withCertificatePassword("fakeTokenPlaceholder"),
new HostnameConfiguration()
.withType(HostnameType.PORTAL)
.withHostname("portal1.msitesting.net")
.withEncodedCertificate("fakeTokenPlaceholder")
.withCertificatePassword("fakeTokenPlaceholder")))
.withAdditionalLocations(
Arrays
.asList(
new AdditionalLocation()
.withLocation("East US")
.withSku(new ApiManagementServiceSkuProperties().withName(SkuType.PREMIUM).withCapacity(1))
.withDisableGateway(true)))
.withVirtualNetworkType(VirtualNetworkType.NONE)
.withApiVersionConstraint(new ApiVersionConstraint().withMinApiVersion("2019-01-01"))
.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 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_multi_region_service_with_custom_hostname.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.api_management_service.begin_create_or_update(
resource_group_name="rg1",
service_name="apimService1",
parameters={
"location": "West US",
"properties": {
"additionalLocations": [
{"disableGateway": True, "location": "East US", "sku": {"capacity": 1, "name": "Premium"}}
],
"apiVersionConstraint": {"minApiVersion": "2019-01-01"},
"hostnameConfigurations": [
{
"certificatePassword": "Password",
"defaultSslBinding": True,
"encodedCertificate": "****** Base 64 Encoded Certificate ************",
"hostName": "gateway1.msitesting.net",
"type": "Proxy",
},
{
"certificatePassword": "Password",
"encodedCertificate": "****** Base 64 Encoded Certificate ************",
"hostName": "mgmt.msitesting.net",
"type": "Management",
},
{
"certificatePassword": "Password",
"encodedCertificate": "****** Base 64 Encoded Certificate ************",
"hostName": "portal1.msitesting.net",
"type": "Portal",
},
],
"publisherEmail": "apim@autorestsdk.com",
"publisherName": "autorestsdk",
"virtualNetworkType": "None",
},
"sku": {"capacity": 1, "name": "Premium"},
"tags": {"tag1": "value1", "tag2": "value2", "tag3": "value3"},
},
).result()
print(response)
# x-ms-original-file: specification/apimanagement/resource-manager/Microsoft.ApiManagement/stable/2022-08-01/examples/ApiManagementCreateMultiRegionServiceWithCustomHostname.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/ApiManagementCreateMultiRegionServiceWithCustomHostname.json
func ExampleServiceClient_BeginCreateOrUpdate_apiManagementCreateMultiRegionServiceWithCustomHostname() {
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)
}
poller, err := clientFactory.NewServiceClient().BeginCreateOrUpdate(ctx, "rg1", "apimService1", armapimanagement.ServiceResource{
Tags: map[string]*string{
"tag1": to.Ptr("value1"),
"tag2": to.Ptr("value2"),
"tag3": to.Ptr("value3"),
},
Location: to.Ptr("West US"),
Properties: &armapimanagement.ServiceProperties{
AdditionalLocations: []*armapimanagement.AdditionalLocation{
{
DisableGateway: to.Ptr(true),
Location: to.Ptr("East US"),
SKU: &armapimanagement.ServiceSKUProperties{
Name: to.Ptr(armapimanagement.SKUTypePremium),
Capacity: to.Ptr[int32](1),
},
}},
APIVersionConstraint: &armapimanagement.APIVersionConstraint{
MinAPIVersion: to.Ptr("2019-01-01"),
},
HostnameConfigurations: []*armapimanagement.HostnameConfiguration{
{
Type: to.Ptr(armapimanagement.HostnameTypeProxy),
CertificatePassword: to.Ptr("Password"),
DefaultSSLBinding: to.Ptr(true),
EncodedCertificate: to.Ptr("****** Base 64 Encoded Certificate ************"),
HostName: to.Ptr("gateway1.msitesting.net"),
},
{
Type: to.Ptr(armapimanagement.HostnameTypeManagement),
CertificatePassword: to.Ptr("Password"),
EncodedCertificate: to.Ptr("****** Base 64 Encoded Certificate ************"),
HostName: to.Ptr("mgmt.msitesting.net"),
},
{
Type: to.Ptr(armapimanagement.HostnameTypePortal),
CertificatePassword: to.Ptr("Password"),
EncodedCertificate: to.Ptr("****** Base 64 Encoded Certificate ************"),
HostName: to.Ptr("portal1.msitesting.net"),
}},
VirtualNetworkType: to.Ptr(armapimanagement.VirtualNetworkTypeNone),
PublisherEmail: to.Ptr("apim@autorestsdk.com"),
PublisherName: to.Ptr("autorestsdk"),
},
SKU: &armapimanagement.ServiceSKUProperties{
Name: to.Ptr(armapimanagement.SKUTypePremium),
Capacity: to.Ptr[int32](1),
},
}, nil)
if err != nil {
log.Fatalf("failed to finish the request: %v", err)
}
res, err := poller.PollUntilDone(ctx, nil)
if err != nil {
log.Fatalf("failed to pull the result: %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.ServiceResource = armapimanagement.ServiceResource{
// Name: to.Ptr("apimService1"),
// Type: to.Ptr("Microsoft.ApiManagement/service"),
// ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.ApiManagement/service/apimService1"),
// Tags: map[string]*string{
// "tag1": to.Ptr("value1"),
// "tag2": to.Ptr("value2"),
// "tag3": to.Ptr("value3"),
// },
// Etag: to.Ptr("AAAAAAACXok="),
// Location: to.Ptr("West US"),
// Properties: &armapimanagement.ServiceProperties{
// AdditionalLocations: []*armapimanagement.AdditionalLocation{
// {
// DisableGateway: to.Ptr(true),
// GatewayRegionalURL: to.Ptr("https://apimService1-eastus-01.regional.azure-api.net"),
// Location: to.Ptr("East US"),
// PublicIPAddresses: []*string{
// to.Ptr("23.101.138.153")},
// SKU: &armapimanagement.ServiceSKUProperties{
// Name: to.Ptr(armapimanagement.SKUTypePremium),
// Capacity: to.Ptr[int32](1),
// },
// }},
// APIVersionConstraint: &armapimanagement.APIVersionConstraint{
// MinAPIVersion: to.Ptr("2019-01-01"),
// },
// CreatedAtUTC: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2019-12-18T06:26:20.334Z"); return t}()),
// CustomProperties: map[string]*string{
// "Microsoft.WindowsAzure.ApiManagement.Gateway.Protocols.Server.Http2": to.Ptr("False"),
// "Microsoft.WindowsAzure.ApiManagement.Gateway.Security.Backend.Protocols.Ssl30": to.Ptr("False"),
// "Microsoft.WindowsAzure.ApiManagement.Gateway.Security.Backend.Protocols.Tls10": to.Ptr("False"),
// "Microsoft.WindowsAzure.ApiManagement.Gateway.Security.Backend.Protocols.Tls11": to.Ptr("False"),
// "Microsoft.WindowsAzure.ApiManagement.Gateway.Security.Ciphers.TripleDes168": to.Ptr("False"),
// "Microsoft.WindowsAzure.ApiManagement.Gateway.Security.Protocols.Ssl30": to.Ptr("False"),
// "Microsoft.WindowsAzure.ApiManagement.Gateway.Security.Protocols.Tls10": to.Ptr("False"),
// "Microsoft.WindowsAzure.ApiManagement.Gateway.Security.Protocols.Tls11": to.Ptr("False"),
// },
// DeveloperPortalURL: to.Ptr("https://apimService1.developer.azure-api.net"),
// DisableGateway: to.Ptr(false),
// GatewayRegionalURL: to.Ptr("https://apimService1-westus-01.regional.azure-api.net"),
// GatewayURL: to.Ptr("https://apimService1.azure-api.net"),
// HostnameConfigurations: []*armapimanagement.HostnameConfiguration{
// {
// Type: to.Ptr(armapimanagement.HostnameTypeProxy),
// DefaultSSLBinding: to.Ptr(false),
// HostName: to.Ptr("apimService1.azure-api.net"),
// NegotiateClientCertificate: to.Ptr(false),
// },
// {
// Type: to.Ptr(armapimanagement.HostnameTypeProxy),
// Certificate: &armapimanagement.CertificateInformation{
// Expiry: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2036-01-01T07:00:00.000Z"); return t}()),
// Subject: to.Ptr("CN=*.msitesting.net"),
// Thumbprint: to.Ptr("8E989XXXXXXXXXXXXXXXXF1D174FDB3A2"),
// },
// DefaultSSLBinding: to.Ptr(true),
// HostName: to.Ptr("gateway1.msitesting.net"),
// NegotiateClientCertificate: to.Ptr(false),
// },
// {
// Type: to.Ptr(armapimanagement.HostnameTypeManagement),
// Certificate: &armapimanagement.CertificateInformation{
// Expiry: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2036-01-01T07:00:00.000Z"); return t}()),
// Subject: to.Ptr("CN=*.msitesting.net"),
// Thumbprint: to.Ptr("8E989XXXXXXXXXXXXXXXXF1D174FDB3A2"),
// },
// DefaultSSLBinding: to.Ptr(false),
// HostName: to.Ptr("mgmt.msitesting.net"),
// NegotiateClientCertificate: to.Ptr(false),
// },
// {
// Type: to.Ptr(armapimanagement.HostnameTypePortal),
// Certificate: &armapimanagement.CertificateInformation{
// Expiry: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2036-01-01T07:00:00.000Z"); return t}()),
// Subject: to.Ptr("CN=*.msitesting.net"),
// Thumbprint: to.Ptr("8E989XXXXXXXXXXXXXXXXF1D174FDB3A2"),
// },
// DefaultSSLBinding: to.Ptr(false),
// HostName: to.Ptr("portal1.msitesting.net"),
// NegotiateClientCertificate: to.Ptr(false),
// }},
// ManagementAPIURL: to.Ptr("https://apimService1.management.azure-api.net"),
// NotificationSenderEmail: to.Ptr("apimgmt-noreply@mail.windowsazure.com"),
// PortalURL: to.Ptr("https://apimService1.portal.azure-api.net"),
// ProvisioningState: to.Ptr("Succeeded"),
// PublicIPAddresses: []*string{
// to.Ptr("13.91.32.113")},
// ScmURL: to.Ptr("https://apimService1.scm.azure-api.net"),
// TargetProvisioningState: to.Ptr(""),
// VirtualNetworkType: to.Ptr(armapimanagement.VirtualNetworkTypeNone),
// PublisherEmail: to.Ptr("apim@autorestsdk.com"),
// PublisherName: to.Ptr("autorestsdk"),
// },
// SKU: &armapimanagement.ServiceSKUProperties{
// Name: to.Ptr(armapimanagement.SKUTypePremium),
// Capacity: to.Ptr[int32](1),
// },
// }
}
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 an API Management service. This is long running operation and could take several minutes to complete.
*
* @summary Creates or updates an API Management service. This is long running operation and could take several minutes to complete.
* x-ms-original-file: specification/apimanagement/resource-manager/Microsoft.ApiManagement/stable/2022-08-01/examples/ApiManagementCreateMultiRegionServiceWithCustomHostname.json
*/
async function apiManagementCreateMultiRegionServiceWithCustomHostname() {
const subscriptionId = process.env["APIMANAGEMENT_SUBSCRIPTION_ID"] || "subid";
const resourceGroupName = process.env["APIMANAGEMENT_RESOURCE_GROUP"] || "rg1";
const serviceName = "apimService1";
const parameters = {
additionalLocations: [
{
disableGateway: true,
location: "East US",
sku: { name: "Premium", capacity: 1 },
},
],
apiVersionConstraint: { minApiVersion: "2019-01-01" },
hostnameConfigurations: [
{
type: "Proxy",
certificatePassword: "Password",
defaultSslBinding: true,
encodedCertificate: "****** Base 64 Encoded Certificate ************",
hostName: "gateway1.msitesting.net",
},
{
type: "Management",
certificatePassword: "Password",
encodedCertificate: "****** Base 64 Encoded Certificate ************",
hostName: "mgmt.msitesting.net",
},
{
type: "Portal",
certificatePassword: "Password",
encodedCertificate: "****** Base 64 Encoded Certificate ************",
hostName: "portal1.msitesting.net",
},
],
location: "West US",
publisherEmail: "apim@autorestsdk.com",
publisherName: "autorestsdk",
sku: { name: "Premium", capacity: 1 },
tags: { tag1: "value1", tag2: "value2", tag3: "value3" },
virtualNetworkType: "None",
};
const credential = new DefaultAzureCredential();
const client = new ApiManagementClient(credential, subscriptionId);
const result = await client.apiManagementService.beginCreateOrUpdateAndWait(
resourceGroupName,
serviceName,
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
Sample Response
Location: https://management.azure.com/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.ApiManagement/service/apimService1/operationresults/ZWFzdHVzOmFuZHktdGVzdGluZy0yMDIyLTA0LTAxLXByZXZpZXctNF9BY3RfODQ2ZWE4Ng==?api-version=2022-08-01&asyncResponse
Azure-AsyncOperation: https://management.azure.com/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.ApiManagement/service/apimService1/operationresults/ZWFzdHVzOmFuZHktdGVzdGluZy0yMDIyLTA0LTAxLXByZXZpZXctNF9BY3RfODQ2ZWE4Ng==?api-version=2022-08-01&asyncResponse
{
"id": "/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.ApiManagement/service/apimService1",
"name": "apimService1",
"type": "Microsoft.ApiManagement/service",
"tags": {
"tag1": "value1",
"tag2": "value2",
"tag3": "value3"
},
"location": "West US",
"etag": "AAAAAAACXoo=",
"properties": {
"publisherEmail": "apim@autorestsdk.com",
"publisherName": "autorestsdk",
"notificationSenderEmail": "apimgmt-noreply@mail.windowsazure.com",
"provisioningState": "Created",
"targetProvisioningState": "Activating",
"createdAtUtc": "2019-12-18T08:04:26.9492661Z",
"hostnameConfigurations": [
{
"type": "Proxy",
"hostName": "apimService1.azure-api.net",
"negotiateClientCertificate": false,
"defaultSslBinding": false
},
{
"type": "Proxy",
"hostName": "gateway1.msitesting.net",
"negotiateClientCertificate": false,
"certificate": {
"expiry": "2036-01-01T07:00:00+00:00",
"thumbprint": "8E989XXXXXXXXXXXXXXXXF1D174FDB3A2",
"subject": "CN=*.msitesting.net"
},
"defaultSslBinding": true
},
{
"type": "Management",
"hostName": "mgmt.msitesting.net",
"negotiateClientCertificate": false,
"certificate": {
"expiry": "2036-01-01T07:00:00+00:00",
"thumbprint": "8E989XXXXXXXXXXXXXXXXF1D174FDB3A2",
"subject": "CN=*.msitesting.net"
},
"defaultSslBinding": false
},
{
"type": "Portal",
"hostName": "portal1.msitesting.net",
"negotiateClientCertificate": false,
"certificate": {
"expiry": "2036-01-01T07:00:00+00:00",
"thumbprint": "8E989XXXXXXXXXXXXXXXXF1D174FDB3A2",
"subject": "CN=*.msitesting.net"
},
"defaultSslBinding": false
}
],
"additionalLocations": [
{
"location": "East US",
"sku": {
"name": "Premium",
"capacity": 1
},
"disableGateway": true
}
],
"virtualNetworkType": "None",
"disableGateway": false,
"apiVersionConstraint": {
"minApiVersion": "2019-01-01"
}
},
"sku": {
"name": "Premium",
"capacity": 1
}
}
{
"id": "/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.ApiManagement/service/apimService1",
"name": "apimService1",
"type": "Microsoft.ApiManagement/service",
"tags": {
"tag1": "value1",
"tag2": "value2",
"tag3": "value3"
},
"location": "West US",
"etag": "AAAAAAACXok=",
"properties": {
"publisherEmail": "apim@autorestsdk.com",
"publisherName": "autorestsdk",
"notificationSenderEmail": "apimgmt-noreply@mail.windowsazure.com",
"provisioningState": "Succeeded",
"targetProvisioningState": "",
"createdAtUtc": "2019-12-18T06:26:20.3348609Z",
"gatewayUrl": "https://apimService1.azure-api.net",
"gatewayRegionalUrl": "https://apimService1-westus-01.regional.azure-api.net",
"portalUrl": "https://apimService1.portal.azure-api.net",
"developerPortalUrl": "https://apimService1.developer.azure-api.net",
"managementApiUrl": "https://apimService1.management.azure-api.net",
"scmUrl": "https://apimService1.scm.azure-api.net",
"hostnameConfigurations": [
{
"type": "Proxy",
"hostName": "apimService1.azure-api.net",
"negotiateClientCertificate": false,
"defaultSslBinding": false
},
{
"type": "Proxy",
"hostName": "gateway1.msitesting.net",
"negotiateClientCertificate": false,
"certificate": {
"expiry": "2036-01-01T07:00:00+00:00",
"thumbprint": "8E989XXXXXXXXXXXXXXXXF1D174FDB3A2",
"subject": "CN=*.msitesting.net"
},
"defaultSslBinding": true
},
{
"type": "Management",
"hostName": "mgmt.msitesting.net",
"negotiateClientCertificate": false,
"certificate": {
"expiry": "2036-01-01T07:00:00+00:00",
"thumbprint": "8E989XXXXXXXXXXXXXXXXF1D174FDB3A2",
"subject": "CN=*.msitesting.net"
},
"defaultSslBinding": false
},
{
"type": "Portal",
"hostName": "portal1.msitesting.net",
"negotiateClientCertificate": false,
"certificate": {
"expiry": "2036-01-01T07:00:00+00:00",
"thumbprint": "8E989XXXXXXXXXXXXXXXXF1D174FDB3A2",
"subject": "CN=*.msitesting.net"
},
"defaultSslBinding": false
}
],
"publicIPAddresses": [
"13.91.32.113"
],
"additionalLocations": [
{
"location": "East US",
"sku": {
"name": "Premium",
"capacity": 1
},
"publicIPAddresses": [
"23.101.138.153"
],
"gatewayRegionalUrl": "https://apimService1-eastus-01.regional.azure-api.net",
"disableGateway": true
}
],
"customProperties": {
"Microsoft.WindowsAzure.ApiManagement.Gateway.Security.Protocols.Tls10": "False",
"Microsoft.WindowsAzure.ApiManagement.Gateway.Security.Protocols.Tls11": "False",
"Microsoft.WindowsAzure.ApiManagement.Gateway.Security.Protocols.Ssl30": "False",
"Microsoft.WindowsAzure.ApiManagement.Gateway.Security.Ciphers.TripleDes168": "False",
"Microsoft.WindowsAzure.ApiManagement.Gateway.Security.Backend.Protocols.Tls10": "False",
"Microsoft.WindowsAzure.ApiManagement.Gateway.Security.Backend.Protocols.Tls11": "False",
"Microsoft.WindowsAzure.ApiManagement.Gateway.Security.Backend.Protocols.Ssl30": "False",
"Microsoft.WindowsAzure.ApiManagement.Gateway.Protocols.Server.Http2": "False"
},
"virtualNetworkType": "None",
"disableGateway": false,
"apiVersionConstraint": {
"minApiVersion": "2019-01-01"
}
},
"sku": {
"name": "Premium",
"capacity": 1
}
}
ApiManagementCreateService
Sample Request
PUT https://management.azure.com/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.ApiManagement/service/apimService1?api-version=2022-08-01
{
"properties": {
"publisherEmail": "foo@contoso.com",
"publisherName": "foo"
},
"sku": {
"name": "Developer",
"capacity": 1
},
"location": "South Central US",
"tags": {
"Name": "Contoso",
"Test": "User"
}
}
import com.azure.resourcemanager.apimanagement.models.ApiManagementServiceSkuProperties;
import com.azure.resourcemanager.apimanagement.models.SkuType;
import java.util.HashMap;
import java.util.Map;
/** Samples for ApiManagementService CreateOrUpdate. */
public final class Main {
/*
* x-ms-original-file: specification/apimanagement/resource-manager/Microsoft.ApiManagement/stable/2022-08-01/examples/ApiManagementCreateService.json
*/
/**
* Sample code: ApiManagementCreateService.
*
* @param manager Entry point to ApiManagementManager.
*/
public static void apiManagementCreateService(
com.azure.resourcemanager.apimanagement.ApiManagementManager manager) {
manager
.apiManagementServices()
.define("apimService1")
.withRegion("South Central US")
.withExistingResourceGroup("rg1")
.withSku(new ApiManagementServiceSkuProperties().withName(SkuType.DEVELOPER).withCapacity(1))
.withPublisherEmail("foo@contoso.com")
.withPublisherName("foo")
.withTags(mapOf("Name", "Contoso", "Test", "User"))
.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 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_service.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.api_management_service.begin_create_or_update(
resource_group_name="rg1",
service_name="apimService1",
parameters={
"location": "South Central US",
"properties": {"publisherEmail": "foo@contoso.com", "publisherName": "foo"},
"sku": {"capacity": 1, "name": "Developer"},
"tags": {"Name": "Contoso", "Test": "User"},
},
).result()
print(response)
# x-ms-original-file: specification/apimanagement/resource-manager/Microsoft.ApiManagement/stable/2022-08-01/examples/ApiManagementCreateService.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/ApiManagementCreateService.json
func ExampleServiceClient_BeginCreateOrUpdate_apiManagementCreateService() {
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)
}
poller, err := clientFactory.NewServiceClient().BeginCreateOrUpdate(ctx, "rg1", "apimService1", armapimanagement.ServiceResource{
Tags: map[string]*string{
"Name": to.Ptr("Contoso"),
"Test": to.Ptr("User"),
},
Location: to.Ptr("South Central US"),
Properties: &armapimanagement.ServiceProperties{
PublisherEmail: to.Ptr("foo@contoso.com"),
PublisherName: to.Ptr("foo"),
},
SKU: &armapimanagement.ServiceSKUProperties{
Name: to.Ptr(armapimanagement.SKUTypeDeveloper),
Capacity: to.Ptr[int32](1),
},
}, nil)
if err != nil {
log.Fatalf("failed to finish the request: %v", err)
}
res, err := poller.PollUntilDone(ctx, nil)
if err != nil {
log.Fatalf("failed to pull the result: %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.ServiceResource = armapimanagement.ServiceResource{
// Name: to.Ptr("apimService1"),
// Type: to.Ptr("Microsoft.ApiManagement/service"),
// ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.ApiManagement/service/apimService1"),
// Tags: map[string]*string{
// "api-version": to.Ptr("2022-08-01"),
// },
// Etag: to.Ptr("AAAAAAAmREI="),
// Location: to.Ptr("East US"),
// Properties: &armapimanagement.ServiceProperties{
// CreatedAtUTC: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2022-07-11T18:41:01.250Z"); return t}()),
// CustomProperties: map[string]*string{
// "Microsoft.WindowsAzure.ApiManagement.Gateway.Protocols.Server.Http2": to.Ptr("False"),
// "Microsoft.WindowsAzure.ApiManagement.Gateway.Security.Backend.Protocols.Ssl30": to.Ptr("False"),
// "Microsoft.WindowsAzure.ApiManagement.Gateway.Security.Backend.Protocols.Tls10": to.Ptr("False"),
// "Microsoft.WindowsAzure.ApiManagement.Gateway.Security.Backend.Protocols.Tls11": to.Ptr("False"),
// "Microsoft.WindowsAzure.ApiManagement.Gateway.Security.Ciphers.TripleDes168": to.Ptr("False"),
// "Microsoft.WindowsAzure.ApiManagement.Gateway.Security.Protocols.Ssl30": to.Ptr("False"),
// "Microsoft.WindowsAzure.ApiManagement.Gateway.Security.Protocols.Tls10": to.Ptr("False"),
// "Microsoft.WindowsAzure.ApiManagement.Gateway.Security.Protocols.Tls11": to.Ptr("False"),
// },
// DeveloperPortalURL: to.Ptr("https://apimService1.developer.azure-api.net"),
// DisableGateway: to.Ptr(false),
// GatewayRegionalURL: to.Ptr("https://apimService1-eastus-01.regional.azure-api.net"),
// GatewayURL: to.Ptr("https://apimService1.azure-api.net"),
// HostnameConfigurations: []*armapimanagement.HostnameConfiguration{
// {
// Type: to.Ptr(armapimanagement.HostnameTypeProxy),
// CertificateSource: to.Ptr(armapimanagement.CertificateSourceBuiltIn),
// DefaultSSLBinding: to.Ptr(true),
// HostName: to.Ptr("apimService1.azure-api.net"),
// NegotiateClientCertificate: to.Ptr(false),
// }},
// ManagementAPIURL: to.Ptr("https://apimService1.management.azure-api.net"),
// NotificationSenderEmail: to.Ptr("apimgmt-noreply@mail.windowsazure.com"),
// PlatformVersion: to.Ptr(armapimanagement.PlatformVersionStv1),
// PortalURL: to.Ptr("https://apimService1.portal.azure-api.net"),
// ProvisioningState: to.Ptr("Succeeded"),
// PublicIPAddresses: []*string{
// to.Ptr("13.90.229.33")},
// PublicNetworkAccess: to.Ptr(armapimanagement.PublicNetworkAccessEnabled),
// ScmURL: to.Ptr("https://apimService1.scm.azure-api.net"),
// TargetProvisioningState: to.Ptr(""),
// VirtualNetworkType: to.Ptr(armapimanagement.VirtualNetworkTypeNone),
// PublisherEmail: to.Ptr("samir@microsoft.com"),
// PublisherName: to.Ptr("foo"),
// },
// SKU: &armapimanagement.ServiceSKUProperties{
// Name: to.Ptr(armapimanagement.SKUTypeStandard),
// Capacity: to.Ptr[int32](1),
// },
// SystemData: &armapimanagement.SystemData{
// CreatedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2022-07-11T18:41:00.939Z"); return t}()),
// CreatedBy: to.Ptr("user@contoso.com"),
// CreatedByType: to.Ptr(armapimanagement.CreatedByTypeUser),
// LastModifiedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2022-07-11T18:41:00.939Z"); return t}()),
// LastModifiedBy: to.Ptr("user@contoso.com"),
// LastModifiedByType: to.Ptr(armapimanagement.CreatedByTypeUser),
// },
// }
}
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 an API Management service. This is long running operation and could take several minutes to complete.
*
* @summary Creates or updates an API Management service. This is long running operation and could take several minutes to complete.
* x-ms-original-file: specification/apimanagement/resource-manager/Microsoft.ApiManagement/stable/2022-08-01/examples/ApiManagementCreateService.json
*/
async function apiManagementCreateService() {
const subscriptionId = process.env["APIMANAGEMENT_SUBSCRIPTION_ID"] || "subid";
const resourceGroupName = process.env["APIMANAGEMENT_RESOURCE_GROUP"] || "rg1";
const serviceName = "apimService1";
const parameters = {
location: "South Central US",
publisherEmail: "foo@contoso.com",
publisherName: "foo",
sku: { name: "Developer", capacity: 1 },
tags: { name: "Contoso", test: "User" },
};
const credential = new DefaultAzureCredential();
const client = new ApiManagementClient(credential, subscriptionId);
const result = await client.apiManagementService.beginCreateOrUpdateAndWait(
resourceGroupName,
serviceName,
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
Sample Response
Location: https://management.azure.com/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.ApiManagement/service/apimService1/operationresults/ZWFzdHVzOmFuZHktdGVzdGluZy0yMDIyLTA0LTAxLXByZXZpZXctNF9BY3RfODQ2ZWE4Ng==?api-version=2022-08-01&asyncResponse
Azure-AsyncOperation: https://management.azure.com/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.ApiManagement/service/apimService1/operationresults/ZWFzdHVzOmFuZHktdGVzdGluZy0yMDIyLTA0LTAxLXByZXZpZXctNF9BY3RfODQ2ZWE4Ng==?api-version=2022-08-01&asyncResponse
{
"id": "/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.ApiManagement/service/apimService1",
"name": "apimService1",
"type": "Microsoft.ApiManagement/service",
"tags": {
"api-version": "2022-08-01"
},
"location": "East US",
"etag": "AAAAAAAmRAM=",
"properties": {
"publisherEmail": "samir@microsoft.com",
"publisherName": "foo",
"notificationSenderEmail": "apimgmt-noreply@mail.windowsazure.com",
"provisioningState": "Created",
"targetProvisioningState": "Activating",
"createdAtUtc": "2022-07-11T18:41:01.2506031Z",
"gatewayUrl": "https://apimService1.azure-api.net",
"hostnameConfigurations": [
{
"type": "Proxy",
"hostName": "apimService1.azure-api.net",
"negotiateClientCertificate": false,
"defaultSslBinding": true,
"certificateSource": "BuiltIn"
}
],
"virtualNetworkType": "None",
"disableGateway": false,
"publicNetworkAccess": "Enabled",
"platformVersion": "undetermined"
},
"sku": {
"name": "Standard",
"capacity": 1
},
"systemData": {
"createdBy": "user@contoso.com",
"createdByType": "User",
"createdAt": "2022-07-11T18:41:00.9390609Z",
"lastModifiedBy": "user@contoso.com",
"lastModifiedByType": "User",
"lastModifiedAt": "2022-07-11T18:41:00.9390609Z"
}
}
{
"id": "/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.ApiManagement/service/apimService1",
"name": "apimService1",
"type": "Microsoft.ApiManagement/service",
"tags": {
"api-version": "2022-08-01"
},
"location": "East US",
"etag": "AAAAAAAmREI=",
"properties": {
"publisherEmail": "samir@microsoft.com",
"publisherName": "foo",
"notificationSenderEmail": "apimgmt-noreply@mail.windowsazure.com",
"provisioningState": "Succeeded",
"targetProvisioningState": "",
"createdAtUtc": "2022-07-11T18:41:01.2506031Z",
"gatewayUrl": "https://apimService1.azure-api.net",
"gatewayRegionalUrl": "https://apimService1-eastus-01.regional.azure-api.net",
"portalUrl": "https://apimService1.portal.azure-api.net",
"developerPortalUrl": "https://apimService1.developer.azure-api.net",
"managementApiUrl": "https://apimService1.management.azure-api.net",
"scmUrl": "https://apimService1.scm.azure-api.net",
"hostnameConfigurations": [
{
"type": "Proxy",
"hostName": "apimService1.azure-api.net",
"negotiateClientCertificate": false,
"defaultSslBinding": true,
"certificateSource": "BuiltIn"
}
],
"publicIPAddresses": [
"13.90.229.33"
],
"customProperties": {
"Microsoft.WindowsAzure.ApiManagement.Gateway.Security.Protocols.Tls10": "False",
"Microsoft.WindowsAzure.ApiManagement.Gateway.Security.Protocols.Tls11": "False",
"Microsoft.WindowsAzure.ApiManagement.Gateway.Security.Protocols.Ssl30": "False",
"Microsoft.WindowsAzure.ApiManagement.Gateway.Security.Ciphers.TripleDes168": "False",
"Microsoft.WindowsAzure.ApiManagement.Gateway.Security.Backend.Protocols.Tls10": "False",
"Microsoft.WindowsAzure.ApiManagement.Gateway.Security.Backend.Protocols.Tls11": "False",
"Microsoft.WindowsAzure.ApiManagement.Gateway.Security.Backend.Protocols.Ssl30": "False",
"Microsoft.WindowsAzure.ApiManagement.Gateway.Protocols.Server.Http2": "False"
},
"virtualNetworkType": "None",
"disableGateway": false,
"publicNetworkAccess": "Enabled",
"platformVersion": "stv1"
},
"sku": {
"name": "Standard",
"capacity": 1
},
"systemData": {
"createdBy": "user@contoso.com",
"createdByType": "User",
"createdAt": "2022-07-11T18:41:00.9390609Z",
"lastModifiedBy": "user@contoso.com",
"lastModifiedByType": "User",
"lastModifiedAt": "2022-07-11T18:41:00.9390609Z"
}
}
ApiManagementCreateServiceHavingMsi
Sample Request
PUT https://management.azure.com/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.ApiManagement/service/apimService1?api-version=2022-08-01
{
"properties": {
"publisherEmail": "apim@autorestsdk.com",
"publisherName": "autorestsdk"
},
"sku": {
"name": "Consumption",
"capacity": 0
},
"identity": {
"type": "SystemAssigned"
},
"location": "West US",
"tags": {
"tag1": "value1",
"tag2": "value2",
"tag3": "value3"
}
}
import com.azure.resourcemanager.apimanagement.models.ApiManagementServiceIdentity;
import com.azure.resourcemanager.apimanagement.models.ApiManagementServiceSkuProperties;
import com.azure.resourcemanager.apimanagement.models.ApimIdentityType;
import com.azure.resourcemanager.apimanagement.models.SkuType;
import java.util.HashMap;
import java.util.Map;
/** Samples for ApiManagementService CreateOrUpdate. */
public final class Main {
/*
* x-ms-original-file: specification/apimanagement/resource-manager/Microsoft.ApiManagement/stable/2022-08-01/examples/ApiManagementCreateServiceHavingMsi.json
*/
/**
* Sample code: ApiManagementCreateServiceHavingMsi.
*
* @param manager Entry point to ApiManagementManager.
*/
public static void apiManagementCreateServiceHavingMsi(
com.azure.resourcemanager.apimanagement.ApiManagementManager manager) {
manager
.apiManagementServices()
.define("apimService1")
.withRegion("West US")
.withExistingResourceGroup("rg1")
.withSku(new ApiManagementServiceSkuProperties().withName(SkuType.CONSUMPTION).withCapacity(0))
.withPublisherEmail("apim@autorestsdk.com")
.withPublisherName("autorestsdk")
.withTags(mapOf("tag1", "value1", "tag2", "value2", "tag3", "value3"))
.withIdentity(new ApiManagementServiceIdentity().withType(ApimIdentityType.SYSTEM_ASSIGNED))
.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 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_service_having_msi.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.api_management_service.begin_create_or_update(
resource_group_name="rg1",
service_name="apimService1",
parameters={
"identity": {"type": "SystemAssigned"},
"location": "West US",
"properties": {"publisherEmail": "apim@autorestsdk.com", "publisherName": "autorestsdk"},
"sku": {"capacity": 0, "name": "Consumption"},
"tags": {"tag1": "value1", "tag2": "value2", "tag3": "value3"},
},
).result()
print(response)
# x-ms-original-file: specification/apimanagement/resource-manager/Microsoft.ApiManagement/stable/2022-08-01/examples/ApiManagementCreateServiceHavingMsi.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/ApiManagementCreateServiceHavingMsi.json
func ExampleServiceClient_BeginCreateOrUpdate_apiManagementCreateServiceHavingMsi() {
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)
}
poller, err := clientFactory.NewServiceClient().BeginCreateOrUpdate(ctx, "rg1", "apimService1", armapimanagement.ServiceResource{
Tags: map[string]*string{
"tag1": to.Ptr("value1"),
"tag2": to.Ptr("value2"),
"tag3": to.Ptr("value3"),
},
Identity: &armapimanagement.ServiceIdentity{
Type: to.Ptr(armapimanagement.ApimIdentityTypeSystemAssigned),
},
Location: to.Ptr("West US"),
Properties: &armapimanagement.ServiceProperties{
PublisherEmail: to.Ptr("apim@autorestsdk.com"),
PublisherName: to.Ptr("autorestsdk"),
},
SKU: &armapimanagement.ServiceSKUProperties{
Name: to.Ptr(armapimanagement.SKUTypeConsumption),
Capacity: to.Ptr[int32](0),
},
}, nil)
if err != nil {
log.Fatalf("failed to finish the request: %v", err)
}
res, err := poller.PollUntilDone(ctx, nil)
if err != nil {
log.Fatalf("failed to pull the result: %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.ServiceResource = armapimanagement.ServiceResource{
// Name: to.Ptr("apimService1"),
// Type: to.Ptr("Microsoft.ApiManagement/service"),
// ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.ApiManagement/service/apimService1"),
// Tags: map[string]*string{
// "tag1": to.Ptr("value1"),
// "tag2": to.Ptr("value2"),
// "tag3": to.Ptr("value3"),
// },
// Etag: to.Ptr("AAAAAAAAWiU="),
// Identity: &armapimanagement.ServiceIdentity{
// Type: to.Ptr(armapimanagement.ApimIdentityTypeSystemAssigned),
// PrincipalID: to.Ptr("dfb9a757-df69-4966-a8d0-711a9cd8ffb4"),
// TenantID: to.Ptr("00000000-86f1-41af-91ab-2d7cd011db47"),
// },
// Location: to.Ptr("West US"),
// Properties: &armapimanagement.ServiceProperties{
// CreatedAtUTC: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2019-04-11T16:29:29.971Z"); return t}()),
// EnableClientCertificate: to.Ptr(false),
// GatewayURL: to.Ptr("https://apimService1.azure-api.net"),
// HostnameConfigurations: []*armapimanagement.HostnameConfiguration{
// {
// Type: to.Ptr(armapimanagement.HostnameTypeProxy),
// CertificateSource: to.Ptr(armapimanagement.CertificateSourceBuiltIn),
// DefaultSSLBinding: to.Ptr(true),
// HostName: to.Ptr("apimService1.azure-api.net"),
// NegotiateClientCertificate: to.Ptr(false),
// }},
// NotificationSenderEmail: to.Ptr("apimgmt-noreply@mail.windowsazure.com"),
// PlatformVersion: to.Ptr(armapimanagement.PlatformVersionMtv1),
// ProvisioningState: to.Ptr("Succeeded"),
// TargetProvisioningState: to.Ptr(""),
// VirtualNetworkType: to.Ptr(armapimanagement.VirtualNetworkTypeNone),
// PublisherEmail: to.Ptr("apim@autorestsdk.com"),
// PublisherName: to.Ptr("autorestsdk"),
// },
// SKU: &armapimanagement.ServiceSKUProperties{
// Name: to.Ptr(armapimanagement.SKUTypeConsumption),
// Capacity: to.Ptr[int32](0),
// },
// SystemData: &armapimanagement.SystemData{
// CreatedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2020-02-01T01:01:01.107Z"); return t}()),
// CreatedBy: to.Ptr("string"),
// CreatedByType: to.Ptr(armapimanagement.CreatedByTypeApplication),
// LastModifiedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2020-02-02T02:03:01.197Z"); return t}()),
// LastModifiedBy: to.Ptr("string"),
// LastModifiedByType: to.Ptr(armapimanagement.CreatedByTypeApplication),
// },
// }
}
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 an API Management service. This is long running operation and could take several minutes to complete.
*
* @summary Creates or updates an API Management service. This is long running operation and could take several minutes to complete.
* x-ms-original-file: specification/apimanagement/resource-manager/Microsoft.ApiManagement/stable/2022-08-01/examples/ApiManagementCreateServiceHavingMsi.json
*/
async function apiManagementCreateServiceHavingMsi() {
const subscriptionId = process.env["APIMANAGEMENT_SUBSCRIPTION_ID"] || "subid";
const resourceGroupName = process.env["APIMANAGEMENT_RESOURCE_GROUP"] || "rg1";
const serviceName = "apimService1";
const parameters = {
identity: { type: "SystemAssigned" },
location: "West US",
publisherEmail: "apim@autorestsdk.com",
publisherName: "autorestsdk",
sku: { name: "Consumption", capacity: 0 },
tags: { tag1: "value1", tag2: "value2", tag3: "value3" },
};
const credential = new DefaultAzureCredential();
const client = new ApiManagementClient(credential, subscriptionId);
const result = await client.apiManagementService.beginCreateOrUpdateAndWait(
resourceGroupName,
serviceName,
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
Sample Response
Location: https://management.azure.com/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.ApiManagement/service/apimService1/operationresults/ZWFzdHVzOmFuZHktdGVzdGluZy0yMDIyLTA0LTAxLXByZXZpZXctNF9BY3RfODQ2ZWE4Ng==?api-version=2022-08-01&asyncResponse
Azure-AsyncOperation: https://management.azure.com/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.ApiManagement/service/apimService1/operationresults/ZWFzdHVzOmFuZHktdGVzdGluZy0yMDIyLTA0LTAxLXByZXZpZXctNF9BY3RfODQ2ZWE4Ng==?api-version=2022-08-01&asyncResponse
{
"id": "/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.ApiManagement/service/apimService1",
"name": "apimService1",
"type": "Microsoft.ApiManagement/service",
"tags": {
"tag1": "value1",
"tag2": "value2",
"tag3": "value3"
},
"location": "West US",
"etag": "AAAAAAAAWiE=",
"properties": {
"publisherEmail": "apim@autorestsdk.com",
"publisherName": "autorestsdk",
"notificationSenderEmail": "apimgmt-noreply@mail.windowsazure.com",
"provisioningState": "Created",
"targetProvisioningState": "Activating",
"createdAtUtc": "2019-04-11T16:29:29.9711098Z",
"hostnameConfigurations": [
{
"type": "Proxy",
"hostName": "apimService1.azure-api.net",
"negotiateClientCertificate": false,
"defaultSslBinding": true
}
],
"virtualNetworkType": "None"
},
"sku": {
"name": "Consumption",
"capacity": 0
},
"identity": {
"type": "SystemAssigned",
"principalId": "dfb9a757-df69-4966-a8d0-711a9cd8ffb4",
"tenantId": "00000000-86f1-41af-91ab-2d7cd011db47"
},
"systemData": {
"createdBy": "string",
"createdByType": "Application",
"createdAt": "2020-02-01T01:01:01.1075056Z",
"lastModifiedBy": "string",
"lastModifiedByType": "Application",
"lastModifiedAt": "2020-02-02T02:03:01.1974346Z"
}
}
{
"id": "/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.ApiManagement/service/apimService1",
"name": "apimService1",
"type": "Microsoft.ApiManagement/service",
"tags": {
"tag1": "value1",
"tag2": "value2",
"tag3": "value3"
},
"location": "West US",
"etag": "AAAAAAAAWiU=",
"properties": {
"publisherEmail": "apim@autorestsdk.com",
"publisherName": "autorestsdk",
"notificationSenderEmail": "apimgmt-noreply@mail.windowsazure.com",
"provisioningState": "Succeeded",
"targetProvisioningState": "",
"createdAtUtc": "2019-04-11T16:29:29.9711098Z",
"gatewayUrl": "https://apimService1.azure-api.net",
"hostnameConfigurations": [
{
"type": "Proxy",
"hostName": "apimService1.azure-api.net",
"negotiateClientCertificate": false,
"defaultSslBinding": true,
"certificateSource": "BuiltIn"
}
],
"virtualNetworkType": "None",
"enableClientCertificate": false,
"platformVersion": "mtv1"
},
"sku": {
"name": "Consumption",
"capacity": 0
},
"identity": {
"type": "SystemAssigned",
"principalId": "dfb9a757-df69-4966-a8d0-711a9cd8ffb4",
"tenantId": "00000000-86f1-41af-91ab-2d7cd011db47"
},
"systemData": {
"createdBy": "string",
"createdByType": "Application",
"createdAt": "2020-02-01T01:01:01.1075056Z",
"lastModifiedBy": "string",
"lastModifiedByType": "Application",
"lastModifiedAt": "2020-02-02T02:03:01.1974346Z"
}
}
ApiManagementCreateServiceInVnetWithPublicIP
Sample Request
PUT https://management.azure.com/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.ApiManagement/service/apimService1?api-version=2022-08-01
{
"properties": {
"publisherEmail": "apim@autorestsdk.com",
"publisherName": "autorestsdk",
"virtualNetworkConfiguration": {
"subnetResourceId": "/subscriptions/subid/resourceGroups/rgName/providers/Microsoft.Network/virtualNetworks/apimcus/subnets/tenant"
},
"publicIpAddressId": "/subscriptions/subid/resourceGroups/rgName/providers/Microsoft.Network/publicIPAddresses/apimazvnet",
"virtualNetworkType": "External"
},
"sku": {
"name": "Premium",
"capacity": 2
},
"zones": [
"1",
"2"
],
"location": "East US 2 EUAP",
"tags": {
"tag1": "value1",
"tag2": "value2",
"tag3": "value3"
}
}
import com.azure.resourcemanager.apimanagement.models.ApiManagementServiceSkuProperties;
import com.azure.resourcemanager.apimanagement.models.SkuType;
import com.azure.resourcemanager.apimanagement.models.VirtualNetworkConfiguration;
import com.azure.resourcemanager.apimanagement.models.VirtualNetworkType;
import java.util.Arrays;
import java.util.HashMap;
import java.util.Map;
/** Samples for ApiManagementService CreateOrUpdate. */
public final class Main {
/*
* x-ms-original-file: specification/apimanagement/resource-manager/Microsoft.ApiManagement/stable/2022-08-01/examples/ApiManagementCreateServiceInVnetWithPublicIP.json
*/
/**
* Sample code: ApiManagementCreateServiceInVnetWithPublicIP.
*
* @param manager Entry point to ApiManagementManager.
*/
public static void apiManagementCreateServiceInVnetWithPublicIP(
com.azure.resourcemanager.apimanagement.ApiManagementManager manager) {
manager
.apiManagementServices()
.define("apimService1")
.withRegion("East US 2 EUAP")
.withExistingResourceGroup("rg1")
.withSku(new ApiManagementServiceSkuProperties().withName(SkuType.PREMIUM).withCapacity(2))
.withPublisherEmail("apim@autorestsdk.com")
.withPublisherName("autorestsdk")
.withTags(mapOf("tag1", "value1", "tag2", "value2", "tag3", "value3"))
.withZones(Arrays.asList("1", "2"))
.withPublicIpAddressId(
"/subscriptions/subid/resourceGroups/rgName/providers/Microsoft.Network/publicIPAddresses/apimazvnet")
.withVirtualNetworkConfiguration(
new VirtualNetworkConfiguration()
.withSubnetResourceId(
"/subscriptions/subid/resourceGroups/rgName/providers/Microsoft.Network/virtualNetworks/apimcus/subnets/tenant"))
.withVirtualNetworkType(VirtualNetworkType.EXTERNAL)
.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 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_service_in_vnet_with_public_ip.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.api_management_service.begin_create_or_update(
resource_group_name="rg1",
service_name="apimService1",
parameters={
"location": "East US 2 EUAP",
"properties": {
"publicIpAddressId": "/subscriptions/subid/resourceGroups/rgName/providers/Microsoft.Network/publicIPAddresses/apimazvnet",
"publisherEmail": "apim@autorestsdk.com",
"publisherName": "autorestsdk",
"virtualNetworkConfiguration": {
"subnetResourceId": "/subscriptions/subid/resourceGroups/rgName/providers/Microsoft.Network/virtualNetworks/apimcus/subnets/tenant"
},
"virtualNetworkType": "External",
},
"sku": {"capacity": 2, "name": "Premium"},
"tags": {"tag1": "value1", "tag2": "value2", "tag3": "value3"},
"zones": ["1", "2"],
},
).result()
print(response)
# x-ms-original-file: specification/apimanagement/resource-manager/Microsoft.ApiManagement/stable/2022-08-01/examples/ApiManagementCreateServiceInVnetWithPublicIP.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/ApiManagementCreateServiceInVnetWithPublicIP.json
func ExampleServiceClient_BeginCreateOrUpdate_apiManagementCreateServiceInVnetWithPublicIp() {
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)
}
poller, err := clientFactory.NewServiceClient().BeginCreateOrUpdate(ctx, "rg1", "apimService1", armapimanagement.ServiceResource{
Tags: map[string]*string{
"tag1": to.Ptr("value1"),
"tag2": to.Ptr("value2"),
"tag3": to.Ptr("value3"),
},
Location: to.Ptr("East US 2 EUAP"),
Properties: &armapimanagement.ServiceProperties{
PublicIPAddressID: to.Ptr("/subscriptions/subid/resourceGroups/rgName/providers/Microsoft.Network/publicIPAddresses/apimazvnet"),
VirtualNetworkConfiguration: &armapimanagement.VirtualNetworkConfiguration{
SubnetResourceID: to.Ptr("/subscriptions/subid/resourceGroups/rgName/providers/Microsoft.Network/virtualNetworks/apimcus/subnets/tenant"),
},
VirtualNetworkType: to.Ptr(armapimanagement.VirtualNetworkTypeExternal),
PublisherEmail: to.Ptr("apim@autorestsdk.com"),
PublisherName: to.Ptr("autorestsdk"),
},
SKU: &armapimanagement.ServiceSKUProperties{
Name: to.Ptr(armapimanagement.SKUTypePremium),
Capacity: to.Ptr[int32](2),
},
Zones: []*string{
to.Ptr("1"),
to.Ptr("2")},
}, nil)
if err != nil {
log.Fatalf("failed to finish the request: %v", err)
}
res, err := poller.PollUntilDone(ctx, nil)
if err != nil {
log.Fatalf("failed to pull the result: %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.ServiceResource = armapimanagement.ServiceResource{
// Name: to.Ptr("apimService1"),
// Type: to.Ptr("Microsoft.ApiManagement/service"),
// ID: to.Ptr("/subscriptions/subid/resourceGroups/rgName/providers/Microsoft.ApiManagement/service/apimService1"),
// Tags: map[string]*string{
// "tag1": to.Ptr("value1"),
// "tag2": to.Ptr("value2"),
// "tag3": to.Ptr("value3"),
// },
// Etag: to.Ptr("AAAAAAAGTAs="),
// Location: to.Ptr("East US 2 EUAP"),
// Properties: &armapimanagement.ServiceProperties{
// CreatedAtUTC: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2021-02-22T06:53:46.640Z"); return t}()),
// CustomProperties: map[string]*string{
// "Microsoft.WindowsAzure.ApiManagement.Gateway.Protocols.Server.Http2": to.Ptr("False"),
// "Microsoft.WindowsAzure.ApiManagement.Gateway.Security.Backend.Protocols.Ssl30": to.Ptr("False"),
// "Microsoft.WindowsAzure.ApiManagement.Gateway.Security.Backend.Protocols.Tls10": to.Ptr("False"),
// "Microsoft.WindowsAzure.ApiManagement.Gateway.Security.Backend.Protocols.Tls11": to.Ptr("False"),
// "Microsoft.WindowsAzure.ApiManagement.Gateway.Security.Ciphers.TripleDes168": to.Ptr("False"),
// "Microsoft.WindowsAzure.ApiManagement.Gateway.Security.Protocols.Ssl30": to.Ptr("False"),
// "Microsoft.WindowsAzure.ApiManagement.Gateway.Security.Protocols.Tls10": to.Ptr("False"),
// "Microsoft.WindowsAzure.ApiManagement.Gateway.Security.Protocols.Tls11": to.Ptr("False"),
// },
// DeveloperPortalURL: to.Ptr("https://apimService1.developer.azure-api.net"),
// DisableGateway: to.Ptr(false),
// GatewayRegionalURL: to.Ptr("https://apimService1-eastus2euap-01.regional.azure-api.net"),
// GatewayURL: to.Ptr("https://apimService1.azure-api.net"),
// HostnameConfigurations: []*armapimanagement.HostnameConfiguration{
// {
// Type: to.Ptr(armapimanagement.HostnameTypeProxy),
// DefaultSSLBinding: to.Ptr(true),
// HostName: to.Ptr("apimService1.azure-api.net"),
// NegotiateClientCertificate: to.Ptr(false),
// }},
// ManagementAPIURL: to.Ptr("https://apimService1.management.azure-api.net"),
// NotificationSenderEmail: to.Ptr("apimgmt-noreply@mail.windowsazure.com"),
// PlatformVersion: to.Ptr(armapimanagement.PlatformVersionStv2),
// PortalURL: to.Ptr("https://apimService1.portal.azure-api.net"),
// ProvisioningState: to.Ptr("Succeeded"),
// PublicIPAddresses: []*string{
// to.Ptr("20.47.137.XXX")},
// PublicIPAddressID: to.Ptr("/subscriptions/subid/resourceGroups/rgName/providers/Microsoft.Network/publicIPAddresses/apimazvnet"),
// ScmURL: to.Ptr("https://apimService1.scm.azure-api.net"),
// TargetProvisioningState: to.Ptr(""),
// VirtualNetworkConfiguration: &armapimanagement.VirtualNetworkConfiguration{
// SubnetResourceID: to.Ptr("/subscriptions/subid/resourceGroups/rgName/providers/Microsoft.Network/virtualNetworks/apimcus/subnets/tenant"),
// },
// VirtualNetworkType: to.Ptr(armapimanagement.VirtualNetworkTypeExternal),
// PublisherEmail: to.Ptr("apim@autorestsdk.com"),
// PublisherName: to.Ptr("autorestsdk"),
// },
// SKU: &armapimanagement.ServiceSKUProperties{
// Name: to.Ptr(armapimanagement.SKUTypePremium),
// Capacity: to.Ptr[int32](2),
// },
// SystemData: &armapimanagement.SystemData{
// CreatedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2020-02-01T01:01:01.107Z"); return t}()),
// CreatedBy: to.Ptr("string"),
// CreatedByType: to.Ptr(armapimanagement.CreatedByTypeApplication),
// LastModifiedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2020-02-02T02:03:01.197Z"); return t}()),
// LastModifiedBy: to.Ptr("string"),
// LastModifiedByType: to.Ptr(armapimanagement.CreatedByTypeApplication),
// },
// Zones: []*string{
// to.Ptr("1"),
// to.Ptr("2")},
// }
}
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 an API Management service. This is long running operation and could take several minutes to complete.
*
* @summary Creates or updates an API Management service. This is long running operation and could take several minutes to complete.
* x-ms-original-file: specification/apimanagement/resource-manager/Microsoft.ApiManagement/stable/2022-08-01/examples/ApiManagementCreateServiceInVnetWithPublicIP.json
*/
async function apiManagementCreateServiceInVnetWithPublicIP() {
const subscriptionId = process.env["APIMANAGEMENT_SUBSCRIPTION_ID"] || "subid";
const resourceGroupName = process.env["APIMANAGEMENT_RESOURCE_GROUP"] || "rg1";
const serviceName = "apimService1";
const parameters = {
location: "East US 2 EUAP",
publicIpAddressId:
"/subscriptions/subid/resourceGroups/rgName/providers/Microsoft.Network/publicIPAddresses/apimazvnet",
publisherEmail: "apim@autorestsdk.com",
publisherName: "autorestsdk",
sku: { name: "Premium", capacity: 2 },
tags: { tag1: "value1", tag2: "value2", tag3: "value3" },
virtualNetworkConfiguration: {
subnetResourceId:
"/subscriptions/subid/resourceGroups/rgName/providers/Microsoft.Network/virtualNetworks/apimcus/subnets/tenant",
},
virtualNetworkType: "External",
zones: ["1", "2"],
};
const credential = new DefaultAzureCredential();
const client = new ApiManagementClient(credential, subscriptionId);
const result = await client.apiManagementService.beginCreateOrUpdateAndWait(
resourceGroupName,
serviceName,
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
Sample Response
Location: https://management.azure.com/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.ApiManagement/service/apimService1/operationresults/ZWFzdHVzOmFuZHktdGVzdGluZy0yMDIyLTA0LTAxLXByZXZpZXctNF9BY3RfODQ2ZWE4Ng==?api-version=2022-08-01&asyncResponse
Azure-AsyncOperation: https://management.azure.com/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.ApiManagement/service/apimService1/operationresults/ZWFzdHVzOmFuZHktdGVzdGluZy0yMDIyLTA0LTAxLXByZXZpZXctNF9BY3RfODQ2ZWE4Ng==?api-version=2022-08-01&asyncResponse
{
"id": "/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.ApiManagement/service/apimService1",
"name": "apimService1",
"type": "Microsoft.ApiManagement/service",
"tags": {
"tag1": "value1",
"tag2": "value2",
"tag3": "value3"
},
"location": "East US 2 EUAP",
"etag": "AAAAAAAiXto=",
"properties": {
"publisherEmail": "apim@autorestsdk.com",
"publisherName": "autorestsdk",
"notificationSenderEmail": "apimgmt-noreply@mail.windowsazure.com",
"provisioningState": "Created",
"targetProvisioningState": "Activating",
"createdAtUtc": "2020-07-28T23:18:14.6562474Z",
"hostnameConfigurations": [
{
"type": "Proxy",
"hostName": "apimService1.azure-api.net",
"negotiateClientCertificate": false,
"defaultSslBinding": true,
"certificateSource": "BuiltIn"
}
],
"publicIpAddressId": "/subscriptions/subid/resourceGroups/rgName/providers/Microsoft.Network/publicIPAddresses/apimazvnet",
"virtualNetworkConfiguration": {
"subnetResourceId": "/subscriptions/subid/resourceGroups/rgName/providers/Microsoft.Network/virtualNetworks/apimcus/subnets/tenant"
},
"virtualNetworkType": "External",
"disableGateway": false,
"platformVersion": "stv2"
},
"sku": {
"name": "Premium",
"capacity": 2
},
"zones": [
"1",
"2"
],
"systemData": {
"createdBy": "string",
"createdByType": "Application",
"createdAt": "2020-02-01T01:01:01.1075056Z",
"lastModifiedBy": "string",
"lastModifiedByType": "Application",
"lastModifiedAt": "2020-02-02T02:03:01.1974346Z"
}
}
{
"id": "/subscriptions/subid/resourceGroups/rgName/providers/Microsoft.ApiManagement/service/apimService1",
"name": "apimService1",
"type": "Microsoft.ApiManagement/service",
"tags": {
"tag1": "value1",
"tag2": "value2",
"tag3": "value3"
},
"location": "East US 2 EUAP",
"etag": "AAAAAAAGTAs=",
"properties": {
"publisherEmail": "apim@autorestsdk.com",
"publisherName": "autorestsdk",
"notificationSenderEmail": "apimgmt-noreply@mail.windowsazure.com",
"provisioningState": "Succeeded",
"targetProvisioningState": "",
"createdAtUtc": "2021-02-22T06:53:46.6409875Z",
"gatewayUrl": "https://apimService1.azure-api.net",
"gatewayRegionalUrl": "https://apimService1-eastus2euap-01.regional.azure-api.net",
"portalUrl": "https://apimService1.portal.azure-api.net",
"developerPortalUrl": "https://apimService1.developer.azure-api.net",
"managementApiUrl": "https://apimService1.management.azure-api.net",
"scmUrl": "https://apimService1.scm.azure-api.net",
"hostnameConfigurations": [
{
"type": "Proxy",
"hostName": "apimService1.azure-api.net",
"negotiateClientCertificate": false,
"defaultSslBinding": true
}
],
"publicIPAddresses": [
"20.47.137.XXX"
],
"publicIpAddressId": "/subscriptions/subid/resourceGroups/rgName/providers/Microsoft.Network/publicIPAddresses/apimazvnet",
"virtualNetworkConfiguration": {
"subnetResourceId": "/subscriptions/subid/resourceGroups/rgName/providers/Microsoft.Network/virtualNetworks/apimcus/subnets/tenant"
},
"customProperties": {
"Microsoft.WindowsAzure.ApiManagement.Gateway.Security.Protocols.Tls10": "False",
"Microsoft.WindowsAzure.ApiManagement.Gateway.Security.Protocols.Tls11": "False",
"Microsoft.WindowsAzure.ApiManagement.Gateway.Security.Protocols.Ssl30": "False",
"Microsoft.WindowsAzure.ApiManagement.Gateway.Security.Ciphers.TripleDes168": "False",
"Microsoft.WindowsAzure.ApiManagement.Gateway.Security.Backend.Protocols.Tls10": "False",
"Microsoft.WindowsAzure.ApiManagement.Gateway.Security.Backend.Protocols.Tls11": "False",
"Microsoft.WindowsAzure.ApiManagement.Gateway.Security.Backend.Protocols.Ssl30": "False",
"Microsoft.WindowsAzure.ApiManagement.Gateway.Protocols.Server.Http2": "False"
},
"virtualNetworkType": "External",
"disableGateway": false,
"platformVersion": "stv2"
},
"sku": {
"name": "Premium",
"capacity": 2
},
"zones": [
"1",
"2"
],
"systemData": {
"createdBy": "string",
"createdByType": "Application",
"createdAt": "2020-02-01T01:01:01.1075056Z",
"lastModifiedBy": "string",
"lastModifiedByType": "Application",
"lastModifiedAt": "2020-02-02T02:03:01.1974346Z"
}
}
ApiManagementCreateServiceInZones
Sample Request
PUT https://management.azure.com/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.ApiManagement/service/apimService1?api-version=2022-08-01
{
"properties": {
"publisherEmail": "apim@autorestsdk.com",
"publisherName": "autorestsdk"
},
"sku": {
"name": "Premium",
"capacity": 2
},
"zones": [
"1",
"2"
],
"location": "North europe",
"tags": {
"tag1": "value1",
"tag2": "value2",
"tag3": "value3"
}
}
import com.azure.resourcemanager.apimanagement.models.ApiManagementServiceSkuProperties;
import com.azure.resourcemanager.apimanagement.models.SkuType;
import java.util.Arrays;
import java.util.HashMap;
import java.util.Map;
/** Samples for ApiManagementService CreateOrUpdate. */
public final class Main {
/*
* x-ms-original-file: specification/apimanagement/resource-manager/Microsoft.ApiManagement/stable/2022-08-01/examples/ApiManagementCreateServiceInZones.json
*/
/**
* Sample code: ApiManagementCreateServiceInZones.
*
* @param manager Entry point to ApiManagementManager.
*/
public static void apiManagementCreateServiceInZones(
com.azure.resourcemanager.apimanagement.ApiManagementManager manager) {
manager
.apiManagementServices()
.define("apimService1")
.withRegion("North europe")
.withExistingResourceGroup("rg1")
.withSku(new ApiManagementServiceSkuProperties().withName(SkuType.PREMIUM).withCapacity(2))
.withPublisherEmail("apim@autorestsdk.com")
.withPublisherName("autorestsdk")
.withTags(mapOf("tag1", "value1", "tag2", "value2", "tag3", "value3"))
.withZones(Arrays.asList("1", "2"))
.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 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_service_in_zones.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.api_management_service.begin_create_or_update(
resource_group_name="rg1",
service_name="apimService1",
parameters={
"location": "North europe",
"properties": {"publisherEmail": "apim@autorestsdk.com", "publisherName": "autorestsdk"},
"sku": {"capacity": 2, "name": "Premium"},
"tags": {"tag1": "value1", "tag2": "value2", "tag3": "value3"},
"zones": ["1", "2"],
},
).result()
print(response)
# x-ms-original-file: specification/apimanagement/resource-manager/Microsoft.ApiManagement/stable/2022-08-01/examples/ApiManagementCreateServiceInZones.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/ApiManagementCreateServiceInZones.json
func ExampleServiceClient_BeginCreateOrUpdate_apiManagementCreateServiceInZones() {
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)
}
poller, err := clientFactory.NewServiceClient().BeginCreateOrUpdate(ctx, "rg1", "apimService1", armapimanagement.ServiceResource{
Tags: map[string]*string{
"tag1": to.Ptr("value1"),
"tag2": to.Ptr("value2"),
"tag3": to.Ptr("value3"),
},
Location: to.Ptr("North europe"),
Properties: &armapimanagement.ServiceProperties{
PublisherEmail: to.Ptr("apim@autorestsdk.com"),
PublisherName: to.Ptr("autorestsdk"),
},
SKU: &armapimanagement.ServiceSKUProperties{
Name: to.Ptr(armapimanagement.SKUTypePremium),
Capacity: to.Ptr[int32](2),
},
Zones: []*string{
to.Ptr("1"),
to.Ptr("2")},
}, nil)
if err != nil {
log.Fatalf("failed to finish the request: %v", err)
}
res, err := poller.PollUntilDone(ctx, nil)
if err != nil {
log.Fatalf("failed to pull the result: %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.ServiceResource = armapimanagement.ServiceResource{
// Name: to.Ptr("apimService1"),
// Type: to.Ptr("Microsoft.ApiManagement/service"),
// ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.ApiManagement/service/apimService1"),
// Tags: map[string]*string{
// "tag1": to.Ptr("value1"),
// "tag2": to.Ptr("value2"),
// "tag3": to.Ptr("value3"),
// },
// Etag: to.Ptr("AAAAAAAiXvE="),
// Location: to.Ptr("North Europe"),
// Properties: &armapimanagement.ServiceProperties{
// CreatedAtUTC: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2020-07-28T23:18:14.656Z"); return t}()),
// CustomProperties: map[string]*string{
// "Microsoft.WindowsAzure.ApiManagement.Gateway.Protocols.Server.Http2": to.Ptr("False"),
// "Microsoft.WindowsAzure.ApiManagement.Gateway.Security.Backend.Protocols.Ssl30": to.Ptr("False"),
// "Microsoft.WindowsAzure.ApiManagement.Gateway.Security.Backend.Protocols.Tls10": to.Ptr("False"),
// "Microsoft.WindowsAzure.ApiManagement.Gateway.Security.Backend.Protocols.Tls11": to.Ptr("False"),
// "Microsoft.WindowsAzure.ApiManagement.Gateway.Security.Ciphers.TripleDes168": to.Ptr("False"),
// "Microsoft.WindowsAzure.ApiManagement.Gateway.Security.Protocols.Ssl30": to.Ptr("False"),
// "Microsoft.WindowsAzure.ApiManagement.Gateway.Security.Protocols.Tls10": to.Ptr("False"),
// "Microsoft.WindowsAzure.ApiManagement.Gateway.Security.Protocols.Tls11": to.Ptr("False"),
// },
// DeveloperPortalURL: to.Ptr("https://apimService1.developer.azure-api.net"),
// DisableGateway: to.Ptr(false),
// GatewayRegionalURL: to.Ptr("https://apimService1-northeurope-01.regional.azure-api.net"),
// GatewayURL: to.Ptr("https://apimService1.azure-api.net"),
// HostnameConfigurations: []*armapimanagement.HostnameConfiguration{
// {
// Type: to.Ptr(armapimanagement.HostnameTypeProxy),
// DefaultSSLBinding: to.Ptr(true),
// HostName: to.Ptr("apimService1.azure-api.net"),
// NegotiateClientCertificate: to.Ptr(false),
// }},
// ManagementAPIURL: to.Ptr("https://apimService1.management.azure-api.net"),
// NotificationSenderEmail: to.Ptr("apimgmt-noreply@mail.windowsazure.com"),
// PlatformVersion: to.Ptr(armapimanagement.PlatformVersionStv2),
// PortalURL: to.Ptr("https://apimService1.portal.azure-api.net"),
// ProvisioningState: to.Ptr("Succeeded"),
// PublicIPAddresses: []*string{
// to.Ptr("20.54.34.66")},
// ScmURL: to.Ptr("https://apimService1.scm.azure-api.net"),
// TargetProvisioningState: to.Ptr(""),
// VirtualNetworkType: to.Ptr(armapimanagement.VirtualNetworkTypeNone),
// PublisherEmail: to.Ptr("apim@autorestsdk.com"),
// PublisherName: to.Ptr("autorestsdk"),
// },
// SKU: &armapimanagement.ServiceSKUProperties{
// Name: to.Ptr(armapimanagement.SKUTypePremium),
// Capacity: to.Ptr[int32](2),
// },
// SystemData: &armapimanagement.SystemData{
// CreatedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2020-02-01T01:01:01.107Z"); return t}()),
// CreatedBy: to.Ptr("string"),
// CreatedByType: to.Ptr(armapimanagement.CreatedByTypeApplication),
// LastModifiedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2020-02-02T02:03:01.197Z"); return t}()),
// LastModifiedBy: to.Ptr("string"),
// LastModifiedByType: to.Ptr(armapimanagement.CreatedByTypeApplication),
// },
// Zones: []*string{
// to.Ptr("1"),
// to.Ptr("2")},
// }
}
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 an API Management service. This is long running operation and could take several minutes to complete.
*
* @summary Creates or updates an API Management service. This is long running operation and could take several minutes to complete.
* x-ms-original-file: specification/apimanagement/resource-manager/Microsoft.ApiManagement/stable/2022-08-01/examples/ApiManagementCreateServiceInZones.json
*/
async function apiManagementCreateServiceInZones() {
const subscriptionId = process.env["APIMANAGEMENT_SUBSCRIPTION_ID"] || "subid";
const resourceGroupName = process.env["APIMANAGEMENT_RESOURCE_GROUP"] || "rg1";
const serviceName = "apimService1";
const parameters = {
location: "North europe",
publisherEmail: "apim@autorestsdk.com",
publisherName: "autorestsdk",
sku: { name: "Premium", capacity: 2 },
tags: { tag1: "value1", tag2: "value2", tag3: "value3" },
zones: ["1", "2"],
};
const credential = new DefaultAzureCredential();
const client = new ApiManagementClient(credential, subscriptionId);
const result = await client.apiManagementService.beginCreateOrUpdateAndWait(
resourceGroupName,
serviceName,
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
Sample Response
Location: https://management.azure.com/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.ApiManagement/service/apimService1/operationresults/ZWFzdHVzOmFuZHktdGVzdGluZy0yMDIyLTA0LTAxLXByZXZpZXctNF9BY3RfODQ2ZWE4Ng==?api-version=2022-08-01&asyncResponse
Azure-AsyncOperation: https://management.azure.com/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.ApiManagement/service/apimService1/operationresults/ZWFzdHVzOmFuZHktdGVzdGluZy0yMDIyLTA0LTAxLXByZXZpZXctNF9BY3RfODQ2ZWE4Ng==?api-version=2022-08-01&asyncResponse
{
"id": "/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.ApiManagement/service/apimService1",
"name": "apimService1",
"type": "Microsoft.ApiManagement/service",
"tags": {
"tag1": "value1",
"tag2": "value2",
"tag3": "value3"
},
"location": "North Europe",
"etag": "AAAAAAAiXto=",
"properties": {
"publisherEmail": "apim@autorestsdk.com",
"publisherName": "autorestsdk",
"notificationSenderEmail": "apimgmt-noreply@mail.windowsazure.com",
"provisioningState": "Created",
"targetProvisioningState": "Activating",
"createdAtUtc": "2020-07-28T23:18:14.6562474Z",
"hostnameConfigurations": [
{
"type": "Proxy",
"hostName": "apimService1.azure-api.net",
"negotiateClientCertificate": false,
"defaultSslBinding": true,
"certificateSource": "BuiltIn"
}
],
"virtualNetworkType": "None",
"disableGateway": false,
"platformVersion": "stv2"
},
"sku": {
"name": "Premium",
"capacity": 2
},
"zones": [
"1",
"2"
],
"systemData": {
"createdBy": "string",
"createdByType": "Application",
"createdAt": "2020-02-01T01:01:01.1075056Z",
"lastModifiedBy": "string",
"lastModifiedByType": "Application",
"lastModifiedAt": "2020-02-02T02:03:01.1974346Z"
}
}
{
"id": "/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.ApiManagement/service/apimService1",
"name": "apimService1",
"type": "Microsoft.ApiManagement/service",
"tags": {
"tag1": "value1",
"tag2": "value2",
"tag3": "value3"
},
"location": "North Europe",
"etag": "AAAAAAAiXvE=",
"properties": {
"publisherEmail": "apim@autorestsdk.com",
"publisherName": "autorestsdk",
"notificationSenderEmail": "apimgmt-noreply@mail.windowsazure.com",
"provisioningState": "Succeeded",
"targetProvisioningState": "",
"createdAtUtc": "2020-07-28T23:18:14.6562474Z",
"gatewayUrl": "https://apimService1.azure-api.net",
"gatewayRegionalUrl": "https://apimService1-northeurope-01.regional.azure-api.net",
"portalUrl": "https://apimService1.portal.azure-api.net",
"developerPortalUrl": "https://apimService1.developer.azure-api.net",
"managementApiUrl": "https://apimService1.management.azure-api.net",
"scmUrl": "https://apimService1.scm.azure-api.net",
"hostnameConfigurations": [
{
"type": "Proxy",
"hostName": "apimService1.azure-api.net",
"negotiateClientCertificate": false,
"defaultSslBinding": true
}
],
"publicIPAddresses": [
"20.54.34.66"
],
"customProperties": {
"Microsoft.WindowsAzure.ApiManagement.Gateway.Security.Protocols.Tls10": "False",
"Microsoft.WindowsAzure.ApiManagement.Gateway.Security.Protocols.Tls11": "False",
"Microsoft.WindowsAzure.ApiManagement.Gateway.Security.Protocols.Ssl30": "False",
"Microsoft.WindowsAzure.ApiManagement.Gateway.Security.Ciphers.TripleDes168": "False",
"Microsoft.WindowsAzure.ApiManagement.Gateway.Security.Backend.Protocols.Tls10": "False",
"Microsoft.WindowsAzure.ApiManagement.Gateway.Security.Backend.Protocols.Tls11": "False",
"Microsoft.WindowsAzure.ApiManagement.Gateway.Security.Backend.Protocols.Ssl30": "False",
"Microsoft.WindowsAzure.ApiManagement.Gateway.Protocols.Server.Http2": "False"
},
"virtualNetworkType": "None",
"disableGateway": false,
"platformVersion": "stv2"
},
"sku": {
"name": "Premium",
"capacity": 2
},
"zones": [
"1",
"2"
],
"systemData": {
"createdBy": "string",
"createdByType": "Application",
"createdAt": "2020-02-01T01:01:01.1075056Z",
"lastModifiedBy": "string",
"lastModifiedByType": "Application",
"lastModifiedAt": "2020-02-02T02:03:01.1974346Z"
}
}
ApiManagementCreateServiceWithCustomHostnameKeyVault
Sample Request
PUT https://management.azure.com/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.ApiManagement/service/apimService1?api-version=2022-08-01
{
"properties": {
"hostnameConfigurations": [
{
"type": "Proxy",
"hostName": "gateway1.msitesting.net",
"keyVaultId": "https://rpbvtkeyvaultintegration.vault.azure.net/secrets/msitestingCert",
"identityClientId": "329419bc-adec-4dce-9568-25a6d486e468",
"defaultSslBinding": true
},
{
"type": "Management",
"hostName": "mgmt.msitesting.net",
"keyVaultId": "https://rpbvtkeyvaultintegration.vault.azure.net/secrets/msitestingCert",
"identityClientId": "329419bc-adec-4dce-9568-25a6d486e468"
},
{
"type": "Portal",
"hostName": "portal1.msitesting.net",
"keyVaultId": "https://rpbvtkeyvaultintegration.vault.azure.net/secrets/msitestingCert",
"identityClientId": "329419bc-adec-4dce-9568-25a6d486e468"
}
],
"publisherEmail": "apim@autorestsdk.com",
"publisherName": "autorestsdk",
"virtualNetworkType": "None",
"apiVersionConstraint": {
"minApiVersion": "2019-01-01"
}
},
"sku": {
"name": "Premium",
"capacity": 1
},
"identity": {
"type": "UserAssigned",
"userAssignedIdentities": {
"/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.ManagedIdentity/userAssignedIdentities/id1": {}
}
},
"location": "North Europe",
"tags": {
"tag1": "value1",
"tag2": "value2",
"tag3": "value3"
}
}
import com.azure.resourcemanager.apimanagement.models.ApiManagementServiceIdentity;
import com.azure.resourcemanager.apimanagement.models.ApiManagementServiceSkuProperties;
import com.azure.resourcemanager.apimanagement.models.ApiVersionConstraint;
import com.azure.resourcemanager.apimanagement.models.ApimIdentityType;
import com.azure.resourcemanager.apimanagement.models.HostnameConfiguration;
import com.azure.resourcemanager.apimanagement.models.HostnameType;
import com.azure.resourcemanager.apimanagement.models.SkuType;
import com.azure.resourcemanager.apimanagement.models.UserIdentityProperties;
import com.azure.resourcemanager.apimanagement.models.VirtualNetworkType;
import java.util.Arrays;
import java.util.HashMap;
import java.util.Map;
/** Samples for ApiManagementService CreateOrUpdate. */
public final class Main {
/*
* x-ms-original-file: specification/apimanagement/resource-manager/Microsoft.ApiManagement/stable/2022-08-01/examples/ApiManagementCreateServiceWithCustomHostnameKeyVault.json
*/
/**
* Sample code: ApiManagementCreateServiceWithCustomHostnameKeyVault.
*
* @param manager Entry point to ApiManagementManager.
*/
public static void apiManagementCreateServiceWithCustomHostnameKeyVault(
com.azure.resourcemanager.apimanagement.ApiManagementManager manager) {
manager
.apiManagementServices()
.define("apimService1")
.withRegion("North Europe")
.withExistingResourceGroup("rg1")
.withSku(new ApiManagementServiceSkuProperties().withName(SkuType.PREMIUM).withCapacity(1))
.withPublisherEmail("apim@autorestsdk.com")
.withPublisherName("autorestsdk")
.withTags(mapOf("tag1", "value1", "tag2", "value2", "tag3", "value3"))
.withIdentity(
new ApiManagementServiceIdentity()
.withType(ApimIdentityType.USER_ASSIGNED)
.withUserAssignedIdentities(
mapOf(
"/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.ManagedIdentity/userAssignedIdentities/id1",
new UserIdentityProperties())))
.withHostnameConfigurations(
Arrays
.asList(
new HostnameConfiguration()
.withType(HostnameType.PROXY)
.withHostname("gateway1.msitesting.net")
.withKeyVaultId("fakeTokenPlaceholder")
.withIdentityClientId("329419bc-adec-4dce-9568-25a6d486e468")
.withDefaultSslBinding(true),
new HostnameConfiguration()
.withType(HostnameType.MANAGEMENT)
.withHostname("mgmt.msitesting.net")
.withKeyVaultId("fakeTokenPlaceholder")
.withIdentityClientId("329419bc-adec-4dce-9568-25a6d486e468"),
new HostnameConfiguration()
.withType(HostnameType.PORTAL)
.withHostname("portal1.msitesting.net")
.withKeyVaultId("fakeTokenPlaceholder")
.withIdentityClientId("329419bc-adec-4dce-9568-25a6d486e468")))
.withVirtualNetworkType(VirtualNetworkType.NONE)
.withApiVersionConstraint(new ApiVersionConstraint().withMinApiVersion("2019-01-01"))
.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 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_service_with_custom_hostname_key_vault.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.api_management_service.begin_create_or_update(
resource_group_name="rg1",
service_name="apimService1",
parameters={
"identity": {
"type": "UserAssigned",
"userAssignedIdentities": {
"/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.ManagedIdentity/userAssignedIdentities/id1": {}
},
},
"location": "North Europe",
"properties": {
"apiVersionConstraint": {"minApiVersion": "2019-01-01"},
"hostnameConfigurations": [
{
"defaultSslBinding": True,
"hostName": "gateway1.msitesting.net",
"identityClientId": "329419bc-adec-4dce-9568-25a6d486e468",
"keyVaultId": "https://rpbvtkeyvaultintegration.vault.azure.net/secrets/msitestingCert",
"type": "Proxy",
},
{
"hostName": "mgmt.msitesting.net",
"identityClientId": "329419bc-adec-4dce-9568-25a6d486e468",
"keyVaultId": "https://rpbvtkeyvaultintegration.vault.azure.net/secrets/msitestingCert",
"type": "Management",
},
{
"hostName": "portal1.msitesting.net",
"identityClientId": "329419bc-adec-4dce-9568-25a6d486e468",
"keyVaultId": "https://rpbvtkeyvaultintegration.vault.azure.net/secrets/msitestingCert",
"type": "Portal",
},
],
"publisherEmail": "apim@autorestsdk.com",
"publisherName": "autorestsdk",
"virtualNetworkType": "None",
},
"sku": {"capacity": 1, "name": "Premium"},
"tags": {"tag1": "value1", "tag2": "value2", "tag3": "value3"},
},
).result()
print(response)
# x-ms-original-file: specification/apimanagement/resource-manager/Microsoft.ApiManagement/stable/2022-08-01/examples/ApiManagementCreateServiceWithCustomHostnameKeyVault.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/ApiManagementCreateServiceWithCustomHostnameKeyVault.json
func ExampleServiceClient_BeginCreateOrUpdate_apiManagementCreateServiceWithCustomHostnameKeyVault() {
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)
}
poller, err := clientFactory.NewServiceClient().BeginCreateOrUpdate(ctx, "rg1", "apimService1", armapimanagement.ServiceResource{
Tags: map[string]*string{
"tag1": to.Ptr("value1"),
"tag2": to.Ptr("value2"),
"tag3": to.Ptr("value3"),
},
Identity: &armapimanagement.ServiceIdentity{
Type: to.Ptr(armapimanagement.ApimIdentityTypeUserAssigned),
UserAssignedIdentities: map[string]*armapimanagement.UserIdentityProperties{
"/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.ManagedIdentity/userAssignedIdentities/id1": {},
},
},
Location: to.Ptr("North Europe"),
Properties: &armapimanagement.ServiceProperties{
APIVersionConstraint: &armapimanagement.APIVersionConstraint{
MinAPIVersion: to.Ptr("2019-01-01"),
},
HostnameConfigurations: []*armapimanagement.HostnameConfiguration{
{
Type: to.Ptr(armapimanagement.HostnameTypeProxy),
DefaultSSLBinding: to.Ptr(true),
HostName: to.Ptr("gateway1.msitesting.net"),
IdentityClientID: to.Ptr("329419bc-adec-4dce-9568-25a6d486e468"),
KeyVaultID: to.Ptr("https://rpbvtkeyvaultintegration.vault.azure.net/secrets/msitestingCert"),
},
{
Type: to.Ptr(armapimanagement.HostnameTypeManagement),
HostName: to.Ptr("mgmt.msitesting.net"),
IdentityClientID: to.Ptr("329419bc-adec-4dce-9568-25a6d486e468"),
KeyVaultID: to.Ptr("https://rpbvtkeyvaultintegration.vault.azure.net/secrets/msitestingCert"),
},
{
Type: to.Ptr(armapimanagement.HostnameTypePortal),
HostName: to.Ptr("portal1.msitesting.net"),
IdentityClientID: to.Ptr("329419bc-adec-4dce-9568-25a6d486e468"),
KeyVaultID: to.Ptr("https://rpbvtkeyvaultintegration.vault.azure.net/secrets/msitestingCert"),
}},
VirtualNetworkType: to.Ptr(armapimanagement.VirtualNetworkTypeNone),
PublisherEmail: to.Ptr("apim@autorestsdk.com"),
PublisherName: to.Ptr("autorestsdk"),
},
SKU: &armapimanagement.ServiceSKUProperties{
Name: to.Ptr(armapimanagement.SKUTypePremium),
Capacity: to.Ptr[int32](1),
},
}, nil)
if err != nil {
log.Fatalf("failed to finish the request: %v", err)
}
res, err := poller.PollUntilDone(ctx, nil)
if err != nil {
log.Fatalf("failed to pull the result: %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.ServiceResource = armapimanagement.ServiceResource{
// Name: to.Ptr("apimService1"),
// Type: to.Ptr("Microsoft.ApiManagement/service"),
// ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.ApiManagement/service/apimService1"),
// Tags: map[string]*string{
// "tag1": to.Ptr("value1"),
// "tag2": to.Ptr("value2"),
// "tag3": to.Ptr("value3"),
// },
// Etag: to.Ptr("AAAAAAAigjU="),
// Identity: &armapimanagement.ServiceIdentity{
// Type: to.Ptr(armapimanagement.ApimIdentityTypeUserAssigned),
// TenantID: to.Ptr("f686d426-8d16-0000-0000-ab578e110ccd"),
// UserAssignedIdentities: map[string]*armapimanagement.UserIdentityProperties{
// "/subscriptions/subid/resourcegroups/rg1/providers/Microsoft.ManagedIdentity/userAssignedIdentities/id1": &armapimanagement.UserIdentityProperties{
// ClientID: to.Ptr("329419bc-adec-4dce-9568-25a6d486e468"),
// PrincipalID: to.Ptr("15e769b2-0000-0000-0000-3fd9a923ac3a"),
// },
// },
// },
// Location: to.Ptr("North Europe"),
// Properties: &armapimanagement.ServiceProperties{
// APIVersionConstraint: &armapimanagement.APIVersionConstraint{
// MinAPIVersion: to.Ptr("2019-01-01"),
// },
// CreatedAtUTC: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2020-09-13T22:30:20.775Z"); return t}()),
// CustomProperties: map[string]*string{
// "Microsoft.WindowsAzure.ApiManagement.Gateway.Protocols.Server.Http2": to.Ptr("False"),
// "Microsoft.WindowsAzure.ApiManagement.Gateway.Security.Backend.Protocols.Ssl30": to.Ptr("False"),
// "Microsoft.WindowsAzure.ApiManagement.Gateway.Security.Backend.Protocols.Tls10": to.Ptr("False"),
// "Microsoft.WindowsAzure.ApiManagement.Gateway.Security.Backend.Protocols.Tls11": to.Ptr("False"),
// "Microsoft.WindowsAzure.ApiManagement.Gateway.Security.Ciphers.TripleDes168": to.Ptr("False"),
// "Microsoft.WindowsAzure.ApiManagement.Gateway.Security.Protocols.Ssl30": to.Ptr("False"),
// "Microsoft.WindowsAzure.ApiManagement.Gateway.Security.Protocols.Tls10": to.Ptr("False"),
// "Microsoft.WindowsAzure.ApiManagement.Gateway.Security.Protocols.Tls11": to.Ptr("False"),
// },
// DeveloperPortalURL: to.Ptr("https://apimService1.developer.azure-api.net"),
// DisableGateway: to.Ptr(false),
// GatewayRegionalURL: to.Ptr("https://apimService1-northeurope-01.regional.azure-api.net"),
// GatewayURL: to.Ptr("https://apimService1.azure-api.net"),
// HostnameConfigurations: []*armapimanagement.HostnameConfiguration{
// {
// Type: to.Ptr(armapimanagement.HostnameTypeProxy),
// CertificateSource: to.Ptr(armapimanagement.CertificateSourceBuiltIn),
// DefaultSSLBinding: to.Ptr(false),
// HostName: to.Ptr("apimService1.azure-api.net"),
// NegotiateClientCertificate: to.Ptr(false),
// },
// {
// Type: to.Ptr(armapimanagement.HostnameTypeProxy),
// Certificate: &armapimanagement.CertificateInformation{
// Expiry: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2037-01-01T07:00:00.000Z"); return t}()),
// Subject: to.Ptr("CN=*.msitesting.net"),
// Thumbprint: to.Ptr("EA276907917CB5XXXXXXXXXXX690"),
// },
// CertificateSource: to.Ptr(armapimanagement.CertificateSourceKeyVault),
// DefaultSSLBinding: to.Ptr(true),
// HostName: to.Ptr("gateway1.msitesting.net"),
// IdentityClientID: to.Ptr("329419bc-adec-4dce-9568-25a6d486e468"),
// KeyVaultID: to.Ptr("https://rpbvtkeyvaultintegration.vault.azure.net/secrets/msitestingCert"),
// NegotiateClientCertificate: to.Ptr(false),
// },
// {
// Type: to.Ptr(armapimanagement.HostnameTypeManagement),
// Certificate: &armapimanagement.CertificateInformation{
// Expiry: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2037-01-01T07:00:00.000Z"); return t}()),
// Subject: to.Ptr("CN=*.msitesting.net"),
// Thumbprint: to.Ptr("EA276907917CB5XXXXXXXXXXX690"),
// },
// CertificateSource: to.Ptr(armapimanagement.CertificateSourceKeyVault),
// DefaultSSLBinding: to.Ptr(false),
// HostName: to.Ptr("mgmt.msitesting.net"),
// IdentityClientID: to.Ptr("329419bc-adec-4dce-9568-25a6d486e468"),
// KeyVaultID: to.Ptr("https://rpbvtkeyvaultintegration.vault.azure.net/secrets/msitestingCert"),
// NegotiateClientCertificate: to.Ptr(false),
// },
// {
// Type: to.Ptr(armapimanagement.HostnameTypePortal),
// Certificate: &armapimanagement.CertificateInformation{
// Expiry: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2037-01-01T07:00:00.000Z"); return t}()),
// Subject: to.Ptr("CN=*.msitesting.net"),
// Thumbprint: to.Ptr("EA276907917CB5XXXXXXXXXXX690"),
// },
// CertificateSource: to.Ptr(armapimanagement.CertificateSourceKeyVault),
// DefaultSSLBinding: to.Ptr(false),
// HostName: to.Ptr("portal1.msitesting.net"),
// IdentityClientID: to.Ptr("329419bc-adec-4dce-9568-25a6d486e468"),
// KeyVaultID: to.Ptr("https://rpbvtkeyvaultintegration.vault.azure.net/secrets/msitestingCert"),
// NegotiateClientCertificate: to.Ptr(false),
// }},
// ManagementAPIURL: to.Ptr("https://apimService1.management.azure-api.net"),
// NotificationSenderEmail: to.Ptr("apimgmt-noreply@mail.windowsazure.com"),
// PlatformVersion: to.Ptr(armapimanagement.PlatformVersionStv2),
// PortalURL: to.Ptr("https://apimService1.portal.azure-api.net"),
// ProvisioningState: to.Ptr("Succeeded"),
// PublicIPAddresses: []*string{
// to.Ptr("40.112.74.192")},
// ScmURL: to.Ptr("https://apimService1.scm.azure-api.net"),
// TargetProvisioningState: to.Ptr(""),
// VirtualNetworkType: to.Ptr(armapimanagement.VirtualNetworkTypeNone),
// PublisherEmail: to.Ptr("apim@autorestsdk.com"),
// PublisherName: to.Ptr("autorestsdk"),
// },
// SKU: &armapimanagement.ServiceSKUProperties{
// Name: to.Ptr(armapimanagement.SKUTypePremium),
// Capacity: to.Ptr[int32](1),
// },
// SystemData: &armapimanagement.SystemData{
// CreatedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2020-02-01T01:01:01.107Z"); return t}()),
// CreatedBy: to.Ptr("string"),
// CreatedByType: to.Ptr(armapimanagement.CreatedByTypeApplication),
// LastModifiedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2020-02-02T02:03:01.197Z"); return t}()),
// LastModifiedBy: to.Ptr("string"),
// LastModifiedByType: to.Ptr(armapimanagement.CreatedByTypeApplication),
// },
// }
}
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 an API Management service. This is long running operation and could take several minutes to complete.
*
* @summary Creates or updates an API Management service. This is long running operation and could take several minutes to complete.
* x-ms-original-file: specification/apimanagement/resource-manager/Microsoft.ApiManagement/stable/2022-08-01/examples/ApiManagementCreateServiceWithCustomHostnameKeyVault.json
*/
async function apiManagementCreateServiceWithCustomHostnameKeyVault() {
const subscriptionId = process.env["APIMANAGEMENT_SUBSCRIPTION_ID"] || "subid";
const resourceGroupName = process.env["APIMANAGEMENT_RESOURCE_GROUP"] || "rg1";
const serviceName = "apimService1";
const parameters = {
apiVersionConstraint: { minApiVersion: "2019-01-01" },
hostnameConfigurations: [
{
type: "Proxy",
defaultSslBinding: true,
hostName: "gateway1.msitesting.net",
identityClientId: "329419bc-adec-4dce-9568-25a6d486e468",
keyVaultId: "https://rpbvtkeyvaultintegration.vault.azure.net/secrets/msitestingCert",
},
{
type: "Management",
hostName: "mgmt.msitesting.net",
identityClientId: "329419bc-adec-4dce-9568-25a6d486e468",
keyVaultId: "https://rpbvtkeyvaultintegration.vault.azure.net/secrets/msitestingCert",
},
{
type: "Portal",
hostName: "portal1.msitesting.net",
identityClientId: "329419bc-adec-4dce-9568-25a6d486e468",
keyVaultId: "https://rpbvtkeyvaultintegration.vault.azure.net/secrets/msitestingCert",
},
],
identity: {
type: "UserAssigned",
userAssignedIdentities: {
"/subscriptions/subid/resourceGroups/rg1/providers/MicrosoftManagedIdentity/userAssignedIdentities/id1":
{},
},
},
location: "North Europe",
publisherEmail: "apim@autorestsdk.com",
publisherName: "autorestsdk",
sku: { name: "Premium", capacity: 1 },
tags: { tag1: "value1", tag2: "value2", tag3: "value3" },
virtualNetworkType: "None",
};
const credential = new DefaultAzureCredential();
const client = new ApiManagementClient(credential, subscriptionId);
const result = await client.apiManagementService.beginCreateOrUpdateAndWait(
resourceGroupName,
serviceName,
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
Sample Response
Location: https://management.azure.com/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.ApiManagement/service/apimService1/operationresults/ZWFzdHVzOmFuZHktdGVzdGluZy0yMDIyLTA0LTAxLXByZXZpZXctNF9BY3RfODQ2ZWE4Ng==?api-version=2022-08-01&asyncResponse
Azure-AsyncOperation: https://management.azure.com/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.ApiManagement/service/apimService1/operationresults/ZWFzdHVzOmFuZHktdGVzdGluZy0yMDIyLTA0LTAxLXByZXZpZXctNF9BY3RfODQ2ZWE4Ng==?api-version=2022-08-01&asyncResponse
{
"id": "/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.ApiManagement/service/apimService1",
"name": "apimService1",
"type": "Microsoft.ApiManagement/service",
"tags": {
"tag1": "value1",
"tag2": "value2",
"tag3": "value3"
},
"location": "North Europe",
"etag": "AAAAAAAigi8=",
"properties": {
"publisherEmail": "apim@autorestsdk.com",
"publisherName": "autorestsdk",
"notificationSenderEmail": "apimgmt-noreply@mail.windowsazure.com",
"provisioningState": "Created",
"targetProvisioningState": "Activating",
"createdAtUtc": "2020-09-13T22:30:20.7759747Z",
"hostnameConfigurations": [
{
"type": "Proxy",
"hostName": "apimService1.azure-api.net",
"negotiateClientCertificate": false,
"defaultSslBinding": false,
"certificateSource": "BuiltIn"
},
{
"type": "Proxy",
"hostName": "gateway1.msitesting.net",
"keyVaultId": "https://rpbvtkeyvaultintegration.vault.azure.net/secrets/msitestingCert",
"negotiateClientCertificate": false,
"certificate": {
"expiry": "2037-01-01T07:00:00+00:00",
"thumbprint": "EA276907917CB5XXXXXXXXXXX690",
"subject": "CN=*.msitesting.net"
},
"defaultSslBinding": true,
"identityClientId": "329419bc-adec-4dce-9568-25a6d486e468",
"certificateSource": "KeyVault"
},
{
"type": "Management",
"hostName": "mgmt.msitesting.net",
"keyVaultId": "https://rpbvtkeyvaultintegration.vault.azure.net/secrets/msitestingCert",
"negotiateClientCertificate": false,
"certificate": {
"expiry": "2037-01-01T07:00:00+00:00",
"thumbprint": "EA276907917CB5XXXXXXXXXXX690",
"subject": "CN=*.msitesting.net"
},
"defaultSslBinding": false,
"identityClientId": "329419bc-adec-4dce-9568-25a6d486e468",
"certificateSource": "KeyVault"
},
{
"type": "Portal",
"hostName": "portal1.msitesting.net",
"keyVaultId": "https://rpbvtkeyvaultintegration.vault.azure.net/secrets/msitestingCert",
"negotiateClientCertificate": false,
"certificate": {
"expiry": "2037-01-01T07:00:00+00:00",
"thumbprint": "EA276907917CB5XXXXXXXXXXX690",
"subject": "CN=*.msitesting.net"
},
"defaultSslBinding": false,
"identityClientId": "329419bc-adec-4dce-9568-25a6d486e468",
"certificateSource": "KeyVault"
}
],
"virtualNetworkType": "None",
"disableGateway": false,
"platformVersion": "stv2",
"apiVersionConstraint": {
"minApiVersion": "2019-01-01"
}
},
"sku": {
"name": "Premium",
"capacity": 1
},
"identity": {
"type": "UserAssigned",
"userAssignedIdentities": {
"/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.ManagedIdentity/userAssignedIdentities/id1": {}
}
},
"systemData": {
"createdBy": "string",
"createdByType": "Application",
"createdAt": "2020-02-01T01:01:01.1075056Z",
"lastModifiedBy": "string",
"lastModifiedByType": "Application",
"lastModifiedAt": "2020-02-02T02:03:01.1974346Z"
}
}
{
"id": "/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.ApiManagement/service/apimService1",
"name": "apimService1",
"type": "Microsoft.ApiManagement/service",
"tags": {
"tag1": "value1",
"tag2": "value2",
"tag3": "value3"
},
"location": "North Europe",
"etag": "AAAAAAAigjU=",
"properties": {
"publisherEmail": "apim@autorestsdk.com",
"publisherName": "autorestsdk",
"notificationSenderEmail": "apimgmt-noreply@mail.windowsazure.com",
"provisioningState": "Succeeded",
"targetProvisioningState": "",
"createdAtUtc": "2020-09-13T22:30:20.7759747Z",
"gatewayUrl": "https://apimService1.azure-api.net",
"gatewayRegionalUrl": "https://apimService1-northeurope-01.regional.azure-api.net",
"portalUrl": "https://apimService1.portal.azure-api.net",
"developerPortalUrl": "https://apimService1.developer.azure-api.net",
"managementApiUrl": "https://apimService1.management.azure-api.net",
"scmUrl": "https://apimService1.scm.azure-api.net",
"hostnameConfigurations": [
{
"type": "Proxy",
"hostName": "apimService1.azure-api.net",
"negotiateClientCertificate": false,
"defaultSslBinding": false,
"certificateSource": "BuiltIn"
},
{
"type": "Proxy",
"hostName": "gateway1.msitesting.net",
"keyVaultId": "https://rpbvtkeyvaultintegration.vault.azure.net/secrets/msitestingCert",
"negotiateClientCertificate": false,
"certificate": {
"expiry": "2037-01-01T07:00:00+00:00",
"thumbprint": "EA276907917CB5XXXXXXXXXXX690",
"subject": "CN=*.msitesting.net"
},
"defaultSslBinding": true,
"identityClientId": "329419bc-adec-4dce-9568-25a6d486e468",
"certificateSource": "KeyVault"
},
{
"type": "Management",
"hostName": "mgmt.msitesting.net",
"keyVaultId": "https://rpbvtkeyvaultintegration.vault.azure.net/secrets/msitestingCert",
"negotiateClientCertificate": false,
"certificate": {
"expiry": "2037-01-01T07:00:00+00:00",
"thumbprint": "EA276907917CB5XXXXXXXXXXX690",
"subject": "CN=*.msitesting.net"
},
"defaultSslBinding": false,
"identityClientId": "329419bc-adec-4dce-9568-25a6d486e468",
"certificateSource": "KeyVault"
},
{
"type": "Portal",
"hostName": "portal1.msitesting.net",
"keyVaultId": "https://rpbvtkeyvaultintegration.vault.azure.net/secrets/msitestingCert",
"negotiateClientCertificate": false,
"certificate": {
"expiry": "2037-01-01T07:00:00+00:00",
"thumbprint": "EA276907917CB5XXXXXXXXXXX690",
"subject": "CN=*.msitesting.net"
},
"defaultSslBinding": false,
"identityClientId": "329419bc-adec-4dce-9568-25a6d486e468",
"certificateSource": "KeyVault"
}
],
"publicIPAddresses": [
"40.112.74.192"
],
"customProperties": {
"Microsoft.WindowsAzure.ApiManagement.Gateway.Security.Protocols.Tls10": "False",
"Microsoft.WindowsAzure.ApiManagement.Gateway.Security.Protocols.Tls11": "False",
"Microsoft.WindowsAzure.ApiManagement.Gateway.Security.Protocols.Ssl30": "False",
"Microsoft.WindowsAzure.ApiManagement.Gateway.Security.Ciphers.TripleDes168": "False",
"Microsoft.WindowsAzure.ApiManagement.Gateway.Security.Backend.Protocols.Tls10": "False",
"Microsoft.WindowsAzure.ApiManagement.Gateway.Security.Backend.Protocols.Tls11": "False",
"Microsoft.WindowsAzure.ApiManagement.Gateway.Security.Backend.Protocols.Ssl30": "False",
"Microsoft.WindowsAzure.ApiManagement.Gateway.Protocols.Server.Http2": "False"
},
"virtualNetworkType": "None",
"disableGateway": false,
"platformVersion": "stv2",
"apiVersionConstraint": {
"minApiVersion": "2019-01-01"
}
},
"sku": {
"name": "Premium",
"capacity": 1
},
"identity": {
"type": "UserAssigned",
"tenantId": "f686d426-8d16-0000-0000-ab578e110ccd",
"userAssignedIdentities": {
"/subscriptions/subid/resourcegroups/rg1/providers/Microsoft.ManagedIdentity/userAssignedIdentities/id1": {
"principalId": "15e769b2-0000-0000-0000-3fd9a923ac3a",
"clientId": "329419bc-adec-4dce-9568-25a6d486e468"
}
}
},
"systemData": {
"createdBy": "string",
"createdByType": "Application",
"createdAt": "2020-02-01T01:01:01.1075056Z",
"lastModifiedBy": "string",
"lastModifiedByType": "Application",
"lastModifiedAt": "2020-02-02T02:03:01.1974346Z"
}
}
ApiManagementCreateServiceWithNatGatewayEnabled
Sample Request
PUT https://management.azure.com/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.ApiManagement/service/apimService1?api-version=2022-08-01
{
"properties": {
"publisherEmail": "apim@autorestsdk.com",
"publisherName": "autorestsdk",
"natGatewayState": "Enabled"
},
"sku": {
"name": "Premium",
"capacity": 1
},
"location": "East US",
"tags": {
"tag1": "value1",
"tag2": "value2",
"tag3": "value3"
}
}
import com.azure.resourcemanager.apimanagement.models.ApiManagementServiceSkuProperties;
import com.azure.resourcemanager.apimanagement.models.NatGatewayState;
import com.azure.resourcemanager.apimanagement.models.SkuType;
import java.util.HashMap;
import java.util.Map;
/** Samples for ApiManagementService CreateOrUpdate. */
public final class Main {
/*
* x-ms-original-file: specification/apimanagement/resource-manager/Microsoft.ApiManagement/stable/2022-08-01/examples/ApiManagementCreateServiceWithNatGatewayEnabled.json
*/
/**
* Sample code: ApiManagementCreateServiceWithNatGatewayEnabled.
*
* @param manager Entry point to ApiManagementManager.
*/
public static void apiManagementCreateServiceWithNatGatewayEnabled(
com.azure.resourcemanager.apimanagement.ApiManagementManager manager) {
manager
.apiManagementServices()
.define("apimService1")
.withRegion("East US")
.withExistingResourceGroup("rg1")
.withSku(new ApiManagementServiceSkuProperties().withName(SkuType.PREMIUM).withCapacity(1))
.withPublisherEmail("apim@autorestsdk.com")
.withPublisherName("autorestsdk")
.withTags(mapOf("tag1", "value1", "tag2", "value2", "tag3", "value3"))
.withNatGatewayState(NatGatewayState.ENABLED)
.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 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_service_with_nat_gateway_enabled.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.api_management_service.begin_create_or_update(
resource_group_name="rg1",
service_name="apimService1",
parameters={
"location": "East US",
"properties": {
"natGatewayState": "Enabled",
"publisherEmail": "apim@autorestsdk.com",
"publisherName": "autorestsdk",
},
"sku": {"capacity": 1, "name": "Premium"},
"tags": {"tag1": "value1", "tag2": "value2", "tag3": "value3"},
},
).result()
print(response)
# x-ms-original-file: specification/apimanagement/resource-manager/Microsoft.ApiManagement/stable/2022-08-01/examples/ApiManagementCreateServiceWithNatGatewayEnabled.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/ApiManagementCreateServiceWithNatGatewayEnabled.json
func ExampleServiceClient_BeginCreateOrUpdate_apiManagementCreateServiceWithNatGatewayEnabled() {
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)
}
poller, err := clientFactory.NewServiceClient().BeginCreateOrUpdate(ctx, "rg1", "apimService1", armapimanagement.ServiceResource{
Tags: map[string]*string{
"tag1": to.Ptr("value1"),
"tag2": to.Ptr("value2"),
"tag3": to.Ptr("value3"),
},
Location: to.Ptr("East US"),
Properties: &armapimanagement.ServiceProperties{
NatGatewayState: to.Ptr(armapimanagement.NatGatewayStateEnabled),
PublisherEmail: to.Ptr("apim@autorestsdk.com"),
PublisherName: to.Ptr("autorestsdk"),
},
SKU: &armapimanagement.ServiceSKUProperties{
Name: to.Ptr(armapimanagement.SKUTypePremium),
Capacity: to.Ptr[int32](1),
},
}, nil)
if err != nil {
log.Fatalf("failed to finish the request: %v", err)
}
res, err := poller.PollUntilDone(ctx, nil)
if err != nil {
log.Fatalf("failed to pull the result: %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.ServiceResource = armapimanagement.ServiceResource{
// Name: to.Ptr("apimService1"),
// Type: to.Ptr("Microsoft.ApiManagement/service"),
// ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.ApiManagement/service/apimService1"),
// Tags: map[string]*string{
// "api-version": to.Ptr("2022-08-01"),
// },
// Etag: to.Ptr("AAAAAAAmREI="),
// Location: to.Ptr("East US"),
// Properties: &armapimanagement.ServiceProperties{
// APIVersionConstraint: &armapimanagement.APIVersionConstraint{
// },
// CreatedAtUTC: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2022-07-26T18:41:01.250Z"); return t}()),
// CustomProperties: map[string]*string{
// "Microsoft.WindowsAzure.ApiManagement.Gateway.Protocols.Server.Http2": to.Ptr("false"),
// "Microsoft.WindowsAzure.ApiManagement.Gateway.Security.Backend.Protocols.Ssl30": to.Ptr("false"),
// "Microsoft.WindowsAzure.ApiManagement.Gateway.Security.Backend.Protocols.Tls10": to.Ptr("false"),
// "Microsoft.WindowsAzure.ApiManagement.Gateway.Security.Backend.Protocols.Tls11": to.Ptr("false"),
// "Microsoft.WindowsAzure.ApiManagement.Gateway.Security.Ciphers.TripleDes168": to.Ptr("false"),
// "Microsoft.WindowsAzure.ApiManagement.Gateway.Security.Protocols.Ssl30": to.Ptr("false"),
// "Microsoft.WindowsAzure.ApiManagement.Gateway.Security.Protocols.Tls10": to.Ptr("false"),
// "Microsoft.WindowsAzure.ApiManagement.Gateway.Security.Protocols.Tls11": to.Ptr("false"),
// },
// DeveloperPortalURL: to.Ptr("https://apimService1.developer.azure-api.net"),
// DisableGateway: to.Ptr(false),
// GatewayRegionalURL: to.Ptr("https://apimService1-eastus-01.regional.azure-api.net"),
// GatewayURL: to.Ptr("https://apimService1.azure-api.net"),
// HostnameConfigurations: []*armapimanagement.HostnameConfiguration{
// {
// Type: to.Ptr(armapimanagement.HostnameTypeProxy),
// CertificateSource: to.Ptr(armapimanagement.CertificateSourceBuiltIn),
// DefaultSSLBinding: to.Ptr(true),
// HostName: to.Ptr("apimService1.azure-api.net"),
// NegotiateClientCertificate: to.Ptr(false),
// }},
// ManagementAPIURL: to.Ptr("https://apimService1.management.azure-api.net"),
// NatGatewayState: to.Ptr(armapimanagement.NatGatewayStateEnabled),
// NotificationSenderEmail: to.Ptr("apimgmt-noreply@mail.windowsazure.com"),
// OutboundPublicIPAddresses: []*string{
// to.Ptr("60.0.0.0/31")},
// PlatformVersion: to.Ptr(armapimanagement.PlatformVersionStv2),
// PortalURL: to.Ptr("https://apimService1.portal.azure-api.net"),
// ProvisioningState: to.Ptr("Succeeded"),
// PublicIPAddresses: []*string{
// to.Ptr("13.90.229.33")},
// PublicNetworkAccess: to.Ptr(armapimanagement.PublicNetworkAccessEnabled),
// ScmURL: to.Ptr("https://apimService1.scm.azure-api.net"),
// TargetProvisioningState: to.Ptr(""),
// VirtualNetworkType: to.Ptr(armapimanagement.VirtualNetworkTypeNone),
// PublisherEmail: to.Ptr("apim@autorestsdk.com"),
// PublisherName: to.Ptr("autorestsdk"),
// },
// SKU: &armapimanagement.ServiceSKUProperties{
// Name: to.Ptr(armapimanagement.SKUTypePremium),
// Capacity: to.Ptr[int32](1),
// },
// SystemData: &armapimanagement.SystemData{
// CreatedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2022-07-11T18:41:00.939Z"); return t}()),
// CreatedBy: to.Ptr("user@contoso.com"),
// CreatedByType: to.Ptr(armapimanagement.CreatedByTypeUser),
// LastModifiedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2022-07-11T18:41:00.939Z"); return t}()),
// LastModifiedBy: to.Ptr("user@contoso.com"),
// LastModifiedByType: to.Ptr(armapimanagement.CreatedByTypeUser),
// },
// }
}
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 an API Management service. This is long running operation and could take several minutes to complete.
*
* @summary Creates or updates an API Management service. This is long running operation and could take several minutes to complete.
* x-ms-original-file: specification/apimanagement/resource-manager/Microsoft.ApiManagement/stable/2022-08-01/examples/ApiManagementCreateServiceWithNatGatewayEnabled.json
*/
async function apiManagementCreateServiceWithNatGatewayEnabled() {
const subscriptionId = process.env["APIMANAGEMENT_SUBSCRIPTION_ID"] || "subid";
const resourceGroupName = process.env["APIMANAGEMENT_RESOURCE_GROUP"] || "rg1";
const serviceName = "apimService1";
const parameters = {
location: "East US",
natGatewayState: "Enabled",
publisherEmail: "apim@autorestsdk.com",
publisherName: "autorestsdk",
sku: { name: "Premium", capacity: 1 },
tags: { tag1: "value1", tag2: "value2", tag3: "value3" },
};
const credential = new DefaultAzureCredential();
const client = new ApiManagementClient(credential, subscriptionId);
const result = await client.apiManagementService.beginCreateOrUpdateAndWait(
resourceGroupName,
serviceName,
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
Sample Response
Location: https://management.azure.com/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.ApiManagement/service/apimService1/operationresults/ZWFzdHVzOmFuZHktdGVzdGluZy0yMDIyLTA0LTAxLXByZXZpZXctNF9BY3RfODQ2ZWE4Ng==?api-version=2022-08-01&asyncResponse
Azure-AsyncOperation: https://management.azure.com/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.ApiManagement/service/apimService1/operationresults/ZWFzdHVzOmFuZHktdGVzdGluZy0yMDIyLTA0LTAxLXByZXZpZXctNF9BY3RfODQ2ZWE4Ng==?api-version=2022-08-01&asyncResponse
{
"id": "/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.ApiManagement/service/apimService1",
"name": "apimService1",
"type": "Microsoft.ApiManagement/service",
"tags": {
"api-version": "2022-08-01"
},
"location": "East US",
"etag": "AAAAAAAmRAM=",
"properties": {
"publisherEmail": "apim@autorestsdk.com",
"publisherName": "autorestsdk",
"notificationSenderEmail": "apimgmt-noreply@mail.windowsazure.com",
"provisioningState": "Created",
"targetProvisioningState": "Activating",
"createdAtUtc": "2022-07-11T18:41:01.2506031Z",
"gatewayUrl": "https://apimService1.azure-api.net",
"hostnameConfigurations": [
{
"type": "Proxy",
"hostName": "apimService1.azure-api.net",
"negotiateClientCertificate": false,
"defaultSslBinding": true,
"certificateSource": "BuiltIn"
}
],
"privateIPAddresses": null,
"additionalLocations": null,
"virtualNetworkConfiguration": null,
"virtualNetworkType": "None",
"certificates": null,
"disableGateway": false,
"natGatewayState": "Enabled",
"apiVersionConstraint": {
"minApiVersion": null
},
"publicIpAddressId": null,
"publicNetworkAccess": "Enabled",
"privateEndpointConnections": null,
"platformVersion": "stv2"
},
"sku": {
"name": "Premium",
"capacity": 1
},
"identity": null,
"zones": null,
"systemData": {
"createdBy": "user@contoso.com",
"createdByType": "User",
"createdAt": "2022-07-11T18:41:00.9390609Z",
"lastModifiedBy": "user@contoso.com",
"lastModifiedByType": "User",
"lastModifiedAt": "2022-07-11T18:41:00.9390609Z"
}
}
{
"id": "/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.ApiManagement/service/apimService1",
"name": "apimService1",
"type": "Microsoft.ApiManagement/service",
"tags": {
"api-version": "2022-08-01"
},
"location": "East US",
"etag": "AAAAAAAmREI=",
"properties": {
"publisherEmail": "apim@autorestsdk.com",
"publisherName": "autorestsdk",
"notificationSenderEmail": "apimgmt-noreply@mail.windowsazure.com",
"provisioningState": "Succeeded",
"targetProvisioningState": "",
"createdAtUtc": "2022-07-26T18:41:01.2506031Z",
"gatewayUrl": "https://apimService1.azure-api.net",
"gatewayRegionalUrl": "https://apimService1-eastus-01.regional.azure-api.net",
"portalUrl": "https://apimService1.portal.azure-api.net",
"developerPortalUrl": "https://apimService1.developer.azure-api.net",
"managementApiUrl": "https://apimService1.management.azure-api.net",
"scmUrl": "https://apimService1.scm.azure-api.net",
"hostnameConfigurations": [
{
"type": "Proxy",
"hostName": "apimService1.azure-api.net",
"negotiateClientCertificate": false,
"defaultSslBinding": true,
"certificateSource": "BuiltIn"
}
],
"publicIPAddresses": [
"13.90.229.33"
],
"customProperties": {
"Microsoft.WindowsAzure.ApiManagement.Gateway.Security.Ciphers.TripleDes168": "false",
"Microsoft.WindowsAzure.ApiManagement.Gateway.Security.Protocols.Tls11": "false",
"Microsoft.WindowsAzure.ApiManagement.Gateway.Security.Protocols.Tls10": "false",
"Microsoft.WindowsAzure.ApiManagement.Gateway.Security.Protocols.Ssl30": "false",
"Microsoft.WindowsAzure.ApiManagement.Gateway.Security.Backend.Protocols.Tls11": "false",
"Microsoft.WindowsAzure.ApiManagement.Gateway.Security.Backend.Protocols.Tls10": "false",
"Microsoft.WindowsAzure.ApiManagement.Gateway.Security.Backend.Protocols.Ssl30": "false",
"Microsoft.WindowsAzure.ApiManagement.Gateway.Protocols.Server.Http2": "false"
},
"virtualNetworkType": "None",
"disableGateway": false,
"natGatewayState": "Enabled",
"outboundPublicIPAddresses": [
"60.0.0.0/31"
],
"apiVersionConstraint": {
"minApiVersion": null
},
"publicNetworkAccess": "Enabled",
"platformVersion": "stv2"
},
"sku": {
"name": "Premium",
"capacity": 1
},
"systemData": {
"createdBy": "user@contoso.com",
"createdByType": "User",
"createdAt": "2022-07-11T18:41:00.9390609Z",
"lastModifiedBy": "user@contoso.com",
"lastModifiedByType": "User",
"lastModifiedAt": "2022-07-11T18:41:00.9390609Z"
}
}
ApiManagementCreateServiceWithSystemCertificates
Sample Request
PUT https://management.azure.com/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.ApiManagement/service/apimService1?api-version=2022-08-01
{
"properties": {
"certificates": [
{
"encodedCertificate": "*******Base64 encoded Certificate******************",
"certificatePassword": "Password",
"storeName": "CertificateAuthority"
}
],
"publisherEmail": "apim@autorestsdk.com",
"publisherName": "autorestsdk"
},
"sku": {
"name": "Basic",
"capacity": 1
},
"location": "Central US",
"tags": {
"tag1": "value1",
"tag2": "value2",
"tag3": "value3"
}
}
import com.azure.resourcemanager.apimanagement.models.ApiManagementServiceSkuProperties;
import com.azure.resourcemanager.apimanagement.models.CertificateConfiguration;
import com.azure.resourcemanager.apimanagement.models.CertificateConfigurationStoreName;
import com.azure.resourcemanager.apimanagement.models.SkuType;
import java.util.Arrays;
import java.util.HashMap;
import java.util.Map;
/** Samples for ApiManagementService CreateOrUpdate. */
public final class Main {
/*
* x-ms-original-file: specification/apimanagement/resource-manager/Microsoft.ApiManagement/stable/2022-08-01/examples/ApiManagementCreateServiceWithSystemCertificates.json
*/
/**
* Sample code: ApiManagementCreateServiceWithSystemCertificates.
*
* @param manager Entry point to ApiManagementManager.
*/
public static void apiManagementCreateServiceWithSystemCertificates(
com.azure.resourcemanager.apimanagement.ApiManagementManager manager) {
manager
.apiManagementServices()
.define("apimService1")
.withRegion("Central US")
.withExistingResourceGroup("rg1")
.withSku(new ApiManagementServiceSkuProperties().withName(SkuType.BASIC).withCapacity(1))
.withPublisherEmail("apim@autorestsdk.com")
.withPublisherName("autorestsdk")
.withTags(mapOf("tag1", "value1", "tag2", "value2", "tag3", "value3"))
.withCertificates(
Arrays
.asList(
new CertificateConfiguration()
.withEncodedCertificate("fakeTokenPlaceholder")
.withCertificatePassword("fakeTokenPlaceholder")
.withStoreName(CertificateConfigurationStoreName.CERTIFICATE_AUTHORITY)))
.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 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_service_with_system_certificates.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.api_management_service.begin_create_or_update(
resource_group_name="rg1",
service_name="apimService1",
parameters={
"location": "Central US",
"properties": {
"certificates": [
{
"certificatePassword": "Password",
"encodedCertificate": "*******Base64 encoded Certificate******************",
"storeName": "CertificateAuthority",
}
],
"publisherEmail": "apim@autorestsdk.com",
"publisherName": "autorestsdk",
},
"sku": {"capacity": 1, "name": "Basic"},
"tags": {"tag1": "value1", "tag2": "value2", "tag3": "value3"},
},
).result()
print(response)
# x-ms-original-file: specification/apimanagement/resource-manager/Microsoft.ApiManagement/stable/2022-08-01/examples/ApiManagementCreateServiceWithSystemCertificates.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/ApiManagementCreateServiceWithSystemCertificates.json
func ExampleServiceClient_BeginCreateOrUpdate_apiManagementCreateServiceWithSystemCertificates() {
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)
}
poller, err := clientFactory.NewServiceClient().BeginCreateOrUpdate(ctx, "rg1", "apimService1", armapimanagement.ServiceResource{
Tags: map[string]*string{
"tag1": to.Ptr("value1"),
"tag2": to.Ptr("value2"),
"tag3": to.Ptr("value3"),
},
Location: to.Ptr("Central US"),
Properties: &armapimanagement.ServiceProperties{
Certificates: []*armapimanagement.CertificateConfiguration{
{
CertificatePassword: to.Ptr("Password"),
EncodedCertificate: to.Ptr("*******Base64 encoded Certificate******************"),
StoreName: to.Ptr(armapimanagement.CertificateConfigurationStoreNameCertificateAuthority),
}},
PublisherEmail: to.Ptr("apim@autorestsdk.com"),
PublisherName: to.Ptr("autorestsdk"),
},
SKU: &armapimanagement.ServiceSKUProperties{
Name: to.Ptr(armapimanagement.SKUTypeBasic),
Capacity: to.Ptr[int32](1),
},
}, nil)
if err != nil {
log.Fatalf("failed to finish the request: %v", err)
}
res, err := poller.PollUntilDone(ctx, nil)
if err != nil {
log.Fatalf("failed to pull the result: %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.ServiceResource = armapimanagement.ServiceResource{
// Name: to.Ptr("apimService1"),
// Type: to.Ptr("Microsoft.ApiManagement/service"),
// ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.ApiManagement/service/apimService1"),
// Tags: map[string]*string{
// "tag1": to.Ptr("value1"),
// "tag2": to.Ptr("value2"),
// "tag3": to.Ptr("value3"),
// },
// Etag: to.Ptr("AAAAAAAp3UM="),
// Location: to.Ptr("Central US"),
// Properties: &armapimanagement.ServiceProperties{
// APIVersionConstraint: &armapimanagement.APIVersionConstraint{
// },
// Certificates: []*armapimanagement.CertificateConfiguration{
// {
// Certificate: &armapimanagement.CertificateInformation{
// Expiry: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2036-01-01T07:00:00.000Z"); return t}()),
// Subject: to.Ptr("CN=*.msitesting.net"),
// Thumbprint: to.Ptr("8E989652CABCF585ACBFCB9C2C91F1D174FDB3A2"),
// },
// StoreName: to.Ptr(armapimanagement.CertificateConfigurationStoreNameCertificateAuthority),
// }},
// CreatedAtUTC: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2019-12-18T06:33:28.090Z"); return t}()),
// CustomProperties: map[string]*string{
// "Microsoft.WindowsAzure.ApiManagement.Gateway.Protocols.Server.Http2": to.Ptr("False"),
// "Microsoft.WindowsAzure.ApiManagement.Gateway.Security.Backend.Protocols.Ssl30": to.Ptr("False"),
// "Microsoft.WindowsAzure.ApiManagement.Gateway.Security.Backend.Protocols.Tls10": to.Ptr("False"),
// "Microsoft.WindowsAzure.ApiManagement.Gateway.Security.Backend.Protocols.Tls11": to.Ptr("False"),
// "Microsoft.WindowsAzure.ApiManagement.Gateway.Security.Ciphers.TripleDes168": to.Ptr("False"),
// "Microsoft.WindowsAzure.ApiManagement.Gateway.Security.Protocols.Ssl30": to.Ptr("False"),
// "Microsoft.WindowsAzure.ApiManagement.Gateway.Security.Protocols.Tls10": to.Ptr("False"),
// "Microsoft.WindowsAzure.ApiManagement.Gateway.Security.Protocols.Tls11": to.Ptr("False"),
// },
// DeveloperPortalURL: to.Ptr("https://apimService1.developer.azure-api.net"),
// DisableGateway: to.Ptr(false),
// GatewayRegionalURL: to.Ptr("https://apimService1-centralus-01.regional.azure-api.net"),
// GatewayURL: to.Ptr("https://apimService1.azure-api.net"),
// HostnameConfigurations: []*armapimanagement.HostnameConfiguration{
// {
// Type: to.Ptr(armapimanagement.HostnameTypeProxy),
// CertificateSource: to.Ptr(armapimanagement.CertificateSourceBuiltIn),
// DefaultSSLBinding: to.Ptr(true),
// HostName: to.Ptr("apimService1.azure-api.net"),
// NegotiateClientCertificate: to.Ptr(false),
// }},
// ManagementAPIURL: to.Ptr("https://apimService1.management.azure-api.net"),
// NotificationSenderEmail: to.Ptr("apimgmt-noreply@mail.windowsazure.com"),
// PlatformVersion: to.Ptr(armapimanagement.PlatformVersionStv2),
// PortalURL: to.Ptr("https://apimService1.portal.azure-api.net"),
// ProvisioningState: to.Ptr("Succeeded"),
// PublicIPAddresses: []*string{
// to.Ptr("40.113.223.117")},
// ScmURL: to.Ptr("https://apimService1.scm.azure-api.net"),
// TargetProvisioningState: to.Ptr(""),
// VirtualNetworkType: to.Ptr(armapimanagement.VirtualNetworkTypeNone),
// PublisherEmail: to.Ptr("apim@autorestsdk.com"),
// PublisherName: to.Ptr("autorestsdk"),
// },
// SKU: &armapimanagement.ServiceSKUProperties{
// Name: to.Ptr(armapimanagement.SKUTypeBasic),
// Capacity: to.Ptr[int32](1),
// },
// SystemData: &armapimanagement.SystemData{
// CreatedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2020-02-01T01:01:01.107Z"); return t}()),
// CreatedBy: to.Ptr("string"),
// CreatedByType: to.Ptr(armapimanagement.CreatedByTypeApplication),
// LastModifiedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2020-02-02T02:03:01.197Z"); return t}()),
// LastModifiedBy: to.Ptr("string"),
// LastModifiedByType: to.Ptr(armapimanagement.CreatedByTypeApplication),
// },
// }
}
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 an API Management service. This is long running operation and could take several minutes to complete.
*
* @summary Creates or updates an API Management service. This is long running operation and could take several minutes to complete.
* x-ms-original-file: specification/apimanagement/resource-manager/Microsoft.ApiManagement/stable/2022-08-01/examples/ApiManagementCreateServiceWithSystemCertificates.json
*/
async function apiManagementCreateServiceWithSystemCertificates() {
const subscriptionId = process.env["APIMANAGEMENT_SUBSCRIPTION_ID"] || "subid";
const resourceGroupName = process.env["APIMANAGEMENT_RESOURCE_GROUP"] || "rg1";
const serviceName = "apimService1";
const parameters = {
certificates: [
{
certificatePassword: "Password",
encodedCertificate: "*******Base64 encoded Certificate******************",
storeName: "CertificateAuthority",
},
],
location: "Central US",
publisherEmail: "apim@autorestsdk.com",
publisherName: "autorestsdk",
sku: { name: "Basic", capacity: 1 },
tags: { tag1: "value1", tag2: "value2", tag3: "value3" },
};
const credential = new DefaultAzureCredential();
const client = new ApiManagementClient(credential, subscriptionId);
const result = await client.apiManagementService.beginCreateOrUpdateAndWait(
resourceGroupName,
serviceName,
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
Sample Response
Location: https://management.azure.com/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.ApiManagement/service/apimService1/operationresults/ZWFzdHVzOmFuZHktdGVzdGluZy0yMDIyLTA0LTAxLXByZXZpZXctNF9BY3RfODQ2ZWE4Ng==?api-version=2022-08-01&asyncResponse
Azure-AsyncOperation: https://management.azure.com/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.ApiManagement/service/apimService1/operationresults/ZWFzdHVzOmFuZHktdGVzdGluZy0yMDIyLTA0LTAxLXByZXZpZXctNF9BY3RfODQ2ZWE4Ng==?api-version=2022-08-01&asyncResponse
{
"id": "/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.ApiManagement/service/apimService1",
"name": "apimService1",
"type": "Microsoft.ApiManagement/service",
"tags": {
"tag1": "value1",
"tag2": "value2",
"tag3": "value3"
},
"location": "Central US",
"etag": "AAAAAAAp3TM=",
"properties": {
"publisherEmail": "apim@autorestsdk.com",
"publisherName": "autorestsdk",
"notificationSenderEmail": "apimgmt-noreply@mail.windowsazure.com",
"provisioningState": "Created",
"targetProvisioningState": "Activating",
"createdAtUtc": "2019-12-18T06:33:28.0906918Z",
"hostnameConfigurations": [
{
"type": "Proxy",
"hostName": "apimService1.azure-api.net",
"negotiateClientCertificate": false,
"defaultSslBinding": true
}
],
"virtualNetworkType": "None",
"certificates": [
{
"storeName": "CertificateAuthority",
"certificate": {
"expiry": "2036-01-01T07:00:00+00:00",
"thumbprint": "8E989652CABCF585ACBFCB9C2C91F1D174FDB3A2",
"subject": "CN=*.msitesting.net"
}
}
],
"disableGateway": false,
"platformVersion": "stv2",
"apiVersionConstraint": {}
},
"sku": {
"name": "Basic",
"capacity": 1
},
"systemData": {
"createdBy": "string",
"createdByType": "Application",
"createdAt": "2020-02-01T01:01:01.1075056Z",
"lastModifiedBy": "string",
"lastModifiedByType": "Application",
"lastModifiedAt": "2020-02-02T02:03:01.1974346Z"
}
}
{
"id": "/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.ApiManagement/service/apimService1",
"name": "apimService1",
"type": "Microsoft.ApiManagement/service",
"tags": {
"tag1": "value1",
"tag2": "value2",
"tag3": "value3"
},
"location": "Central US",
"etag": "AAAAAAAp3UM=",
"properties": {
"publisherEmail": "apim@autorestsdk.com",
"publisherName": "autorestsdk",
"notificationSenderEmail": "apimgmt-noreply@mail.windowsazure.com",
"provisioningState": "Succeeded",
"targetProvisioningState": "",
"createdAtUtc": "2019-12-18T06:33:28.0906918Z",
"gatewayUrl": "https://apimService1.azure-api.net",
"gatewayRegionalUrl": "https://apimService1-centralus-01.regional.azure-api.net",
"portalUrl": "https://apimService1.portal.azure-api.net",
"developerPortalUrl": "https://apimService1.developer.azure-api.net",
"managementApiUrl": "https://apimService1.management.azure-api.net",
"scmUrl": "https://apimService1.scm.azure-api.net",
"hostnameConfigurations": [
{
"type": "Proxy",
"hostName": "apimService1.azure-api.net",
"negotiateClientCertificate": false,
"defaultSslBinding": true,
"certificateSource": "BuiltIn"
}
],
"publicIPAddresses": [
"40.113.223.117"
],
"customProperties": {
"Microsoft.WindowsAzure.ApiManagement.Gateway.Security.Protocols.Tls10": "False",
"Microsoft.WindowsAzure.ApiManagement.Gateway.Security.Protocols.Tls11": "False",
"Microsoft.WindowsAzure.ApiManagement.Gateway.Security.Protocols.Ssl30": "False",
"Microsoft.WindowsAzure.ApiManagement.Gateway.Security.Ciphers.TripleDes168": "False",
"Microsoft.WindowsAzure.ApiManagement.Gateway.Security.Backend.Protocols.Tls10": "False",
"Microsoft.WindowsAzure.ApiManagement.Gateway.Security.Backend.Protocols.Tls11": "False",
"Microsoft.WindowsAzure.ApiManagement.Gateway.Security.Backend.Protocols.Ssl30": "False",
"Microsoft.WindowsAzure.ApiManagement.Gateway.Protocols.Server.Http2": "False"
},
"virtualNetworkType": "None",
"certificates": [
{
"storeName": "CertificateAuthority",
"certificate": {
"expiry": "2036-01-01T07:00:00+00:00",
"thumbprint": "8E989652CABCF585ACBFCB9C2C91F1D174FDB3A2",
"subject": "CN=*.msitesting.net"
}
}
],
"disableGateway": false,
"platformVersion": "stv2",
"apiVersionConstraint": {}
},
"sku": {
"name": "Basic",
"capacity": 1
},
"systemData": {
"createdBy": "string",
"createdByType": "Application",
"createdAt": "2020-02-01T01:01:01.1075056Z",
"lastModifiedBy": "string",
"lastModifiedByType": "Application",
"lastModifiedAt": "2020-02-02T02:03:01.1974346Z"
}
}
ApiManagementCreateServiceWithUserAssignedIdentity
Sample Request
PUT https://management.azure.com/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.ApiManagement/service/apimService1?api-version=2022-08-01
{
"properties": {
"publisherEmail": "apim@autorestsdk.com",
"publisherName": "autorestsdk"
},
"sku": {
"name": "Consumption",
"capacity": 0
},
"identity": {
"type": "UserAssigned",
"userAssignedIdentities": {
"/subscriptions/subid/resourcegroups/rg1/providers/Microsoft.ManagedIdentity/userAssignedIdentities/apimService1": {}
}
},
"location": "West US",
"tags": {
"tag1": "value1",
"tag2": "value2",
"tag3": "value3"
}
}
import com.azure.resourcemanager.apimanagement.models.ApiManagementServiceIdentity;
import com.azure.resourcemanager.apimanagement.models.ApiManagementServiceSkuProperties;
import com.azure.resourcemanager.apimanagement.models.ApimIdentityType;
import com.azure.resourcemanager.apimanagement.models.SkuType;
import com.azure.resourcemanager.apimanagement.models.UserIdentityProperties;
import java.util.HashMap;
import java.util.Map;
/** Samples for ApiManagementService CreateOrUpdate. */
public final class Main {
/*
* x-ms-original-file: specification/apimanagement/resource-manager/Microsoft.ApiManagement/stable/2022-08-01/examples/ApiManagementCreateServiceWithUserAssignedIdentity.json
*/
/**
* Sample code: ApiManagementCreateServiceWithUserAssignedIdentity.
*
* @param manager Entry point to ApiManagementManager.
*/
public static void apiManagementCreateServiceWithUserAssignedIdentity(
com.azure.resourcemanager.apimanagement.ApiManagementManager manager) {
manager
.apiManagementServices()
.define("apimService1")
.withRegion("West US")
.withExistingResourceGroup("rg1")
.withSku(new ApiManagementServiceSkuProperties().withName(SkuType.CONSUMPTION).withCapacity(0))
.withPublisherEmail("apim@autorestsdk.com")
.withPublisherName("autorestsdk")
.withTags(mapOf("tag1", "value1", "tag2", "value2", "tag3", "value3"))
.withIdentity(
new ApiManagementServiceIdentity()
.withType(ApimIdentityType.USER_ASSIGNED)
.withUserAssignedIdentities(
mapOf(
"/subscriptions/subid/resourcegroups/rg1/providers/Microsoft.ManagedIdentity/userAssignedIdentities/apimService1",
new UserIdentityProperties())))
.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 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_service_with_user_assigned_identity.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.api_management_service.begin_create_or_update(
resource_group_name="rg1",
service_name="apimService1",
parameters={
"identity": {
"type": "UserAssigned",
"userAssignedIdentities": {
"/subscriptions/subid/resourcegroups/rg1/providers/Microsoft.ManagedIdentity/userAssignedIdentities/apimService1": {}
},
},
"location": "West US",
"properties": {"publisherEmail": "apim@autorestsdk.com", "publisherName": "autorestsdk"},
"sku": {"capacity": 0, "name": "Consumption"},
"tags": {"tag1": "value1", "tag2": "value2", "tag3": "value3"},
},
).result()
print(response)
# x-ms-original-file: specification/apimanagement/resource-manager/Microsoft.ApiManagement/stable/2022-08-01/examples/ApiManagementCreateServiceWithUserAssignedIdentity.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/ApiManagementCreateServiceWithUserAssignedIdentity.json
func ExampleServiceClient_BeginCreateOrUpdate_apiManagementCreateServiceWithUserAssignedIdentity() {
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)
}
poller, err := clientFactory.NewServiceClient().BeginCreateOrUpdate(ctx, "rg1", "apimService1", armapimanagement.ServiceResource{
Tags: map[string]*string{
"tag1": to.Ptr("value1"),
"tag2": to.Ptr("value2"),
"tag3": to.Ptr("value3"),
},
Identity: &armapimanagement.ServiceIdentity{
Type: to.Ptr(armapimanagement.ApimIdentityTypeUserAssigned),
UserAssignedIdentities: map[string]*armapimanagement.UserIdentityProperties{
"/subscriptions/subid/resourcegroups/rg1/providers/Microsoft.ManagedIdentity/userAssignedIdentities/apimService1": {},
},
},
Location: to.Ptr("West US"),
Properties: &armapimanagement.ServiceProperties{
PublisherEmail: to.Ptr("apim@autorestsdk.com"),
PublisherName: to.Ptr("autorestsdk"),
},
SKU: &armapimanagement.ServiceSKUProperties{
Name: to.Ptr(armapimanagement.SKUTypeConsumption),
Capacity: to.Ptr[int32](0),
},
}, nil)
if err != nil {
log.Fatalf("failed to finish the request: %v", err)
}
res, err := poller.PollUntilDone(ctx, nil)
if err != nil {
log.Fatalf("failed to pull the result: %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.ServiceResource = armapimanagement.ServiceResource{
// Name: to.Ptr("apimService1"),
// Type: to.Ptr("Microsoft.ApiManagement/service"),
// ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.ApiManagement/service/apimService1"),
// Tags: map[string]*string{
// "tag1": to.Ptr("value1"),
// "tag2": to.Ptr("value2"),
// "tag3": to.Ptr("value3"),
// },
// Etag: to.Ptr("AAAAAAAFzyk="),
// Identity: &armapimanagement.ServiceIdentity{
// Type: to.Ptr(armapimanagement.ApimIdentityTypeUserAssigned),
// TenantID: to.Ptr("00000000-86f1-41af-0000-2d7cd011db47"),
// UserAssignedIdentities: map[string]*armapimanagement.UserIdentityProperties{
// "/subscriptions/subid/resourcegroups/rg1/providers/Microsoft.ManagedIdentity/userAssignedIdentities/apimService1": &armapimanagement.UserIdentityProperties{
// ClientID: to.Ptr("5a2c6b8e-0905-0000-a772-993c9418137f"),
// PrincipalID: to.Ptr("00000000-6e62-4649-9f54-a119fc1ba85e"),
// },
// },
// },
// Location: to.Ptr("West US"),
// Properties: &armapimanagement.ServiceProperties{
// CreatedAtUTC: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2020-03-12T01:05:33.457Z"); return t}()),
// CustomProperties: map[string]*string{
// "Microsoft.WindowsAzure.ApiManagement.Gateway.Protocols.Server.Http2": to.Ptr("False"),
// "Microsoft.WindowsAzure.ApiManagement.Gateway.Security.Backend.Protocols.Ssl30": to.Ptr("False"),
// "Microsoft.WindowsAzure.ApiManagement.Gateway.Security.Backend.Protocols.Tls10": to.Ptr("False"),
// "Microsoft.WindowsAzure.ApiManagement.Gateway.Security.Backend.Protocols.Tls11": to.Ptr("False"),
// "Microsoft.WindowsAzure.ApiManagement.Gateway.Security.Protocols.Tls10": to.Ptr("False"),
// "Microsoft.WindowsAzure.ApiManagement.Gateway.Security.Protocols.Tls11": to.Ptr("False"),
// },
// DisableGateway: to.Ptr(false),
// GatewayURL: to.Ptr("https://apimService1.azure-api.net"),
// HostnameConfigurations: []*armapimanagement.HostnameConfiguration{
// {
// Type: to.Ptr(armapimanagement.HostnameTypeProxy),
// CertificateSource: to.Ptr(armapimanagement.CertificateSourceBuiltIn),
// DefaultSSLBinding: to.Ptr(true),
// HostName: to.Ptr("apimService1.azure-api.net"),
// NegotiateClientCertificate: to.Ptr(false),
// }},
// NotificationSenderEmail: to.Ptr("apimgmt-noreply@mail.windowsazure.com"),
// PlatformVersion: to.Ptr(armapimanagement.PlatformVersionMtv1),
// ProvisioningState: to.Ptr("Succeeded"),
// TargetProvisioningState: to.Ptr(""),
// VirtualNetworkType: to.Ptr(armapimanagement.VirtualNetworkTypeNone),
// PublisherEmail: to.Ptr("apim@autorestsdk.com"),
// PublisherName: to.Ptr("autorestsdk"),
// },
// SKU: &armapimanagement.ServiceSKUProperties{
// Name: to.Ptr(armapimanagement.SKUTypeConsumption),
// Capacity: to.Ptr[int32](0),
// },
// SystemData: &armapimanagement.SystemData{
// CreatedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2020-02-01T01:01:01.107Z"); return t}()),
// CreatedBy: to.Ptr("string"),
// CreatedByType: to.Ptr(armapimanagement.CreatedByTypeApplication),
// LastModifiedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2020-02-02T02:03:01.197Z"); return t}()),
// LastModifiedBy: to.Ptr("string"),
// LastModifiedByType: to.Ptr(armapimanagement.CreatedByTypeApplication),
// },
// }
}
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 an API Management service. This is long running operation and could take several minutes to complete.
*
* @summary Creates or updates an API Management service. This is long running operation and could take several minutes to complete.
* x-ms-original-file: specification/apimanagement/resource-manager/Microsoft.ApiManagement/stable/2022-08-01/examples/ApiManagementCreateServiceWithUserAssignedIdentity.json
*/
async function apiManagementCreateServiceWithUserAssignedIdentity() {
const subscriptionId = process.env["APIMANAGEMENT_SUBSCRIPTION_ID"] || "subid";
const resourceGroupName = process.env["APIMANAGEMENT_RESOURCE_GROUP"] || "rg1";
const serviceName = "apimService1";
const parameters = {
identity: {
type: "UserAssigned",
userAssignedIdentities: {
"/subscriptions/subid/resourcegroups/rg1/providers/MicrosoftManagedIdentity/userAssignedIdentities/apimService1":
{},
},
},
location: "West US",
publisherEmail: "apim@autorestsdk.com",
publisherName: "autorestsdk",
sku: { name: "Consumption", capacity: 0 },
tags: { tag1: "value1", tag2: "value2", tag3: "value3" },
};
const credential = new DefaultAzureCredential();
const client = new ApiManagementClient(credential, subscriptionId);
const result = await client.apiManagementService.beginCreateOrUpdateAndWait(
resourceGroupName,
serviceName,
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
Sample Response
Location: https://management.azure.com/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.ApiManagement/service/apimService1/operationresults/ZWFzdHVzOmFuZHktdGVzdGluZy0yMDIyLTA0LTAxLXByZXZpZXctNF9BY3RfODQ2ZWE4Ng==?api-version=2022-08-01&asyncResponse
Azure-AsyncOperation: https://management.azure.com/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.ApiManagement/service/apimService1/operationresults/ZWFzdHVzOmFuZHktdGVzdGluZy0yMDIyLTA0LTAxLXByZXZpZXctNF9BY3RfODQ2ZWE4Ng==?api-version=2022-08-01&asyncResponse
{
"id": "/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.ApiManagement/service/apimService1",
"name": "apimService1",
"type": "Microsoft.ApiManagement/service",
"tags": {
"tag1": "value1",
"tag2": "value2",
"tag3": "value3"
},
"location": "West US",
"etag": "AAAAAAAFzyQ=",
"properties": {
"publisherEmail": "apim@autorestsdk.com",
"publisherName": "autorestsdk",
"notificationSenderEmail": "apimgmt-noreply@mail.windowsazure.com",
"provisioningState": "Created",
"targetProvisioningState": "Activating",
"createdAtUtc": "2020-03-12T01:05:33.4573398Z",
"hostnameConfigurations": [
{
"type": "Proxy",
"hostName": "apimService1.azure-api.net",
"negotiateClientCertificate": false,
"defaultSslBinding": true,
"certificateSource": "BuiltIn"
}
],
"virtualNetworkType": "None",
"platformVersion": "mtv1"
},
"sku": {
"name": "Consumption",
"capacity": 0
},
"identity": {
"type": "UserAssigned",
"userAssignedIdentities": {
"/subscriptions/subid/resourcegroups/rg1/providers/Microsoft.ManagedIdentity/userAssignedIdentities/apimService1": {}
}
},
"systemData": {
"createdBy": "string",
"createdByType": "Application",
"createdAt": "2020-02-01T01:01:01.1075056Z",
"lastModifiedBy": "string",
"lastModifiedByType": "Application",
"lastModifiedAt": "2020-02-02T02:03:01.1974346Z"
}
}
{
"id": "/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.ApiManagement/service/apimService1",
"name": "apimService1",
"type": "Microsoft.ApiManagement/service",
"tags": {
"tag1": "value1",
"tag2": "value2",
"tag3": "value3"
},
"location": "West US",
"etag": "AAAAAAAFzyk=",
"properties": {
"publisherEmail": "apim@autorestsdk.com",
"publisherName": "autorestsdk",
"notificationSenderEmail": "apimgmt-noreply@mail.windowsazure.com",
"provisioningState": "Succeeded",
"targetProvisioningState": "",
"createdAtUtc": "2020-03-12T01:05:33.4573398Z",
"gatewayUrl": "https://apimService1.azure-api.net",
"hostnameConfigurations": [
{
"type": "Proxy",
"hostName": "apimService1.azure-api.net",
"negotiateClientCertificate": false,
"defaultSslBinding": true,
"certificateSource": "BuiltIn"
}
],
"customProperties": {
"Microsoft.WindowsAzure.ApiManagement.Gateway.Security.Protocols.Tls10": "False",
"Microsoft.WindowsAzure.ApiManagement.Gateway.Security.Protocols.Tls11": "False",
"Microsoft.WindowsAzure.ApiManagement.Gateway.Security.Backend.Protocols.Tls10": "False",
"Microsoft.WindowsAzure.ApiManagement.Gateway.Security.Backend.Protocols.Tls11": "False",
"Microsoft.WindowsAzure.ApiManagement.Gateway.Security.Backend.Protocols.Ssl30": "False",
"Microsoft.WindowsAzure.ApiManagement.Gateway.Protocols.Server.Http2": "False"
},
"virtualNetworkType": "None",
"disableGateway": false,
"platformVersion": "mtv1"
},
"sku": {
"name": "Consumption",
"capacity": 0
},
"identity": {
"type": "UserAssigned",
"tenantId": "00000000-86f1-41af-0000-2d7cd011db47",
"userAssignedIdentities": {
"/subscriptions/subid/resourcegroups/rg1/providers/Microsoft.ManagedIdentity/userAssignedIdentities/apimService1": {
"principalId": "00000000-6e62-4649-9f54-a119fc1ba85e",
"clientId": "5a2c6b8e-0905-0000-a772-993c9418137f"
}
}
},
"systemData": {
"createdBy": "string",
"createdByType": "Application",
"createdAt": "2020-02-01T01:01:01.1075056Z",
"lastModifiedBy": "string",
"lastModifiedByType": "Application",
"lastModifiedAt": "2020-02-02T02:03:01.1974346Z"
}
}
ApiManagementUndelete
Sample Request
PUT https://management.azure.com/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.ApiManagement/service/apimService1?api-version=2022-08-01
{
"properties": {
"publisherEmail": "foo@contoso.com",
"publisherName": "foo",
"restore": true
},
"sku": {
"name": "Developer",
"capacity": 1
},
"location": "South Central US"
}
import com.azure.resourcemanager.apimanagement.models.ApiManagementServiceSkuProperties;
import com.azure.resourcemanager.apimanagement.models.SkuType;
import java.util.HashMap;
import java.util.Map;
/** Samples for ApiManagementService CreateOrUpdate. */
public final class Main {
/*
* x-ms-original-file: specification/apimanagement/resource-manager/Microsoft.ApiManagement/stable/2022-08-01/examples/ApiManagementUndelete.json
*/
/**
* Sample code: ApiManagementUndelete.
*
* @param manager Entry point to ApiManagementManager.
*/
public static void apiManagementUndelete(com.azure.resourcemanager.apimanagement.ApiManagementManager manager) {
manager
.apiManagementServices()
.define("apimService1")
.withRegion("South Central US")
.withExistingResourceGroup("rg1")
.withSku(new ApiManagementServiceSkuProperties().withName(SkuType.DEVELOPER).withCapacity(1))
.withPublisherEmail("foo@contoso.com")
.withPublisherName("foo")
.withRestore(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 azure.identity import DefaultAzureCredential
from azure.mgmt.apimanagement import ApiManagementClient
"""
# PREREQUISITES
pip install azure-identity
pip install azure-mgmt-apimanagement
# USAGE
python api_management_undelete.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.api_management_service.begin_create_or_update(
resource_group_name="rg1",
service_name="apimService1",
parameters={
"location": "South Central US",
"properties": {"publisherEmail": "foo@contoso.com", "publisherName": "foo", "restore": True},
"sku": {"capacity": 1, "name": "Developer"},
},
).result()
print(response)
# x-ms-original-file: specification/apimanagement/resource-manager/Microsoft.ApiManagement/stable/2022-08-01/examples/ApiManagementUndelete.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/ApiManagementUndelete.json
func ExampleServiceClient_BeginCreateOrUpdate_apiManagementUndelete() {
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)
}
poller, err := clientFactory.NewServiceClient().BeginCreateOrUpdate(ctx, "rg1", "apimService1", armapimanagement.ServiceResource{
Location: to.Ptr("South Central US"),
Properties: &armapimanagement.ServiceProperties{
Restore: to.Ptr(true),
PublisherEmail: to.Ptr("foo@contoso.com"),
PublisherName: to.Ptr("foo"),
},
SKU: &armapimanagement.ServiceSKUProperties{
Name: to.Ptr(armapimanagement.SKUTypeDeveloper),
Capacity: to.Ptr[int32](1),
},
}, nil)
if err != nil {
log.Fatalf("failed to finish the request: %v", err)
}
res, err := poller.PollUntilDone(ctx, nil)
if err != nil {
log.Fatalf("failed to pull the result: %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.ServiceResource = armapimanagement.ServiceResource{
// Name: to.Ptr("apimService1"),
// Type: to.Ptr("Microsoft.ApiManagement/service"),
// ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.ApiManagement/service/apimService1"),
// Etag: to.Ptr("AAAAAAAp3T4="),
// Location: to.Ptr("South Central US"),
// Properties: &armapimanagement.ServiceProperties{
// APIVersionConstraint: &armapimanagement.APIVersionConstraint{
// },
// CreatedAtUTC: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2019-12-18T06:10:56.032Z"); return t}()),
// CustomProperties: map[string]*string{
// "Microsoft.WindowsAzure.ApiManagement.Gateway.Protocols.Server.Http2": to.Ptr("False"),
// "Microsoft.WindowsAzure.ApiManagement.Gateway.Security.Backend.Protocols.Ssl30": to.Ptr("False"),
// "Microsoft.WindowsAzure.ApiManagement.Gateway.Security.Backend.Protocols.Tls10": to.Ptr("False"),
// "Microsoft.WindowsAzure.ApiManagement.Gateway.Security.Backend.Protocols.Tls11": to.Ptr("False"),
// "Microsoft.WindowsAzure.ApiManagement.Gateway.Security.Ciphers.TripleDes168": to.Ptr("False"),
// "Microsoft.WindowsAzure.ApiManagement.Gateway.Security.Protocols.Ssl30": to.Ptr("False"),
// "Microsoft.WindowsAzure.ApiManagement.Gateway.Security.Protocols.Tls10": to.Ptr("False"),
// "Microsoft.WindowsAzure.ApiManagement.Gateway.Security.Protocols.Tls11": to.Ptr("False"),
// },
// DeveloperPortalURL: to.Ptr("https://apimService1.developer.azure-api.net"),
// DisableGateway: to.Ptr(false),
// GatewayRegionalURL: to.Ptr("https://apimService1-southcentralus-01.regional.azure-api.net"),
// GatewayURL: to.Ptr("https://apimService1.azure-api.net"),
// HostnameConfigurations: []*armapimanagement.HostnameConfiguration{
// {
// Type: to.Ptr(armapimanagement.HostnameTypeProxy),
// DefaultSSLBinding: to.Ptr(true),
// HostName: to.Ptr("apimService1.azure-api.net"),
// NegotiateClientCertificate: to.Ptr(false),
// }},
// ManagementAPIURL: to.Ptr("https://apimService1.management.azure-api.net"),
// NotificationSenderEmail: to.Ptr("apimgmt-noreply@mail.windowsazure.com"),
// PortalURL: to.Ptr("https://apimService1.portal.azure-api.net"),
// ProvisioningState: to.Ptr("Succeeded"),
// PublicIPAddresses: []*string{
// to.Ptr("23.102.171.124")},
// ScmURL: to.Ptr("https://apimService1.scm.azure-api.net"),
// TargetProvisioningState: to.Ptr(""),
// VirtualNetworkType: to.Ptr(armapimanagement.VirtualNetworkTypeNone),
// PublisherEmail: to.Ptr("foo@contoso.com"),
// PublisherName: to.Ptr("foo"),
// },
// SKU: &armapimanagement.ServiceSKUProperties{
// Name: to.Ptr(armapimanagement.SKUTypeDeveloper),
// Capacity: to.Ptr[int32](1),
// },
// }
}
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 an API Management service. This is long running operation and could take several minutes to complete.
*
* @summary Creates or updates an API Management service. This is long running operation and could take several minutes to complete.
* x-ms-original-file: specification/apimanagement/resource-manager/Microsoft.ApiManagement/stable/2022-08-01/examples/ApiManagementUndelete.json
*/
async function apiManagementUndelete() {
const subscriptionId = process.env["APIMANAGEMENT_SUBSCRIPTION_ID"] || "subid";
const resourceGroupName = process.env["APIMANAGEMENT_RESOURCE_GROUP"] || "rg1";
const serviceName = "apimService1";
const parameters = {
location: "South Central US",
publisherEmail: "foo@contoso.com",
publisherName: "foo",
restore: true,
sku: { name: "Developer", capacity: 1 },
};
const credential = new DefaultAzureCredential();
const client = new ApiManagementClient(credential, subscriptionId);
const result = await client.apiManagementService.beginCreateOrUpdateAndWait(
resourceGroupName,
serviceName,
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
Sample Response
Location: https://management.azure.com/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.ApiManagement/service/apimService1/operationresults/ZWFzdHVzOmFuZHktdGVzdGluZy0yMDIyLTA0LTAxLXByZXZpZXctNF9BY3RfODQ2ZWE4Ng==?api-version=2022-08-01&asyncResponse
Azure-AsyncOperation: https://management.azure.com/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.ApiManagement/service/apimService1/operationresults/ZWFzdHVzOmFuZHktdGVzdGluZy0yMDIyLTA0LTAxLXByZXZpZXctNF9BY3RfODQ2ZWE4Ng==?api-version=2022-08-01&asyncResponse
{
"id": "/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.ApiManagement/service/apimService1",
"name": "apimService1",
"type": "Microsoft.ApiManagement/service",
"location": "South Central US",
"etag": "AAAAAAAp3P0=",
"properties": {
"publisherEmail": "foo@contoso.com",
"publisherName": "foo",
"notificationSenderEmail": "apimgmt-noreply@mail.windowsazure.com",
"provisioningState": "Created",
"targetProvisioningState": "Activating",
"createdAtUtc": "2019-12-18T06:10:56.0327105Z",
"hostnameConfigurations": [
{
"type": "Proxy",
"hostName": "apimService1.azure-api.net",
"negotiateClientCertificate": false,
"defaultSslBinding": true
}
],
"virtualNetworkType": "None",
"disableGateway": false,
"apiVersionConstraint": {}
},
"sku": {
"name": "Developer",
"capacity": 1
}
}
{
"id": "/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.ApiManagement/service/apimService1",
"name": "apimService1",
"type": "Microsoft.ApiManagement/service",
"location": "South Central US",
"etag": "AAAAAAAp3T4=",
"properties": {
"publisherEmail": "foo@contoso.com",
"publisherName": "foo",
"notificationSenderEmail": "apimgmt-noreply@mail.windowsazure.com",
"provisioningState": "Succeeded",
"targetProvisioningState": "",
"createdAtUtc": "2019-12-18T06:10:56.0327105Z",
"gatewayUrl": "https://apimService1.azure-api.net",
"gatewayRegionalUrl": "https://apimService1-southcentralus-01.regional.azure-api.net",
"portalUrl": "https://apimService1.portal.azure-api.net",
"developerPortalUrl": "https://apimService1.developer.azure-api.net",
"managementApiUrl": "https://apimService1.management.azure-api.net",
"scmUrl": "https://apimService1.scm.azure-api.net",
"hostnameConfigurations": [
{
"type": "Proxy",
"hostName": "apimService1.azure-api.net",
"negotiateClientCertificate": false,
"defaultSslBinding": true
}
],
"publicIPAddresses": [
"23.102.171.124"
],
"customProperties": {
"Microsoft.WindowsAzure.ApiManagement.Gateway.Security.Protocols.Tls10": "False",
"Microsoft.WindowsAzure.ApiManagement.Gateway.Security.Protocols.Tls11": "False",
"Microsoft.WindowsAzure.ApiManagement.Gateway.Security.Protocols.Ssl30": "False",
"Microsoft.WindowsAzure.ApiManagement.Gateway.Security.Ciphers.TripleDes168": "False",
"Microsoft.WindowsAzure.ApiManagement.Gateway.Security.Backend.Protocols.Tls10": "False",
"Microsoft.WindowsAzure.ApiManagement.Gateway.Security.Backend.Protocols.Tls11": "False",
"Microsoft.WindowsAzure.ApiManagement.Gateway.Security.Backend.Protocols.Ssl30": "False",
"Microsoft.WindowsAzure.ApiManagement.Gateway.Protocols.Server.Http2": "False"
},
"virtualNetworkType": "None",
"disableGateway": false,
"apiVersionConstraint": {}
},
"sku": {
"name": "Developer",
"capacity": 1
}
}
Definiciones
Nombre |
Description |
AdditionalLocation
|
Descripción de una ubicación de recursos API Management adicional.
|
ApiManagementServiceIdentity
|
Propiedades de identidad del recurso del servicio Api Management.
|
ApiManagementServiceResource
|
Un único recurso de servicio API Management en Lista o Obtención de respuesta.
|
ApiManagementServiceSkuProperties
|
API Management propiedades de SKU de recursos de servicio.
|
ApimIdentityType
|
Tipo de identidad que se usa para el recurso. El tipo "SystemAssigned, UserAssigned" incluye una identidad creada implícitamente y un conjunto de identidades asignadas por el usuario. El tipo "None" quitará las identidades del servicio.
|
ApiVersionConstraint
|
Restricción de versión de api de plano de control para el servicio API Management.
|
ArmIdWrapper
|
Contenedor para un identificador de recurso de ARM
|
CertificateConfiguration
|
Configuración de certificado que consta de certificados intermedios y certificados raíz que no son de confianza.
|
CertificateInformation
|
Información del certificado SSL.
|
CertificateSource
|
Origen del certificado.
|
CertificateStatus
|
Estado del certificado.
|
createdByType
|
Tipo de identidad que creó el recurso.
|
ErrorFieldContract
|
Contrato de campo de error.
|
ErrorResponse
|
Respuesta de error.
|
HostnameConfiguration
|
Configuración de nombre de host personalizada.
|
HostnameType
|
Tipo de nombre de host.
|
NatGatewayState
|
La propiedad se puede usar para habilitar nat Gateway para este servicio de API Management.
|
PlatformVersion
|
Versión de la plataforma de proceso que ejecuta el servicio.
|
PrivateEndpointServiceConnectionStatus
|
Estado de conexión del punto de conexión privado.
|
PrivateLinkServiceConnectionState
|
Colección de información sobre el estado de la conexión entre el consumidor del servicio y el proveedor.
|
PublicNetworkAccess
|
Si se permite o no el acceso al punto de conexión público para este servicio API Management. El valor es opcional, pero si se pasa, debe ser "Habilitado" o "Deshabilitado". Si "Disabled", los puntos de conexión privados son el método de acceso exclusivo. El valor predeterminado es "Enabled"
|
RemotePrivateEndpointConnectionWrapper
|
Recurso de conexión de punto de conexión privado remoto.
|
SkuType
|
Nombre de la SKU.
|
systemData
|
Metadatos relacionados con la creación y la última modificación del recurso.
|
UserIdentityProperties
|
|
VirtualNetworkConfiguration
|
Configuración de una red virtual en la que se implementa API Management servicio.
|
VirtualNetworkType
|
Tipo de VPN en el que se debe configurar API Management servicio. Ninguno (valor predeterminado) significa que el servicio API Management no forma parte de ninguna Virtual Network, external significa que la implementación de API Management se configura dentro de un Virtual Network que tiene un punto de conexión accesible desde Internet y significa internamente que API Management la implementación se configura dentro de un Virtual Network tener solo un punto de conexión accesible desde la intranet.
|
AdditionalLocation
Descripción de una ubicación de recursos API Management adicional.
Nombre |
Tipo |
Valor predeterminado |
Description |
disableGateway
|
boolean
|
False
|
La propiedad solo es válida para un servicio api Management implementado en varias ubicaciones. Esto se puede usar para deshabilitar la puerta de enlace en esta ubicación adicional.
|
gatewayRegionalUrl
|
string
|
|
Dirección URL de puerta de enlace del servicio API Management en la región.
|
location
|
string
|
|
Nombre de ubicación de la región adicional entre las regiones del centro de datos de Azure.
|
natGatewayState
|
NatGatewayState
|
Disabled
|
La propiedad se puede usar para habilitar nat Gateway para este servicio de API Management.
|
outboundPublicIPAddresses
|
string[]
|
|
Prefijos de dirección IPV4 públicas de salida asociados al servicio implementado de puerta de enlace NAT. Disponible solo para SKU Premium en la plataforma stv2.
|
platformVersion
|
PlatformVersion
|
|
Versión de la plataforma de proceso que ejecuta el servicio.
|
privateIPAddresses
|
string[]
|
|
Direcciones IP de carga equilibrada estática privada del servicio API Management que se implementa en un Virtual Network interno en una ubicación adicional determinada. Solo está disponible para la SKU básica, estándar, premium y aislada.
|
publicIPAddresses
|
string[]
|
|
Direcciones IP públicas de carga equilibrada estática del servicio API Management en la ubicación adicional. Solo está disponible para la SKU básica, estándar, premium y aislada.
|
publicIpAddressId
|
string
|
|
Dirección IP V4 basada en la SKU estándar pública que se va a asociar con Virtual Network servicio implementado en la ubicación. Solo se admite para la SKU Premium que se implementa en Virtual Network.
|
sku
|
ApiManagementServiceSkuProperties
|
|
Propiedades de SKU del servicio API Management.
|
virtualNetworkConfiguration
|
VirtualNetworkConfiguration
|
|
Configuración de red virtual para la ubicación.
|
zones
|
string[]
|
|
Una lista de zonas de disponibilidad que indica dónde debe proceder el recurso.
|
ApiManagementServiceIdentity
Propiedades de identidad del recurso del servicio Api Management.
Nombre |
Tipo |
Description |
principalId
|
string
|
Identificador de entidad de seguridad de la identidad.
|
tenantId
|
string
|
Identificador de inquilino del cliente de la identidad.
|
type
|
ApimIdentityType
|
Tipo de identidad que se usa para el recurso. El tipo "SystemAssigned, UserAssigned" incluye una identidad creada implícitamente y un conjunto de identidades asignadas por el usuario. El tipo "None" quitará las identidades del servicio.
|
userAssignedIdentities
|
<string,
UserIdentityProperties>
|
Lista de identidades de usuario asociadas al recurso. Las referencias de clave de diccionario de identidad de usuario serán identificadores de recursos de ARM con el formato: '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/ providers/Microsoft.ManagedIdentity/userAssignedIdentities/{identityName}'.
|
ApiManagementServiceResource
Un único recurso de servicio API Management en Lista o Obtención de respuesta.
Nombre |
Tipo |
Valor predeterminado |
Description |
etag
|
string
|
|
ETag del recurso.
|
id
|
string
|
|
Identificador del recurso.
|
identity
|
ApiManagementServiceIdentity
|
|
Identidad de servicio administrada del servicio Api Management.
|
location
|
string
|
|
Ubicación del recurso
|
name
|
string
|
|
Nombre del recurso.
|
properties.additionalLocations
|
AdditionalLocation[]
|
|
Ubicaciones adicionales del centro de datos del servicio API Management.
|
properties.apiVersionConstraint
|
ApiVersionConstraint
|
|
Restricción de versión de api de plano de control para el servicio API Management.
|
properties.certificates
|
CertificateConfiguration[]
|
|
Lista de certificados que deben instalarse en el servicio API Management. El número máximo de certificados admitidos que se pueden instalar es 10.
|
properties.createdAtUtc
|
string
|
|
Fecha UTC de creación del servicio API Management. La fecha se ajusta al siguiente formato: yyyy-MM-ddTHH:mm:ssZ según lo especificado por el estándar ISO 8601.
|
properties.customProperties
|
object
|
|
Propiedades personalizadas del servicio API Management. La configuración Microsoft.WindowsAzure.ApiManagement.Gateway.Security.Ciphers.TripleDes168 deshabilitará el cifrado TLS_RSA_WITH_3DES_EDE_CBC_SHA para todas las TLS(1.0, 1.1 y 1.2). La configuración Microsoft.WindowsAzure.ApiManagement.Gateway.Security.Protocols.Tls11 se puede usar para deshabilitar solo TLS 1.1. La configuración Microsoft.WindowsAzure.ApiManagement.Gateway.Security.Protocols.Tls10 se puede usar para deshabilitar TLS 1.0 en un servicio API Management. La configuración Microsoft.WindowsAzure.ApiManagement.Gateway.Security.Backend.Protocols.Tls11 se puede usar para deshabilitar solo TLS 1.1 para las comunicaciones con back-end. La configuración Microsoft.WindowsAzure.ApiManagement.Gateway.Security.Backend.Protocols.Tls10 se puede usar para deshabilitar TLS 1.0 para las comunicaciones con back-end. La configuración Microsoft.WindowsAzure.ApiManagement.Gateway.Protocols.Server.Http2 se puede usar para habilitar el protocolo HTTP2 en un servicio API Management. No especificar ninguna de estas propiedades en la operación PATCH restablecerá los valores de las propiedades omitidas en sus valores predeterminados. Para todas las configuraciones, excepto Http2, el valor predeterminado es True si el servicio se creó el 1 de abril de 2018 o antes de False lo contrario. El valor predeterminado de la configuración http2 es False .
Puede deshabilitar cualquiera de los siguientes cifrados mediante la configuración Microsoft.WindowsAzure.ApiManagement.Gateway.Security.Ciphers.[cipher_name] : TLS_ECDHE_ECDSA_WITH_AES_256_CBC_SHA, TLS_ECDHE_ECDSA_WITH_AES_128_CBC_SHA, TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA, TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA, TLS_RSA_WITH_AES_128_GCM_SHA256, TLS_RSA_WITH_AES_256_CBC_SHA256, TLS_RSA_WITH_AES_256_CBC_SHA256, TLS_RSA_WITH_AES_128_CBC_SHA256, TLS_RSA_WITH_AES_256_CBC_SHA, TLS_RSA_WITH_AES_128_CBC_SHA. Por ejemplo, Microsoft.WindowsAzure.ApiManagement.Gateway.Security.Ciphers.TLS_RSA_WITH_AES_128_CBC_SHA256 :false . El valor predeterminado es true para ellos. Nota: Los siguientes cifrados no se pueden deshabilitar porque son necesarios para los componentes de la plataforma interna: TLS_AES_256_GCM_SHA384,TLS_AES_128_GCM_SHA256,TLS_ECDHE_ECDSA_WITH_AES_256_GCM_SHA384,TLS_ECDHE_ECDSA_WITH_AES_128_GCM_SHA256,TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384,TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256, TLS_ECDHE_ECDSA_WITH_AES_256_CBC_SHA384,TLS_ECDHE_ECDSA_WITH_AES_128_CBC_SHA256,TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA384 TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA256
|
properties.developerPortalUrl
|
string
|
|
Dirección URL del punto de conexión del portal de DEveloper del servicio API Management.
|
properties.disableGateway
|
boolean
|
False
|
La propiedad solo es válida para un servicio api Management implementado en varias ubicaciones. Esto se puede usar para deshabilitar la puerta de enlace en la región maestra.
|
properties.enableClientCertificate
|
boolean
|
False
|
Propiedad solo diseñada para usarse para el servicio de SKU de consumo. Esto exige que se presente un certificado de cliente en cada solicitud a la puerta de enlace. Esto también permite autenticar el certificado en la directiva de la puerta de enlace.
|
properties.gatewayRegionalUrl
|
string
|
|
Dirección URL de puerta de enlace del servicio API Management en la región predeterminada.
|
properties.gatewayUrl
|
string
|
|
Dirección URL de puerta de enlace del servicio API Management.
|
properties.hostnameConfigurations
|
HostnameConfiguration[]
|
|
Configuración de nombre de host personalizada del servicio API Management.
|
properties.managementApiUrl
|
string
|
|
Dirección URL del punto de conexión de la API de administración del servicio API Management.
|
properties.natGatewayState
|
NatGatewayState
|
Disabled
|
La propiedad se puede usar para habilitar nat Gateway para este servicio de API Management.
|
properties.notificationSenderEmail
|
string
|
|
Email dirección desde la que se enviará la notificación.
|
properties.outboundPublicIPAddresses
|
string[]
|
|
Prefijos de dirección IPV4 públicas de salida asociados al servicio implementado de puerta de enlace NAT. Disponible solo para SKU Premium en la plataforma stv2.
|
properties.platformVersion
|
PlatformVersion
|
|
Versión de la plataforma de proceso que ejecuta el servicio en esta ubicación.
|
properties.portalUrl
|
string
|
|
Dirección URL del punto de conexión del portal del publicador del servicio API Management.
|
properties.privateEndpointConnections
|
RemotePrivateEndpointConnectionWrapper[]
|
|
Lista de conexiones de punto de conexión privado de este servicio.
|
properties.privateIPAddresses
|
string[]
|
|
Direcciones IP de carga equilibrada estática privada del servicio API Management en la región primaria que se implementa en un Virtual Network interno. Solo está disponible para la SKU básica, estándar, premium y aislada.
|
properties.provisioningState
|
string
|
|
El estado de aprovisionamiento actual del servicio API Management que puede ser uno de los siguientes: Created/Activating/Succeeded/Updating/Failed/Stopped/Terminating/TerminationFailed/Deleted.
|
properties.publicIPAddresses
|
string[]
|
|
Direcciones IP públicas de carga equilibrada estática del servicio API Management en la región primaria. Solo está disponible para la SKU básica, estándar, premium y aislada.
|
properties.publicIpAddressId
|
string
|
|
Dirección IP V4 basada en la SKU estándar pública que se va a asociar con Virtual Network servicio implementado en la región. Solo se admite para la implementación de SKU Developer y Premium en Virtual Network.
|
properties.publicNetworkAccess
|
PublicNetworkAccess
|
|
Si se permite o no el acceso al punto de conexión público para este servicio API Management. El valor es opcional, pero si se pasa, debe ser "Habilitado" o "Deshabilitado". Si "Disabled", los puntos de conexión privados son el método de acceso exclusivo. El valor predeterminado es "Enabled"
|
properties.publisherEmail
|
string
|
|
Correo electrónico del publicador.
|
properties.publisherName
|
string
|
|
Nombre del publicador.
|
properties.restore
|
boolean
|
False
|
Quite el servicio Api Management si anteriormente se eliminó temporalmente. Si se especifica esta marca y se establece en True se omitirán todas las demás propiedades.
|
properties.scmUrl
|
string
|
|
Dirección URL del punto de conexión de SCM del servicio API Management.
|
properties.targetProvisioningState
|
string
|
|
Estado de aprovisionamiento del servicio API Management, que está destinado a la operación de larga duración iniciada en el servicio.
|
properties.virtualNetworkConfiguration
|
VirtualNetworkConfiguration
|
|
Configuración de red virtual del servicio API Management.
|
properties.virtualNetworkType
|
VirtualNetworkType
|
None
|
Tipo de VPN en el que se debe configurar API Management servicio. Ninguno (valor predeterminado) significa que el servicio API Management no forma parte de ninguna Virtual Network, external significa que la implementación de API Management se configura dentro de un Virtual Network que tiene un punto de conexión accesible desde Internet y significa internamente que API Management la implementación se configura dentro de un Virtual Network tener solo un punto de conexión accesible desde la intranet.
|
sku
|
ApiManagementServiceSkuProperties
|
|
Propiedades de SKU del servicio API Management.
|
systemData
|
systemData
|
|
Metadatos relacionados con la creación y la última modificación del recurso.
|
tags
|
object
|
|
Etiquetas del recurso.
|
type
|
string
|
|
El tipo de recurso para API Management recurso se establece en Microsoft.ApiManagement.
|
zones
|
string[]
|
|
Una lista de zonas de disponibilidad que indica dónde debe proceder el recurso.
|
ApiManagementServiceSkuProperties
API Management propiedades de SKU de recursos de servicio.
Nombre |
Tipo |
Description |
capacity
|
integer
|
Capacidad de la SKU (número de unidades implementadas de la SKU). Para la capacidad de SKU de consumo debe especificarse como 0.
|
name
|
SkuType
|
Nombre de la SKU.
|
ApimIdentityType
Tipo de identidad que se usa para el recurso. El tipo "SystemAssigned, UserAssigned" incluye una identidad creada implícitamente y un conjunto de identidades asignadas por el usuario. El tipo "None" quitará las identidades del servicio.
Nombre |
Tipo |
Description |
None
|
string
|
|
SystemAssigned
|
string
|
|
SystemAssigned, UserAssigned
|
string
|
|
UserAssigned
|
string
|
|
ApiVersionConstraint
Restricción de versión de api de plano de control para el servicio API Management.
Nombre |
Tipo |
Description |
minApiVersion
|
string
|
Limite las llamadas API del plano de control a API Management servicio con la versión igual o posterior a este valor.
|
ArmIdWrapper
Contenedor para un identificador de recurso de ARM
Nombre |
Tipo |
Description |
id
|
string
|
|
CertificateConfiguration
Configuración de certificado que consta de certificados intermedios y certificados raíz que no son de confianza.
Nombre |
Tipo |
Description |
certificate
|
CertificateInformation
|
Información del certificado.
|
certificatePassword
|
string
|
Contraseña del certificado.
|
encodedCertificate
|
string
|
Certificado codificado en Base64.
|
storeName
|
enum:
-
CertificateAuthority
-
Root
|
Ubicación del almacén de certificados System.Security.Cryptography.x509certificates.StoreName. Solo root y CertificateAuthority son ubicaciones válidas.
|
Información del certificado SSL.
Nombre |
Tipo |
Description |
expiry
|
string
|
Fecha de expiración del certificado. La fecha se ajusta al siguiente formato: yyyy-MM-ddTHH:mm:ssZ según lo especificado por el estándar ISO 8601.
|
subject
|
string
|
Asunto del certificado.
|
thumbprint
|
string
|
Huella digital del certificado
|
CertificateSource
Origen del certificado.
Nombre |
Tipo |
Description |
BuiltIn
|
string
|
|
Custom
|
string
|
|
KeyVault
|
string
|
|
Managed
|
string
|
|
CertificateStatus
Estado del certificado.
Nombre |
Tipo |
Description |
Completed
|
string
|
|
Failed
|
string
|
|
InProgress
|
string
|
|
createdByType
Tipo de identidad que creó el recurso.
Nombre |
Tipo |
Description |
Application
|
string
|
|
Key
|
string
|
|
ManagedIdentity
|
string
|
|
User
|
string
|
|
ErrorFieldContract
Contrato de campo de error.
Nombre |
Tipo |
Description |
code
|
string
|
Código de error de nivel de propiedad.
|
message
|
string
|
Representación legible del error de nivel de propiedad.
|
target
|
string
|
Nombre de propiedad.
|
ErrorResponse
Respuesta de error.
Nombre |
Tipo |
Description |
error.code
|
string
|
Código del error definido por el servicio. Este código funciona como estado secundario del código de error HTTP especificado en la respuesta.
|
error.details
|
ErrorFieldContract[]
|
La lista de campos no válidos que se envían en la solicitud, en caso de error de validación.
|
error.message
|
string
|
Representación legible del error.
|
HostnameConfiguration
Configuración de nombre de host personalizada.
Nombre |
Tipo |
Valor predeterminado |
Description |
certificate
|
CertificateInformation
|
|
Información del certificado.
|
certificatePassword
|
string
|
|
Contraseña del certificado.
|
certificateSource
|
CertificateSource
|
|
Origen del certificado.
|
certificateStatus
|
CertificateStatus
|
|
Estado del certificado.
|
defaultSslBinding
|
boolean
|
False
|
Especifique true para configurar el certificado asociado a este nombre de host como certificado SSL predeterminado. Si un cliente no envía el encabezado SNI, será el certificado que se impugnará. La propiedad es útil si un servicio tiene habilitado varios nombres de host personalizados y debe decidir el certificado ssl predeterminado. La configuración solo se aplica al tipo de nombre de host de puerta de enlace.
|
encodedCertificate
|
string
|
|
Certificado codificado en Base64.
|
hostName
|
string
|
|
Nombre de host que se va a configurar en el servicio Api Management.
|
identityClientId
|
string
|
|
ClientId de identidad administrada asignada por el sistema o el usuario, según lo generado por Azure AD, que tiene acceso GET al almacén de claves que contiene el certificado SSL.
|
keyVaultId
|
string
|
|
Dirección URL al secreto de KeyVault que contiene el certificado Ssl. Si se proporciona la dirección URL absoluta que contiene la versión, la actualización automática del certificado ssl no funcionará. Esto requiere que el servicio Api Management se configure con aka.ms/apimmsi. El secreto debe ser de tipo application/x-pkcs12.
|
negotiateClientCertificate
|
boolean
|
False
|
Especifique true para negociar siempre el certificado de cliente en el nombre de host. El valor predeterminado es false.
|
type
|
HostnameType
|
|
Tipo de nombre de host.
|
HostnameType
Tipo de nombre de host.
Nombre |
Tipo |
Description |
DeveloperPortal
|
string
|
|
Management
|
string
|
|
Portal
|
string
|
|
Proxy
|
string
|
|
Scm
|
string
|
|
NatGatewayState
La propiedad se puede usar para habilitar nat Gateway para este servicio de API Management.
Nombre |
Tipo |
Description |
Disabled
|
string
|
Nat Gateway está deshabilitado para el servicio.
|
Enabled
|
string
|
Nat Gateway está habilitado para el servicio.
|
Versión de la plataforma de proceso que ejecuta el servicio.
Nombre |
Tipo |
Description |
mtv1
|
string
|
Plataforma que ejecuta el servicio en la plataforma Multi Tenant V1.
|
stv1
|
string
|
Plataforma que ejecuta el servicio en la plataforma single tenant V1.
|
stv2
|
string
|
Plataforma que ejecuta el servicio en la plataforma single tenant V2.
|
undetermined
|
string
|
No se puede determinar la versión de la plataforma, ya que la plataforma de proceso no está implementada.
|
PrivateEndpointServiceConnectionStatus
Estado de conexión del punto de conexión privado.
Nombre |
Tipo |
Description |
Approved
|
string
|
|
Pending
|
string
|
|
Rejected
|
string
|
|
PrivateLinkServiceConnectionState
Colección de información sobre el estado de la conexión entre el consumidor del servicio y el proveedor.
Nombre |
Tipo |
Description |
actionsRequired
|
string
|
Mensaje que indica si los cambios en el proveedor de servicios requieren actualizaciones en el consumidor.
|
description
|
string
|
Motivo de aprobación o rechazo de la conexión.
|
status
|
PrivateEndpointServiceConnectionStatus
|
Indica si el propietario del servicio ha aprobado, rechazado o quitado la conexión.
|
PublicNetworkAccess
Si se permite o no el acceso al punto de conexión público para este servicio API Management. El valor es opcional, pero si se pasa, debe ser "Habilitado" o "Deshabilitado". Si "Disabled", los puntos de conexión privados son el método de acceso exclusivo. El valor predeterminado es "Enabled"
Nombre |
Tipo |
Description |
Disabled
|
string
|
|
Enabled
|
string
|
|
RemotePrivateEndpointConnectionWrapper
Recurso de conexión de punto de conexión privado remoto.
Nombre |
Tipo |
Description |
id
|
string
|
Identificador de recurso de conexión de punto de conexión privado
|
name
|
string
|
Nombre de conexión de punto de conexión privado
|
properties.groupIds
|
string[]
|
Todos los identificadores de grupo.
|
properties.privateEndpoint
|
ArmIdWrapper
|
Recurso del punto de conexión privado.
|
properties.privateLinkServiceConnectionState
|
PrivateLinkServiceConnectionState
|
Colección de información sobre el estado de la conexión entre el consumidor del servicio y el proveedor.
|
properties.provisioningState
|
string
|
Estado de aprovisionamiento del recurso de conexión de punto de conexión privado.
|
type
|
string
|
Tipo de recurso de conexión de punto de conexión privado
|
SkuType
Nombre de la SKU.
Nombre |
Tipo |
Description |
Basic
|
string
|
SKU básica de Api Management.
|
Consumption
|
string
|
SKU de consumo de Api Management.
|
Developer
|
string
|
SKU para desarrolladores de Api Management.
|
Isolated
|
string
|
SKU aislada de Api Management.
|
Premium
|
string
|
SKU Premium de Api Management.
|
Standard
|
string
|
SKU estándar de Api Management.
|
systemData
Metadatos relacionados con la creación y la última modificación del recurso.
Nombre |
Tipo |
Description |
createdAt
|
string
|
Marca de tiempo de creación de recursos (UTC).
|
createdBy
|
string
|
Identidad que creó el recurso.
|
createdByType
|
createdByType
|
Tipo de identidad que creó el recurso.
|
lastModifiedAt
|
string
|
Marca de tiempo de la última modificación del recurso (UTC)
|
lastModifiedBy
|
string
|
Identidad que modificó por última vez el recurso.
|
lastModifiedByType
|
createdByType
|
Tipo de identidad que modificó por última vez el recurso.
|
UserIdentityProperties
Nombre |
Tipo |
Description |
clientId
|
string
|
Identificador de cliente de la identidad asignada por el usuario.
|
principalId
|
string
|
Identificador principal de la identidad asignada por el usuario.
|
VirtualNetworkConfiguration
Configuración de una red virtual en la que se implementa API Management servicio.
Nombre |
Tipo |
Description |
subnetResourceId
|
string
|
Identificador de recurso completo de una subred en una red virtual en la que se va a implementar el servicio API Management.
|
subnetname
|
string
|
Nombre de la subred.
|
vnetid
|
string
|
Identificador de red virtual. Normalmente, se trata de un GUID. Espere un GUID nulo de forma predeterminada.
|
VirtualNetworkType
Tipo de VPN en el que se debe configurar API Management servicio. Ninguno (valor predeterminado) significa que el servicio API Management no forma parte de ninguna Virtual Network, external significa que la implementación de API Management se configura dentro de un Virtual Network que tiene un punto de conexión accesible desde Internet y significa internamente que API Management la implementación se configura dentro de un Virtual Network tener solo un punto de conexión accesible desde la intranet.
Nombre |
Tipo |
Description |
External
|
string
|
El servicio forma parte de Virtual Network y es accesible desde Internet.
|
Internal
|
string
|
El servicio forma parte de Virtual Network y solo es accesible desde dentro de la red virtual.
|
None
|
string
|
El servicio no forma parte de ninguna Virtual Network.
|