Skapar eller uppdaterar en API Management-tjänst. Det här är en tidskrävande åtgärd som kan ta flera minuter att slutföra.
	
		PUT https://management.azure.com/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiManagement/service/{serviceName}?api-version=2024-05-01
		URI-parametrar
		
			
				| Name | I | Obligatorisk | Typ | Description | 
				
					| resourceGroupName | path | True | 
					string
			minLength: 1 maxLength: 90
 | Namnet på resursgruppen. Namnet är skiftlägesokänsligt. | 
				
					| serviceName | path | True | 
					string
			minLength: 1 maxLength: 50
 pattern: ^[a-zA-Z](?:[a-zA-Z0-9-]*[a-zA-Z0-9])?$
 | Namnet på API Management-tjänsten. | 
				
					| subscriptionId | path | True | 
					string
(uuid)
			 | ID för målprenumerationen. Värdet måste vara ett UUID. | 
				
					| api-version | query | True | 
					string
			minLength: 1 | DEN API-version som ska användas för den här åtgärden. | 
		
		Begärandetext
			
			
				
					| Name | Obligatorisk | Typ | Description | 
	| location | True | 
					string
			 | Resursplats. | 
	| properties.publisherEmail | True | 
					string
			maxLength: 100 | E-post för utgivare. | 
	| properties.publisherName | True | 
					string
			maxLength: 100 | Utgivarens namn. | 
	| sku | True | 
					ApiManagementServiceSkuProperties
			 | SKU-egenskaper för API Management-tjänsten. | 
	| identity |  | 
					ApiManagementServiceIdentity
			 | Hanterad tjänstidentitet för Api Management-tjänsten. | 
	| properties.additionalLocations |  | 
					AdditionalLocation[]
			 | Ytterligare datacenterplatser för API Management-tjänsten. | 
	| properties.apiVersionConstraint |  | 
					ApiVersionConstraint
			 | Kontrollplans-API:ets versionsvillkor för API Management-tjänsten. | 
	| properties.certificates |  | 
					CertificateConfiguration[]
			 | Lista över certifikat som måste installeras i API Management-tjänsten. Maximalt antal certifikat som stöds som kan installeras är 10. | 
	| properties.configurationApi |  | 
					ConfigurationApi
			 | Konfigurations-API-konfiguration för API Management-tjänsten. | 
	| properties.customProperties |  | 
					object
			 | Anpassade egenskaper för API Management-tjänsten.Inställning
 Microsoft.WindowsAzure.ApiManagement.Gateway.Security.Ciphers.TripleDes168inaktiverar chiffer TLS_RSA_WITH_3DES_EDE_CBC_SHA för alla TLS(1.0, 1.1 och 1.2).Inställning
 Microsoft.WindowsAzure.ApiManagement.Gateway.Security.Protocols.Tls11kan användas för att inaktivera bara TLS 1.1.Inställning
 Microsoft.WindowsAzure.ApiManagement.Gateway.Security.Protocols.Tls10kan användas för att inaktivera TLS 1.0 på en API Management-tjänst.Inställning
 Microsoft.WindowsAzure.ApiManagement.Gateway.Security.Backend.Protocols.Tls11kan användas för att inaktivera endast TLS 1.1 för kommunikation med serverdelar.Inställning
 Microsoft.WindowsAzure.ApiManagement.Gateway.Security.Backend.Protocols.Tls10kan användas för att inaktivera TLS 1.0 för kommunikation med serverdelar.Inställning
 Microsoft.WindowsAzure.ApiManagement.Gateway.Protocols.Server.Http2kan användas för att aktivera HTTP2-protokoll på en API Management-tjänst.Om du inte anger någon av dessa egenskaper för PATCH-åtgärden återställs utelämnade egenskapers värden till standardvärdena. För alla inställningar utom Http2 är standardvärdet
 Trueom tjänsten skapades den 1 april 2018 eller före den 1 april 2018 ochFalseannat. Http2-inställningens standardvärde ärFalse.
 Du kan inaktivera något av följande chiffer med hjälp av inställningarna
 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_128_CBC_SHA256, TLS_RSA_WITH_AES_256_CBC_SHA, TLS_RSA_WITH_AES_128_CBC_SHA. Till exempelMicrosoft.WindowsAzure.ApiManagement.Gateway.Security.Ciphers.TLS_RSA_WITH_AES_128_CBC_SHA256:false. Standardvärdet ärtrueför dem.Obs! Följande chiffer kan inte inaktiveras eftersom de krävs av interna plattformskomponenter: 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.developerPortalStatus |  | 
					developerPortalStatus
			 | Status för utvecklarportalen i den här API Management-tjänsten. | 
	| properties.disableGateway |  | 
					boolean
			 | Egenskapen är endast giltig för en Api Management-tjänst som distribuerats på flera platser. Detta kan användas för att inaktivera gatewayen i huvudregionen. | 
	| properties.enableClientCertificate |  | 
					boolean
			 | Egenskapen är endast avsedd att användas för förbruknings-SKU-tjänsten. Detta framtvingar att ett klientcertifikat visas på varje begäran till gatewayen. Detta gör det också möjligt att autentisera certifikatet i principen på gatewayen. | 
	| properties.hostnameConfigurations |  | 
					HostnameConfiguration[]
			 | Konfiguration av anpassat värdnamn för API Management-tjänsten. | 
	| properties.legacyPortalStatus |  | 
					LegacyPortalStatus
			 | Status för den äldre portalen i API Management-tjänsten. | 
	| properties.natGatewayState |  | 
					NatGatewayState
			 | Egenskapen kan användas för att aktivera NAT Gateway för den här API Management-tjänsten. | 
	| properties.notificationSenderEmail |  | 
					string
			maxLength: 100 | E-postadress som meddelandet ska skickas från. | 
	| properties.privateEndpointConnections |  | 
					RemotePrivateEndpointConnectionWrapper[]
			 | Lista över privata slutpunktsanslutningar för den här tjänsten. | 
	| properties.publicIpAddressId |  | 
					string
			 | Public Standard SKU IP V4-baserad IP-adress som ska associeras med distribuerad tjänst för virtuellt nätverk i regionen. Stöds endast för utvecklare och Premium SKU som distribueras i virtuellt nätverk. | 
	| properties.publicNetworkAccess |  | 
					PublicNetworkAccess
			 | Om offentlig slutpunktsåtkomst tillåts för den här API Management-tjänsten eller inte.  Värdet är valfritt, men om det skickas in måste det vara "Aktiverat" eller "Inaktiverat". Om "Inaktiverad" är privata slutpunkter den exklusiva åtkomstmetoden. Standardvärdet är "Aktiverat" | 
	| properties.restore |  | 
					boolean
			 | Ta bort Api Management-tjänsten om den tidigare var mjuk borttagen. Om den här flaggan anges och är inställd på Sant ignoreras alla andra egenskaper. | 
	| properties.virtualNetworkConfiguration |  | 
					VirtualNetworkConfiguration
			 | Konfiguration av virtuellt nätverk för API Management-tjänsten. | 
	| properties.virtualNetworkType |  | 
					VirtualNetworkType
			 | Den typ av VPN som API Management-tjänsten måste konfigureras i. Ingen (standardvärde) innebär att API Management-tjänsten inte ingår i något virtuellt nätverk, externt innebär att API Management-distributionen har konfigurerats i ett virtuellt nätverk med en Internetuppkopplad slutpunkt, och intern innebär att API Management-distributionen konfigureras i ett virtuellt nätverk som endast har en intranätuppkopplad slutpunkt. | 
	| tags |  | 
					object
			 | Resurstaggar. | 
	| zones |  | 
					string[]
			 | En lista över tillgänglighetszoner som anger var resursen måste komma ifrån. | 
			
		Svar
		
		Säkerhet
			azure_auth
			Azure Active Directory OAuth2-flöde.
			
					Typ: 
					oauth2
					Flow: 
					implicit
					Auktoriseringswebbadress: 
					https://login.microsoftonline.com/common/oauth2/authorize
			
				Omfattningar
				
					
						| Name | Description | 
						
							| user_impersonation | personifiera ditt användarkonto | 
				
		Exempel
			
				ApiManagementCreateMultiRegionServiceWithCustomHostname
			
				Exempelbegäran
						
PUT https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rg1/providers/Microsoft.ApiManagement/service/apimService1?api-version=2024-05-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"
      },
      {
        "type": "ConfigurationApi",
        "hostName": "configuration-api.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/2024-05-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"),
                new HostnameConfiguration().withType(HostnameType.CONFIGURATION_API)
                    .withHostname("configuration-api.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="00000000-0000-0000-0000-000000000000",
    )
    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",
                    },
                    {
                        "certificatePassword": "Password",
                        "encodedCertificate": "****** Base 64 Encoded Certificate ************",
                        "hostName": "configuration-api.msitesting.net",
                        "type": "ConfigurationApi",
                    },
                ],
                "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/2024-05-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/v3"
)
// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/e436160e64c0f8d7fb20d662be2712f71f0a7ef5/specification/apimanagement/resource-manager/Microsoft.ApiManagement/stable/2024-05-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"),
				},
				{
					Type:                to.Ptr(armapimanagement.HostnameTypeConfigurationAPI),
					CertificatePassword: to.Ptr("Password"),
					EncodedCertificate:  to.Ptr("****** Base 64 Encoded Certificate ************"),
					HostName:            to.Ptr("configuration-api.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/00000000-0000-0000-0000-000000000000/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),
	// 				},
	// 				{
	// 					Type: to.Ptr(armapimanagement.HostnameTypeConfigurationAPI),
	// 					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("configuration-api.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");
require("dotenv/config");
/**
 * 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/2024-05-01/examples/ApiManagementCreateMultiRegionServiceWithCustomHostname.json
 */
async function apiManagementCreateMultiRegionServiceWithCustomHostname() {
  const subscriptionId =
    process.env["APIMANAGEMENT_SUBSCRIPTION_ID"] || "00000000-0000-0000-0000-000000000000";
  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",
      },
      {
        type: "ConfigurationApi",
        certificatePassword: "Password",
        encodedCertificate: "****** Base 64 Encoded Certificate ************",
        hostName: "configuration-api.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
using Azure;
using Azure.ResourceManager;
using System;
using System.Threading.Tasks;
using Azure.Core;
using Azure.Identity;
using Azure.ResourceManager.ApiManagement.Models;
using Azure.ResourceManager.Models;
using Azure.ResourceManager.Resources;
using Azure.ResourceManager.ApiManagement;
// Generated from example definition: specification/apimanagement/resource-manager/Microsoft.ApiManagement/stable/2024-05-01/examples/ApiManagementCreateMultiRegionServiceWithCustomHostname.json
// this example is just showing the usage of "ApiManagementService_CreateOrUpdate" operation, for the dependent resources, they will have to be created separately.
// get your azure access token, for more details of how Azure SDK get your access token, please refer to https://free.blessedness.top/en-us/dotnet/azure/sdk/authentication?tabs=command-line
TokenCredential cred = new DefaultAzureCredential();
// authenticate your client
ArmClient client = new ArmClient(cred);
// this example assumes you already have this ResourceGroupResource created on azure
// for more information of creating ResourceGroupResource, please refer to the document of ResourceGroupResource
string subscriptionId = "00000000-0000-0000-0000-000000000000";
string resourceGroupName = "rg1";
ResourceIdentifier resourceGroupResourceId = ResourceGroupResource.CreateResourceIdentifier(subscriptionId, resourceGroupName);
ResourceGroupResource resourceGroupResource = client.GetResourceGroupResource(resourceGroupResourceId);
// get the collection of this ApiManagementServiceResource
ApiManagementServiceCollection collection = resourceGroupResource.GetApiManagementServices();
// invoke the operation
string serviceName = "apimService1";
ApiManagementServiceData data = new ApiManagementServiceData(new AzureLocation("West US"), new ApiManagementServiceSkuProperties(ApiManagementServiceSkuType.Premium, 1), "apim@autorestsdk.com", "autorestsdk")
{
    HostnameConfigurations = {new HostnameConfiguration(HostnameType.Proxy, "gateway1.msitesting.net")
    {
    EncodedCertificate = "****** Base 64 Encoded Certificate ************",
    CertificatePassword = "Password",
    IsDefaultSslBindingEnabled = true,
    }, new HostnameConfiguration(HostnameType.Management, "mgmt.msitesting.net")
    {
    EncodedCertificate = "****** Base 64 Encoded Certificate ************",
    CertificatePassword = "Password",
    }, new HostnameConfiguration(HostnameType.Portal, "portal1.msitesting.net")
    {
    EncodedCertificate = "****** Base 64 Encoded Certificate ************",
    CertificatePassword = "Password",
    }, new HostnameConfiguration(HostnameType.ConfigurationApi, "configuration-api.msitesting.net")
    {
    EncodedCertificate = "****** Base 64 Encoded Certificate ************",
    CertificatePassword = "Password",
    }},
    AdditionalLocations = {new AdditionalLocation(new AzureLocation("East US"), new ApiManagementServiceSkuProperties(ApiManagementServiceSkuType.Premium, 1))
    {
    DisableGateway = true,
    }},
    VirtualNetworkType = VirtualNetworkType.None,
    MinApiVersion = "2019-01-01",
    Tags =
    {
    ["tag1"] = "value1",
    ["tag2"] = "value2",
    ["tag3"] = "value3"
    },
};
ArmOperation<ApiManagementServiceResource> lro = await collection.CreateOrUpdateAsync(WaitUntil.Completed, serviceName, data);
ApiManagementServiceResource result = lro.Value;
// the variable result is a resource, you could call other operations on this instance as well
// but just for demo, we get its data from this resource instance
ApiManagementServiceData resourceData = result.Data;
// for demo we just print out the id
Console.WriteLine($"Succeeded on id: {resourceData.Id}");
To use the Azure SDK library in your project, see this documentation. To provide feedback on this code sample, open a GitHub issue
 
			 
				
					Exempelsvar
						
							Location: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rg1/providers/Microsoft.ApiManagement/service/apimService1/operationresults/ZWFzdHVzOmFuZHktdGVzdGluZy0yMDIyLTA0LTAxLXByZXZpZXctNF9BY3RfODQ2ZWE4Ng==?api-version=2024-05-01&asyncResponse
Azure-AsyncOperation: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rg1/providers/Microsoft.ApiManagement/service/apimService1/operationresults/ZWFzdHVzOmFuZHktdGVzdGluZy0yMDIyLTA0LTAxLXByZXZpZXctNF9BY3RfODQ2ZWE4Ng==?api-version=2024-05-01&asyncResponse
								
							{
  "id": "/subscriptions/00000000-0000-0000-0000-000000000000/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
      },
      {
        "type": "ConfigurationApi",
        "hostName": "configuration-api.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/00000000-0000-0000-0000-000000000000/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
      },
      {
        "type": "ConfigurationApi",
        "hostName": "configuration-api.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
			
				Exempelbegäran
						
PUT https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rg1/providers/Microsoft.ApiManagement/service/apimService1?api-version=2024-05-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/2024-05-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="00000000-0000-0000-0000-000000000000",
    )
    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/2024-05-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/v3"
)
// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/e436160e64c0f8d7fb20d662be2712f71f0a7ef5/specification/apimanagement/resource-manager/Microsoft.ApiManagement/stable/2024-05-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/00000000-0000-0000-0000-000000000000/resourceGroups/rg1/providers/Microsoft.ApiManagement/service/apimService1"),
	// 	Tags: map[string]*string{
	// 		"api-version": to.Ptr("2024-05-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");
require("dotenv/config");
/**
 * 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/2024-05-01/examples/ApiManagementCreateService.json
 */
async function apiManagementCreateService() {
  const subscriptionId =
    process.env["APIMANAGEMENT_SUBSCRIPTION_ID"] || "00000000-0000-0000-0000-000000000000";
  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
using Azure;
using Azure.ResourceManager;
using System;
using System.Threading.Tasks;
using Azure.Core;
using Azure.Identity;
using Azure.ResourceManager.ApiManagement.Models;
using Azure.ResourceManager.Models;
using Azure.ResourceManager.Resources;
using Azure.ResourceManager.ApiManagement;
// Generated from example definition: specification/apimanagement/resource-manager/Microsoft.ApiManagement/stable/2024-05-01/examples/ApiManagementCreateService.json
// this example is just showing the usage of "ApiManagementService_CreateOrUpdate" operation, for the dependent resources, they will have to be created separately.
// get your azure access token, for more details of how Azure SDK get your access token, please refer to https://free.blessedness.top/en-us/dotnet/azure/sdk/authentication?tabs=command-line
TokenCredential cred = new DefaultAzureCredential();
// authenticate your client
ArmClient client = new ArmClient(cred);
// this example assumes you already have this ResourceGroupResource created on azure
// for more information of creating ResourceGroupResource, please refer to the document of ResourceGroupResource
string subscriptionId = "00000000-0000-0000-0000-000000000000";
string resourceGroupName = "rg1";
ResourceIdentifier resourceGroupResourceId = ResourceGroupResource.CreateResourceIdentifier(subscriptionId, resourceGroupName);
ResourceGroupResource resourceGroupResource = client.GetResourceGroupResource(resourceGroupResourceId);
// get the collection of this ApiManagementServiceResource
ApiManagementServiceCollection collection = resourceGroupResource.GetApiManagementServices();
// invoke the operation
string serviceName = "apimService1";
ApiManagementServiceData data = new ApiManagementServiceData(new AzureLocation("South Central US"), new ApiManagementServiceSkuProperties(ApiManagementServiceSkuType.Developer, 1), "foo@contoso.com", "foo")
{
    Tags =
    {
    ["Name"] = "Contoso",
    ["Test"] = "User"
    },
};
ArmOperation<ApiManagementServiceResource> lro = await collection.CreateOrUpdateAsync(WaitUntil.Completed, serviceName, data);
ApiManagementServiceResource result = lro.Value;
// the variable result is a resource, you could call other operations on this instance as well
// but just for demo, we get its data from this resource instance
ApiManagementServiceData resourceData = result.Data;
// for demo we just print out the id
Console.WriteLine($"Succeeded on id: {resourceData.Id}");
To use the Azure SDK library in your project, see this documentation. To provide feedback on this code sample, open a GitHub issue
 
			 
				
					Exempelsvar
						
							Location: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rg1/providers/Microsoft.ApiManagement/service/apimService1/operationresults/ZWFzdHVzOmFuZHktdGVzdGluZy0yMDIyLTA0LTAxLXByZXZpZXctNF9BY3RfODQ2ZWE4Ng==?api-version=2024-05-01&asyncResponse
Azure-AsyncOperation: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rg1/providers/Microsoft.ApiManagement/service/apimService1/operationresults/ZWFzdHVzOmFuZHktdGVzdGluZy0yMDIyLTA0LTAxLXByZXZpZXctNF9BY3RfODQ2ZWE4Ng==?api-version=2024-05-01&asyncResponse
								
							{
  "id": "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rg1/providers/Microsoft.ApiManagement/service/apimService1",
  "name": "apimService1",
  "type": "Microsoft.ApiManagement/service",
  "tags": {
    "api-version": "2024-05-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/00000000-0000-0000-0000-000000000000/resourceGroups/rg1/providers/Microsoft.ApiManagement/service/apimService1",
  "name": "apimService1",
  "type": "Microsoft.ApiManagement/service",
  "tags": {
    "api-version": "2024-05-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
			
				Exempelbegäran
						
PUT https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rg1/providers/Microsoft.ApiManagement/service/apimService1?api-version=2024-05-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/2024-05-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="00000000-0000-0000-0000-000000000000",
    )
    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/2024-05-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/v3"
)
// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/e436160e64c0f8d7fb20d662be2712f71f0a7ef5/specification/apimanagement/resource-manager/Microsoft.ApiManagement/stable/2024-05-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/00000000-0000-0000-0000-000000000000/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");
require("dotenv/config");
/**
 * 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/2024-05-01/examples/ApiManagementCreateServiceHavingMsi.json
 */
async function apiManagementCreateServiceHavingMsi() {
  const subscriptionId =
    process.env["APIMANAGEMENT_SUBSCRIPTION_ID"] || "00000000-0000-0000-0000-000000000000";
  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
using Azure;
using Azure.ResourceManager;
using System;
using System.Threading.Tasks;
using Azure.Core;
using Azure.Identity;
using Azure.ResourceManager.ApiManagement.Models;
using Azure.ResourceManager.Models;
using Azure.ResourceManager.Resources;
using Azure.ResourceManager.ApiManagement;
// Generated from example definition: specification/apimanagement/resource-manager/Microsoft.ApiManagement/stable/2024-05-01/examples/ApiManagementCreateServiceHavingMsi.json
// this example is just showing the usage of "ApiManagementService_CreateOrUpdate" operation, for the dependent resources, they will have to be created separately.
// get your azure access token, for more details of how Azure SDK get your access token, please refer to https://free.blessedness.top/en-us/dotnet/azure/sdk/authentication?tabs=command-line
TokenCredential cred = new DefaultAzureCredential();
// authenticate your client
ArmClient client = new ArmClient(cred);
// this example assumes you already have this ResourceGroupResource created on azure
// for more information of creating ResourceGroupResource, please refer to the document of ResourceGroupResource
string subscriptionId = "00000000-0000-0000-0000-000000000000";
string resourceGroupName = "rg1";
ResourceIdentifier resourceGroupResourceId = ResourceGroupResource.CreateResourceIdentifier(subscriptionId, resourceGroupName);
ResourceGroupResource resourceGroupResource = client.GetResourceGroupResource(resourceGroupResourceId);
// get the collection of this ApiManagementServiceResource
ApiManagementServiceCollection collection = resourceGroupResource.GetApiManagementServices();
// invoke the operation
string serviceName = "apimService1";
ApiManagementServiceData data = new ApiManagementServiceData(new AzureLocation("West US"), new ApiManagementServiceSkuProperties(ApiManagementServiceSkuType.Consumption, 0), "apim@autorestsdk.com", "autorestsdk")
{
    Identity = new ManagedServiceIdentity("SystemAssigned"),
    Tags =
    {
    ["tag1"] = "value1",
    ["tag2"] = "value2",
    ["tag3"] = "value3"
    },
};
ArmOperation<ApiManagementServiceResource> lro = await collection.CreateOrUpdateAsync(WaitUntil.Completed, serviceName, data);
ApiManagementServiceResource result = lro.Value;
// the variable result is a resource, you could call other operations on this instance as well
// but just for demo, we get its data from this resource instance
ApiManagementServiceData resourceData = result.Data;
// for demo we just print out the id
Console.WriteLine($"Succeeded on id: {resourceData.Id}");
To use the Azure SDK library in your project, see this documentation. To provide feedback on this code sample, open a GitHub issue
 
			 
				
					Exempelsvar
						
							Location: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rg1/providers/Microsoft.ApiManagement/service/apimService1/operationresults/ZWFzdHVzOmFuZHktdGVzdGluZy0yMDIyLTA0LTAxLXByZXZpZXctNF9BY3RfODQ2ZWE4Ng==?api-version=2024-05-01&asyncResponse
Azure-AsyncOperation: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rg1/providers/Microsoft.ApiManagement/service/apimService1/operationresults/ZWFzdHVzOmFuZHktdGVzdGluZy0yMDIyLTA0LTAxLXByZXZpZXctNF9BY3RfODQ2ZWE4Ng==?api-version=2024-05-01&asyncResponse
								
							{
  "id": "/subscriptions/00000000-0000-0000-0000-000000000000/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/00000000-0000-0000-0000-000000000000/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
			
				Exempelbegäran
						
PUT https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rg1/providers/Microsoft.ApiManagement/service/apimService1?api-version=2024-05-01
{
  "properties": {
    "publisherEmail": "apim@autorestsdk.com",
    "publisherName": "autorestsdk",
    "virtualNetworkConfiguration": {
      "subnetResourceId": "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rgName/providers/Microsoft.Network/virtualNetworks/apimcus/subnets/tenant"
    },
    "publicIpAddressId": "/subscriptions/00000000-0000-0000-0000-000000000000/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/2024-05-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/00000000-0000-0000-0000-000000000000/resourceGroups/rgName/providers/Microsoft.Network/publicIPAddresses/apimazvnet")
            .withVirtualNetworkConfiguration(new VirtualNetworkConfiguration().withSubnetResourceId(
                "/subscriptions/00000000-0000-0000-0000-000000000000/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="00000000-0000-0000-0000-000000000000",
    )
    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/00000000-0000-0000-0000-000000000000/resourceGroups/rgName/providers/Microsoft.Network/publicIPAddresses/apimazvnet",
                "publisherEmail": "apim@autorestsdk.com",
                "publisherName": "autorestsdk",
                "virtualNetworkConfiguration": {
                    "subnetResourceId": "/subscriptions/00000000-0000-0000-0000-000000000000/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/2024-05-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/v3"
)
// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/e436160e64c0f8d7fb20d662be2712f71f0a7ef5/specification/apimanagement/resource-manager/Microsoft.ApiManagement/stable/2024-05-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/00000000-0000-0000-0000-000000000000/resourceGroups/rgName/providers/Microsoft.Network/publicIPAddresses/apimazvnet"),
			VirtualNetworkConfiguration: &armapimanagement.VirtualNetworkConfiguration{
				SubnetResourceID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/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/00000000-0000-0000-0000-000000000000/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/00000000-0000-0000-0000-000000000000/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/00000000-0000-0000-0000-000000000000/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");
require("dotenv/config");
/**
 * 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/2024-05-01/examples/ApiManagementCreateServiceInVnetWithPublicIP.json
 */
async function apiManagementCreateServiceInVnetWithPublicIP() {
  const subscriptionId =
    process.env["APIMANAGEMENT_SUBSCRIPTION_ID"] || "00000000-0000-0000-0000-000000000000";
  const resourceGroupName = process.env["APIMANAGEMENT_RESOURCE_GROUP"] || "rg1";
  const serviceName = "apimService1";
  const parameters = {
    location: "East US 2 EUAP",
    publicIpAddressId:
      "/subscriptions/00000000-0000-0000-0000-000000000000/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/00000000-0000-0000-0000-000000000000/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
using Azure;
using Azure.ResourceManager;
using System;
using System.Threading.Tasks;
using Azure.Core;
using Azure.Identity;
using Azure.ResourceManager.ApiManagement.Models;
using Azure.ResourceManager.Models;
using Azure.ResourceManager.Resources;
using Azure.ResourceManager.ApiManagement;
// Generated from example definition: specification/apimanagement/resource-manager/Microsoft.ApiManagement/stable/2024-05-01/examples/ApiManagementCreateServiceInVnetWithPublicIP.json
// this example is just showing the usage of "ApiManagementService_CreateOrUpdate" operation, for the dependent resources, they will have to be created separately.
// get your azure access token, for more details of how Azure SDK get your access token, please refer to https://free.blessedness.top/en-us/dotnet/azure/sdk/authentication?tabs=command-line
TokenCredential cred = new DefaultAzureCredential();
// authenticate your client
ArmClient client = new ArmClient(cred);
// this example assumes you already have this ResourceGroupResource created on azure
// for more information of creating ResourceGroupResource, please refer to the document of ResourceGroupResource
string subscriptionId = "00000000-0000-0000-0000-000000000000";
string resourceGroupName = "rg1";
ResourceIdentifier resourceGroupResourceId = ResourceGroupResource.CreateResourceIdentifier(subscriptionId, resourceGroupName);
ResourceGroupResource resourceGroupResource = client.GetResourceGroupResource(resourceGroupResourceId);
// get the collection of this ApiManagementServiceResource
ApiManagementServiceCollection collection = resourceGroupResource.GetApiManagementServices();
// invoke the operation
string serviceName = "apimService1";
ApiManagementServiceData data = new ApiManagementServiceData(new AzureLocation("East US 2 EUAP"), new ApiManagementServiceSkuProperties(ApiManagementServiceSkuType.Premium, 2), "apim@autorestsdk.com", "autorestsdk")
{
    Zones = { "1", "2" },
    PublicIPAddressId = new ResourceIdentifier("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rgName/providers/Microsoft.Network/publicIPAddresses/apimazvnet"),
    VirtualNetworkConfiguration = new VirtualNetworkConfiguration
    {
        SubnetResourceId = new ResourceIdentifier("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rgName/providers/Microsoft.Network/virtualNetworks/apimcus/subnets/tenant"),
    },
    VirtualNetworkType = VirtualNetworkType.External,
    Tags =
    {
    ["tag1"] = "value1",
    ["tag2"] = "value2",
    ["tag3"] = "value3"
    },
};
ArmOperation<ApiManagementServiceResource> lro = await collection.CreateOrUpdateAsync(WaitUntil.Completed, serviceName, data);
ApiManagementServiceResource result = lro.Value;
// the variable result is a resource, you could call other operations on this instance as well
// but just for demo, we get its data from this resource instance
ApiManagementServiceData resourceData = result.Data;
// for demo we just print out the id
Console.WriteLine($"Succeeded on id: {resourceData.Id}");
To use the Azure SDK library in your project, see this documentation. To provide feedback on this code sample, open a GitHub issue
 
			 
				
					Exempelsvar
						
							Location: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rg1/providers/Microsoft.ApiManagement/service/apimService1/operationresults/ZWFzdHVzOmFuZHktdGVzdGluZy0yMDIyLTA0LTAxLXByZXZpZXctNF9BY3RfODQ2ZWE4Ng==?api-version=2024-05-01&asyncResponse
Azure-AsyncOperation: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rg1/providers/Microsoft.ApiManagement/service/apimService1/operationresults/ZWFzdHVzOmFuZHktdGVzdGluZy0yMDIyLTA0LTAxLXByZXZpZXctNF9BY3RfODQ2ZWE4Ng==?api-version=2024-05-01&asyncResponse
								
							{
  "id": "/subscriptions/00000000-0000-0000-0000-000000000000/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/00000000-0000-0000-0000-000000000000/resourceGroups/rgName/providers/Microsoft.Network/publicIPAddresses/apimazvnet",
    "virtualNetworkConfiguration": {
      "subnetResourceId": "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rgName/providers/Microsoft.Network/virtualNetworks/apimcus/subnets/tenant"
    },
    "virtualNetworkType": "External",
    "disableGateway": false,
    "platformVersion": "stv2.1"
  },
  "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/00000000-0000-0000-0000-000000000000/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/00000000-0000-0000-0000-000000000000/resourceGroups/rgName/providers/Microsoft.Network/publicIPAddresses/apimazvnet",
    "virtualNetworkConfiguration": {
      "subnetResourceId": "/subscriptions/00000000-0000-0000-0000-000000000000/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
			
				Exempelbegäran
						
PUT https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rg1/providers/Microsoft.ApiManagement/service/apimService1?api-version=2024-05-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/2024-05-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="00000000-0000-0000-0000-000000000000",
    )
    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/2024-05-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/v3"
)
// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/e436160e64c0f8d7fb20d662be2712f71f0a7ef5/specification/apimanagement/resource-manager/Microsoft.ApiManagement/stable/2024-05-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/00000000-0000-0000-0000-000000000000/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");
require("dotenv/config");
/**
 * 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/2024-05-01/examples/ApiManagementCreateServiceInZones.json
 */
async function apiManagementCreateServiceInZones() {
  const subscriptionId =
    process.env["APIMANAGEMENT_SUBSCRIPTION_ID"] || "00000000-0000-0000-0000-000000000000";
  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
using Azure;
using Azure.ResourceManager;
using System;
using System.Threading.Tasks;
using Azure.Core;
using Azure.Identity;
using Azure.ResourceManager.ApiManagement.Models;
using Azure.ResourceManager.Models;
using Azure.ResourceManager.Resources;
using Azure.ResourceManager.ApiManagement;
// Generated from example definition: specification/apimanagement/resource-manager/Microsoft.ApiManagement/stable/2024-05-01/examples/ApiManagementCreateServiceInZones.json
// this example is just showing the usage of "ApiManagementService_CreateOrUpdate" operation, for the dependent resources, they will have to be created separately.
// get your azure access token, for more details of how Azure SDK get your access token, please refer to https://free.blessedness.top/en-us/dotnet/azure/sdk/authentication?tabs=command-line
TokenCredential cred = new DefaultAzureCredential();
// authenticate your client
ArmClient client = new ArmClient(cred);
// this example assumes you already have this ResourceGroupResource created on azure
// for more information of creating ResourceGroupResource, please refer to the document of ResourceGroupResource
string subscriptionId = "00000000-0000-0000-0000-000000000000";
string resourceGroupName = "rg1";
ResourceIdentifier resourceGroupResourceId = ResourceGroupResource.CreateResourceIdentifier(subscriptionId, resourceGroupName);
ResourceGroupResource resourceGroupResource = client.GetResourceGroupResource(resourceGroupResourceId);
// get the collection of this ApiManagementServiceResource
ApiManagementServiceCollection collection = resourceGroupResource.GetApiManagementServices();
// invoke the operation
string serviceName = "apimService1";
ApiManagementServiceData data = new ApiManagementServiceData(new AzureLocation("North europe"), new ApiManagementServiceSkuProperties(ApiManagementServiceSkuType.Premium, 2), "apim@autorestsdk.com", "autorestsdk")
{
    Zones = { "1", "2" },
    Tags =
    {
    ["tag1"] = "value1",
    ["tag2"] = "value2",
    ["tag3"] = "value3"
    },
};
ArmOperation<ApiManagementServiceResource> lro = await collection.CreateOrUpdateAsync(WaitUntil.Completed, serviceName, data);
ApiManagementServiceResource result = lro.Value;
// the variable result is a resource, you could call other operations on this instance as well
// but just for demo, we get its data from this resource instance
ApiManagementServiceData resourceData = result.Data;
// for demo we just print out the id
Console.WriteLine($"Succeeded on id: {resourceData.Id}");
To use the Azure SDK library in your project, see this documentation. To provide feedback on this code sample, open a GitHub issue
 
			 
				
					Exempelsvar
						
							Location: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rg1/providers/Microsoft.ApiManagement/service/apimService1/operationresults/ZWFzdHVzOmFuZHktdGVzdGluZy0yMDIyLTA0LTAxLXByZXZpZXctNF9BY3RfODQ2ZWE4Ng==?api-version=2024-05-01&asyncResponse
Azure-AsyncOperation: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rg1/providers/Microsoft.ApiManagement/service/apimService1/operationresults/ZWFzdHVzOmFuZHktdGVzdGluZy0yMDIyLTA0LTAxLXByZXZpZXctNF9BY3RfODQ2ZWE4Ng==?api-version=2024-05-01&asyncResponse
								
							{
  "id": "/subscriptions/00000000-0000-0000-0000-000000000000/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/00000000-0000-0000-0000-000000000000/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"
  }
}
				 
				ApiManagementCreateServiceSkuv2Service
			
				Exempelbegäran
						
PUT https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rg1/providers/Microsoft.ApiManagement/service/apimService1?api-version=2024-05-01
{
  "properties": {
    "publisherEmail": "apim@autorestsdk.com",
    "publisherName": "autorestsdk"
  },
  "sku": {
    "name": "StandardV2",
    "capacity": 1
  },
  "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/2024-05-01/examples/
     * ApiManagementCreateServiceSkuv2Service.json
     */
    /**
     * Sample code: ApiManagementCreateServiceSkuv2Service.
     * 
     * @param manager Entry point to ApiManagementManager.
     */
    public static void
        apiManagementCreateServiceSkuv2Service(com.azure.resourcemanager.apimanagement.ApiManagementManager manager) {
        manager.apiManagementServices().define("apimService1").withRegion("West US").withExistingResourceGroup("rg1")
            .withSku(new ApiManagementServiceSkuProperties().withName(SkuType.STANDARD_V2).withCapacity(1))
            .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_skuv2_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="00000000-0000-0000-0000-000000000000",
    )
    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": 1, "name": "StandardV2"},
            "tags": {"tag1": "value1", "tag2": "value2", "tag3": "value3"},
        },
    ).result()
    print(response)
# x-ms-original-file: specification/apimanagement/resource-manager/Microsoft.ApiManagement/stable/2024-05-01/examples/ApiManagementCreateServiceSkuv2Service.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/v3"
)
// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/e436160e64c0f8d7fb20d662be2712f71f0a7ef5/specification/apimanagement/resource-manager/Microsoft.ApiManagement/stable/2024-05-01/examples/ApiManagementCreateServiceSkuv2Service.json
func ExampleServiceClient_BeginCreateOrUpdate_apiManagementCreateServiceSkuv2Service() {
	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.SKUTypeStandardV2),
			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/00000000-0000-0000-0000-000000000000/resourceGroups/rg1/providers/Microsoft.ApiManagement/service/apimService1"),
	// 	Tags: map[string]*string{
	// 	},
	// 	Etag: to.Ptr("AAAAAAA3fHM="),
	// 	Identity: &armapimanagement.ServiceIdentity{
	// 		Type: to.Ptr(armapimanagement.ApimIdentityTypeSystemAssigned),
	// 		PrincipalID: to.Ptr("de161222-0000-0000-0000-1caa5d9f0b0e"),
	// 		TenantID: to.Ptr("72f988bf-0000-0000-0000-2d7cd011db47"),
	// 	},
	// 	Location: to.Ptr("East US"),
	// 	Properties: &armapimanagement.ServiceProperties{
	// 		CreatedAtUTC: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2023-08-10T18:50:52.550Z"); 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),
	// 		}},
	// 		NatGatewayState: to.Ptr(armapimanagement.NatGatewayState("Unsupported")),
	// 		NotificationSenderEmail: to.Ptr("apimgmt-noreply@mail.windowsazure.com"),
	// 		PlatformVersion: to.Ptr(armapimanagement.PlatformVersionUndetermined),
	// 		ProvisioningState: to.Ptr("Succeeded"),
	// 		PublicNetworkAccess: to.Ptr(armapimanagement.PublicNetworkAccessEnabled),
	// 		TargetProvisioningState: to.Ptr(""),
	// 		VirtualNetworkType: to.Ptr(armapimanagement.VirtualNetworkTypeNone),
	// 		PublisherEmail: to.Ptr("apim@contoso.com"),
	// 		PublisherName: to.Ptr("apimgmt-skuv2"),
	// 	},
	// 	SKU: &armapimanagement.ServiceSKUProperties{
	// 		Name: to.Ptr(armapimanagement.SKUTypeStandardV2),
	// 		Capacity: to.Ptr[int32](1),
	// 	},
	// 	SystemData: &armapimanagement.SystemData{
	// 		CreatedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2023-08-10T18:50:51.539Z"); return t}()),
	// 		CreatedBy: to.Ptr("contoso@microsoft.com"),
	// 		CreatedByType: to.Ptr(armapimanagement.CreatedByTypeUser),
	// 		LastModifiedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2023-08-10T18:50:51.539Z"); return t}()),
	// 		LastModifiedBy: to.Ptr("contoso@microsoft.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");
require("dotenv/config");
/**
 * 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/2024-05-01/examples/ApiManagementCreateServiceSkuv2Service.json
 */
async function apiManagementCreateServiceSkuv2Service() {
  const subscriptionId =
    process.env["APIMANAGEMENT_SUBSCRIPTION_ID"] || "00000000-0000-0000-0000-000000000000";
  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: "StandardV2", 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
using Azure;
using Azure.ResourceManager;
using System;
using System.Threading.Tasks;
using Azure.Core;
using Azure.Identity;
using Azure.ResourceManager.ApiManagement.Models;
using Azure.ResourceManager.Models;
using Azure.ResourceManager.Resources;
using Azure.ResourceManager.ApiManagement;
// Generated from example definition: specification/apimanagement/resource-manager/Microsoft.ApiManagement/stable/2024-05-01/examples/ApiManagementCreateServiceSkuv2Service.json
// this example is just showing the usage of "ApiManagementService_CreateOrUpdate" operation, for the dependent resources, they will have to be created separately.
// get your azure access token, for more details of how Azure SDK get your access token, please refer to https://free.blessedness.top/en-us/dotnet/azure/sdk/authentication?tabs=command-line
TokenCredential cred = new DefaultAzureCredential();
// authenticate your client
ArmClient client = new ArmClient(cred);
// this example assumes you already have this ResourceGroupResource created on azure
// for more information of creating ResourceGroupResource, please refer to the document of ResourceGroupResource
string subscriptionId = "00000000-0000-0000-0000-000000000000";
string resourceGroupName = "rg1";
ResourceIdentifier resourceGroupResourceId = ResourceGroupResource.CreateResourceIdentifier(subscriptionId, resourceGroupName);
ResourceGroupResource resourceGroupResource = client.GetResourceGroupResource(resourceGroupResourceId);
// get the collection of this ApiManagementServiceResource
ApiManagementServiceCollection collection = resourceGroupResource.GetApiManagementServices();
// invoke the operation
string serviceName = "apimService1";
ApiManagementServiceData data = new ApiManagementServiceData(new AzureLocation("West US"), new ApiManagementServiceSkuProperties(ApiManagementServiceSkuType.StandardV2, 1), "apim@autorestsdk.com", "autorestsdk")
{
    Identity = new ManagedServiceIdentity("SystemAssigned"),
    Tags =
    {
    ["tag1"] = "value1",
    ["tag2"] = "value2",
    ["tag3"] = "value3"
    },
};
ArmOperation<ApiManagementServiceResource> lro = await collection.CreateOrUpdateAsync(WaitUntil.Completed, serviceName, data);
ApiManagementServiceResource result = lro.Value;
// the variable result is a resource, you could call other operations on this instance as well
// but just for demo, we get its data from this resource instance
ApiManagementServiceData resourceData = result.Data;
// for demo we just print out the id
Console.WriteLine($"Succeeded on id: {resourceData.Id}");
To use the Azure SDK library in your project, see this documentation. To provide feedback on this code sample, open a GitHub issue
 
			 
				
					Exempelsvar
						
							Location: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rg1/providers/Microsoft.ApiManagement/service/apimService1/operationresults/ZWFzdHVzOmFuZHktdGVzdGluZy0yMDIyLTA0LTAxLXByZXZpZXctNF9BY3RfODQ2ZWE4Ng==?api-version=2024-05-01&asyncResponse
Azure-AsyncOperation: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rg1/providers/Microsoft.ApiManagement/service/apimService1/operationresults/ZWFzdHVzOmFuZHktdGVzdGluZy0yMDIyLTA0LTAxLXByZXZpZXctNF9BY3RfODQ2ZWE4Ng==?api-version=2024-05-01&asyncResponse
								
							{
  "id": "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rg1/providers/Microsoft.ApiManagement/service/apimService1",
  "name": "apimService1",
  "type": "Microsoft.ApiManagement/service",
  "tags": {},
  "location": "East US",
  "etag": "AAAAAAA3h2Q=",
  "properties": {
    "publisherEmail": "apim@contoso.com",
    "publisherName": "apimgmt-skuv2",
    "notificationSenderEmail": "apimgmt-noreply@mail.windowsazure.com",
    "provisioningState": "Activating",
    "targetProvisioningState": "Activating",
    "createdAtUtc": "2023-08-11T18:24:14.7662749Z",
    "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,
    "natGatewayState": "Unsupported",
    "publicNetworkAccess": "Enabled",
    "platformVersion": "undetermined",
    "legacyPortalStatus": "Disabled",
    "developerPortalStatus": "Disabled"
  },
  "sku": {
    "name": "StandardV2",
    "capacity": 1
  },
  "identity": {
    "type": "SystemAssigned",
    "principalId": "de161222-0000-0000-0000-1caa5d9f0b0e",
    "tenantId": "72f988bf-0000-0000-0000-2d7cd011db47"
  },
  "zones": null,
  "systemData": {
    "createdBy": "contoso@microsoft.com",
    "createdByType": "User",
    "createdAt": "2023-08-11T18:24:13.7820033Z",
    "lastModifiedBy": "contoso@microsoft.com",
    "lastModifiedByType": "User",
    "lastModifiedAt": "2023-08-11T18:24:13.7820033Z"
  }
}
						
							{
  "id": "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rg1/providers/Microsoft.ApiManagement/service/apimService1",
  "name": "apimService1",
  "type": "Microsoft.ApiManagement/service",
  "tags": {},
  "location": "East US",
  "etag": "AAAAAAA3fHM=",
  "properties": {
    "publisherEmail": "apim@contoso.com",
    "publisherName": "apimgmt-skuv2",
    "notificationSenderEmail": "apimgmt-noreply@mail.windowsazure.com",
    "provisioningState": "Succeeded",
    "targetProvisioningState": "",
    "createdAtUtc": "2023-08-10T18:50:52.5509471Z",
    "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,
    "natGatewayState": "Unsupported",
    "publicNetworkAccess": "Enabled",
    "platformVersion": "undetermined"
  },
  "sku": {
    "name": "StandardV2",
    "capacity": 1
  },
  "identity": {
    "type": "SystemAssigned",
    "principalId": "de161222-0000-0000-0000-1caa5d9f0b0e",
    "tenantId": "72f988bf-0000-0000-0000-2d7cd011db47"
  },
  "zones": null,
  "systemData": {
    "createdBy": "contoso@microsoft.com",
    "createdByType": "User",
    "createdAt": "2023-08-10T18:50:51.539583Z",
    "lastModifiedBy": "contoso@microsoft.com",
    "lastModifiedByType": "User",
    "lastModifiedAt": "2023-08-10T18:50:51.539583Z"
  }
}
				 
				ApiManagementCreateServiceWithCustomHostnameKeyVault
			
				Exempelbegäran
						
PUT https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rg1/providers/Microsoft.ApiManagement/service/apimService1?api-version=2024-05-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"
      },
      {
        "type": "ConfigurationApi",
        "hostName": "configuration-api.msitesting.net",
        "encodedCertificate": "****** Base 64 Encoded Certificate ************",
        "certificatePassword": "Password"
      }
    ],
    "publisherEmail": "apim@autorestsdk.com",
    "publisherName": "autorestsdk",
    "virtualNetworkType": "None",
    "apiVersionConstraint": {
      "minApiVersion": "2019-01-01"
    }
  },
  "sku": {
    "name": "Premium",
    "capacity": 1
  },
  "identity": {
    "type": "UserAssigned",
    "userAssignedIdentities": {
      "/subscriptions/00000000-0000-0000-0000-000000000000/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/2024-05-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/00000000-0000-0000-0000-000000000000/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"),
                new HostnameConfiguration().withType(HostnameType.CONFIGURATION_API)
                    .withHostname("configuration-api.msitesting.net").withEncodedCertificate("fakeTokenPlaceholder")
                    .withCertificatePassword("fakeTokenPlaceholder")))
            .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="00000000-0000-0000-0000-000000000000",
    )
    response = client.api_management_service.begin_create_or_update(
        resource_group_name="rg1",
        service_name="apimService1",
        parameters={
            "identity": {
                "type": "UserAssigned",
                "userAssignedIdentities": {
                    "/subscriptions/00000000-0000-0000-0000-000000000000/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",
                    },
                    {
                        "certificatePassword": "Password",
                        "encodedCertificate": "****** Base 64 Encoded Certificate ************",
                        "hostName": "configuration-api.msitesting.net",
                        "type": "ConfigurationApi",
                    },
                ],
                "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/2024-05-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/v3"
)
// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/e436160e64c0f8d7fb20d662be2712f71f0a7ef5/specification/apimanagement/resource-manager/Microsoft.ApiManagement/stable/2024-05-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/00000000-0000-0000-0000-000000000000/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"),
				},
				{
					Type:                to.Ptr(armapimanagement.HostnameTypeConfigurationAPI),
					CertificatePassword: to.Ptr("Password"),
					EncodedCertificate:  to.Ptr("****** Base 64 Encoded Certificate ************"),
					HostName:            to.Ptr("configuration-api.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/00000000-0000-0000-0000-000000000000/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/00000000-0000-0000-0000-000000000000/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),
	// 			},
	// 			{
	// 				Type: to.Ptr(armapimanagement.HostnameTypeConfigurationAPI),
	// 				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("8E989XXXXXXXXXXXXXXXXB9C2C91F1D174FDB3A2"),
	// 				},
	// 				DefaultSSLBinding: to.Ptr(false),
	// 				HostName: to.Ptr("configuration-api.msitesting.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.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");
require("dotenv/config");
/**
 * 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/2024-05-01/examples/ApiManagementCreateServiceWithCustomHostnameKeyVault.json
 */
async function apiManagementCreateServiceWithCustomHostnameKeyVault() {
  const subscriptionId =
    process.env["APIMANAGEMENT_SUBSCRIPTION_ID"] || "00000000-0000-0000-0000-000000000000";
  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",
      },
      {
        type: "ConfigurationApi",
        certificatePassword: "Password",
        encodedCertificate: "****** Base 64 Encoded Certificate ************",
        hostName: "configuration-api.msitesting.net",
      },
    ],
    identity: {
      type: "UserAssigned",
      userAssignedIdentities: {
        "/subscriptions/00000000000000000000000000000000/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
using Azure;
using Azure.ResourceManager;
using System;
using System.Threading.Tasks;
using Azure.Core;
using Azure.Identity;
using Azure.ResourceManager.ApiManagement.Models;
using Azure.ResourceManager.Models;
using Azure.ResourceManager.Resources;
using Azure.ResourceManager.ApiManagement;
// Generated from example definition: specification/apimanagement/resource-manager/Microsoft.ApiManagement/stable/2024-05-01/examples/ApiManagementCreateServiceWithCustomHostnameKeyVault.json
// this example is just showing the usage of "ApiManagementService_CreateOrUpdate" operation, for the dependent resources, they will have to be created separately.
// get your azure access token, for more details of how Azure SDK get your access token, please refer to https://free.blessedness.top/en-us/dotnet/azure/sdk/authentication?tabs=command-line
TokenCredential cred = new DefaultAzureCredential();
// authenticate your client
ArmClient client = new ArmClient(cred);
// this example assumes you already have this ResourceGroupResource created on azure
// for more information of creating ResourceGroupResource, please refer to the document of ResourceGroupResource
string subscriptionId = "00000000-0000-0000-0000-000000000000";
string resourceGroupName = "rg1";
ResourceIdentifier resourceGroupResourceId = ResourceGroupResource.CreateResourceIdentifier(subscriptionId, resourceGroupName);
ResourceGroupResource resourceGroupResource = client.GetResourceGroupResource(resourceGroupResourceId);
// get the collection of this ApiManagementServiceResource
ApiManagementServiceCollection collection = resourceGroupResource.GetApiManagementServices();
// invoke the operation
string serviceName = "apimService1";
ApiManagementServiceData data = new ApiManagementServiceData(new AzureLocation("North Europe"), new ApiManagementServiceSkuProperties(ApiManagementServiceSkuType.Premium, 1), "apim@autorestsdk.com", "autorestsdk")
{
    Identity = new ManagedServiceIdentity("UserAssigned")
    {
        UserAssignedIdentities =
        {
        [new ResourceIdentifier("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rg1/providers/Microsoft.ManagedIdentity/userAssignedIdentities/id1")] = new UserAssignedIdentity()
        },
    },
    HostnameConfigurations = {new HostnameConfiguration(HostnameType.Proxy, "gateway1.msitesting.net")
    {
    KeyVaultSecretUri = new Uri("https://rpbvtkeyvaultintegration.vault.azure.net/secrets/msitestingCert"),
    IdentityClientId = "329419bc-adec-4dce-9568-25a6d486e468",
    IsDefaultSslBindingEnabled = true,
    }, new HostnameConfiguration(HostnameType.Management, "mgmt.msitesting.net")
    {
    KeyVaultSecretUri = new Uri("https://rpbvtkeyvaultintegration.vault.azure.net/secrets/msitestingCert"),
    IdentityClientId = "329419bc-adec-4dce-9568-25a6d486e468",
    }, new HostnameConfiguration(HostnameType.Portal, "portal1.msitesting.net")
    {
    KeyVaultSecretUri = new Uri("https://rpbvtkeyvaultintegration.vault.azure.net/secrets/msitestingCert"),
    IdentityClientId = "329419bc-adec-4dce-9568-25a6d486e468",
    }, new HostnameConfiguration(HostnameType.ConfigurationApi, "configuration-api.msitesting.net")
    {
    EncodedCertificate = "****** Base 64 Encoded Certificate ************",
    CertificatePassword = "Password",
    }},
    VirtualNetworkType = VirtualNetworkType.None,
    MinApiVersion = "2019-01-01",
    Tags =
    {
    ["tag1"] = "value1",
    ["tag2"] = "value2",
    ["tag3"] = "value3"
    },
};
ArmOperation<ApiManagementServiceResource> lro = await collection.CreateOrUpdateAsync(WaitUntil.Completed, serviceName, data);
ApiManagementServiceResource result = lro.Value;
// the variable result is a resource, you could call other operations on this instance as well
// but just for demo, we get its data from this resource instance
ApiManagementServiceData resourceData = result.Data;
// for demo we just print out the id
Console.WriteLine($"Succeeded on id: {resourceData.Id}");
To use the Azure SDK library in your project, see this documentation. To provide feedback on this code sample, open a GitHub issue
 
			 
				
					Exempelsvar
						
							Location: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rg1/providers/Microsoft.ApiManagement/service/apimService1/operationresults/ZWFzdHVzOmFuZHktdGVzdGluZy0yMDIyLTA0LTAxLXByZXZpZXctNF9BY3RfODQ2ZWE4Ng==?api-version=2024-05-01&asyncResponse
Azure-AsyncOperation: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rg1/providers/Microsoft.ApiManagement/service/apimService1/operationresults/ZWFzdHVzOmFuZHktdGVzdGluZy0yMDIyLTA0LTAxLXByZXZpZXctNF9BY3RfODQ2ZWE4Ng==?api-version=2024-05-01&asyncResponse
								
							{
  "id": "/subscriptions/00000000-0000-0000-0000-000000000000/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"
      },
      {
        "type": "ConfigurationApi",
        "hostName": "configuration-api.msitesting.net",
        "negotiateClientCertificate": false,
        "certificate": {
          "expiry": "2036-01-01T07:00:00+00:00",
          "thumbprint": "8E989XXXXXXXXXXXXXXXXB9C2C91F1D174FDB3A2",
          "subject": "CN=*.msitesting.net"
        },
        "defaultSslBinding": false
      }
    ],
    "virtualNetworkType": "None",
    "disableGateway": false,
    "platformVersion": "stv2",
    "apiVersionConstraint": {
      "minApiVersion": "2019-01-01"
    }
  },
  "sku": {
    "name": "Premium",
    "capacity": 1
  },
  "identity": {
    "type": "UserAssigned",
    "userAssignedIdentities": {
      "/subscriptions/00000000-0000-0000-0000-000000000000/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/00000000-0000-0000-0000-000000000000/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"
      },
      {
        "type": "ConfigurationApi",
        "hostName": "configuration-api.msitesting.net",
        "negotiateClientCertificate": false,
        "certificate": {
          "expiry": "2036-01-01T07:00:00+00:00",
          "thumbprint": "8E989XXXXXXXXXXXXXXXXB9C2C91F1D174FDB3A2",
          "subject": "CN=*.msitesting.net"
        },
        "defaultSslBinding": false
      }
    ],
    "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/00000000-0000-0000-0000-000000000000/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"
  }
}
				 
				ApiManagementCreateServiceWithDeveloperPortal
			
				Exempelbegäran
						
PUT https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rg1/providers/Microsoft.ApiManagement/service/apimService1?api-version=2024-05-01
{
  "properties": {
    "publisherEmail": "foo@contoso.com",
    "publisherName": "foo",
    "developerPortalStatus": "Enabled"
  },
  "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.DeveloperPortalStatus;
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/2024-05-01/examples/
     * ApiManagementCreateServiceWithDeveloperPortal.json
     */
    /**
     * Sample code: ApiManagementCreateServiceWithDeveloperPortal.
     * 
     * @param manager Entry point to ApiManagementManager.
     */
    public static void apiManagementCreateServiceWithDeveloperPortal(
        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")).withDeveloperPortalStatus(DeveloperPortalStatus.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_developer_portal.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="00000000-0000-0000-0000-000000000000",
    )
    response = client.api_management_service.begin_create_or_update(
        resource_group_name="rg1",
        service_name="apimService1",
        parameters={
            "location": "South Central US",
            "properties": {
                "developerPortalStatus": "Enabled",
                "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/2024-05-01/examples/ApiManagementCreateServiceWithDeveloperPortal.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/v3"
)
// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/e436160e64c0f8d7fb20d662be2712f71f0a7ef5/specification/apimanagement/resource-manager/Microsoft.ApiManagement/stable/2024-05-01/examples/ApiManagementCreateServiceWithDeveloperPortal.json
func ExampleServiceClient_BeginCreateOrUpdate_apiManagementCreateServiceWithDeveloperPortal() {
	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{
			DeveloperPortalStatus: to.Ptr(armapimanagement.DeveloperPortalStatusEnabled),
			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/00000000-0000-0000-0000-000000000000/resourceGroups/rg1/providers/Microsoft.ApiManagement/service/apimService1"),
	// 	Tags: map[string]*string{
	// 		"api-version": to.Ptr("2024-05-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");
require("dotenv/config");
/**
 * 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/2024-05-01/examples/ApiManagementCreateServiceWithDeveloperPortal.json
 */
async function apiManagementCreateServiceWithDeveloperPortal() {
  const subscriptionId =
    process.env["APIMANAGEMENT_SUBSCRIPTION_ID"] || "00000000-0000-0000-0000-000000000000";
  const resourceGroupName = process.env["APIMANAGEMENT_RESOURCE_GROUP"] || "rg1";
  const serviceName = "apimService1";
  const parameters = {
    developerPortalStatus: "Enabled",
    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
using Azure;
using Azure.ResourceManager;
using System;
using System.Threading.Tasks;
using Azure.Core;
using Azure.Identity;
using Azure.ResourceManager.ApiManagement.Models;
using Azure.ResourceManager.Models;
using Azure.ResourceManager.Resources;
using Azure.ResourceManager.ApiManagement;
// Generated from example definition: specification/apimanagement/resource-manager/Microsoft.ApiManagement/stable/2024-05-01/examples/ApiManagementCreateServiceWithDeveloperPortal.json
// this example is just showing the usage of "ApiManagementService_CreateOrUpdate" operation, for the dependent resources, they will have to be created separately.
// get your azure access token, for more details of how Azure SDK get your access token, please refer to https://free.blessedness.top/en-us/dotnet/azure/sdk/authentication?tabs=command-line
TokenCredential cred = new DefaultAzureCredential();
// authenticate your client
ArmClient client = new ArmClient(cred);
// this example assumes you already have this ResourceGroupResource created on azure
// for more information of creating ResourceGroupResource, please refer to the document of ResourceGroupResource
string subscriptionId = "00000000-0000-0000-0000-000000000000";
string resourceGroupName = "rg1";
ResourceIdentifier resourceGroupResourceId = ResourceGroupResource.CreateResourceIdentifier(subscriptionId, resourceGroupName);
ResourceGroupResource resourceGroupResource = client.GetResourceGroupResource(resourceGroupResourceId);
// get the collection of this ApiManagementServiceResource
ApiManagementServiceCollection collection = resourceGroupResource.GetApiManagementServices();
// invoke the operation
string serviceName = "apimService1";
ApiManagementServiceData data = new ApiManagementServiceData(new AzureLocation("South Central US"), new ApiManagementServiceSkuProperties(ApiManagementServiceSkuType.Developer, 1), "foo@contoso.com", "foo")
{
    DeveloperPortalStatus = DeveloperPortalStatus.Enabled,
    Tags =
    {
    ["Name"] = "Contoso",
    ["Test"] = "User"
    },
};
ArmOperation<ApiManagementServiceResource> lro = await collection.CreateOrUpdateAsync(WaitUntil.Completed, serviceName, data);
ApiManagementServiceResource result = lro.Value;
// the variable result is a resource, you could call other operations on this instance as well
// but just for demo, we get its data from this resource instance
ApiManagementServiceData resourceData = result.Data;
// for demo we just print out the id
Console.WriteLine($"Succeeded on id: {resourceData.Id}");
To use the Azure SDK library in your project, see this documentation. To provide feedback on this code sample, open a GitHub issue
 
			 
				
					Exempelsvar
						
							Location: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rg1/providers/Microsoft.ApiManagement/service/apimService1/operationresults/ZWFzdHVzOmFuZHktdGVzdGluZy0yMDIyLTA0LTAxLXByZXZpZXctNF9BY3RfODQ2ZWE4Ng==?api-version=2024-05-01&asyncResponse
Azure-AsyncOperation: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rg1/providers/Microsoft.ApiManagement/service/apimService1/operationresults/ZWFzdHVzOmFuZHktdGVzdGluZy0yMDIyLTA0LTAxLXByZXZpZXctNF9BY3RfODQ2ZWE4Ng==?api-version=2024-05-01&asyncResponse
								
							{
  "id": "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rg1/providers/Microsoft.ApiManagement/service/apimService1",
  "name": "apimService1",
  "type": "Microsoft.ApiManagement/service",
  "tags": {
    "api-version": "2024-05-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",
    "legacyPortalStatus": "Disabled",
    "developerPortalStatus": "Enabled"
  },
  "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/00000000-0000-0000-0000-000000000000/resourceGroups/rg1/providers/Microsoft.ApiManagement/service/apimService1",
  "name": "apimService1",
  "type": "Microsoft.ApiManagement/service",
  "tags": {
    "api-version": "2024-05-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"
  }
}
				 
				ApiManagementCreateServiceWithNatGatewayEnabled
			
				Exempelbegäran
						
PUT https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rg1/providers/Microsoft.ApiManagement/service/apimService1?api-version=2024-05-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/2024-05-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="00000000-0000-0000-0000-000000000000",
    )
    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/2024-05-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/v3"
)
// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/e436160e64c0f8d7fb20d662be2712f71f0a7ef5/specification/apimanagement/resource-manager/Microsoft.ApiManagement/stable/2024-05-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/00000000-0000-0000-0000-000000000000/resourceGroups/rg1/providers/Microsoft.ApiManagement/service/apimService1"),
	// 	Tags: map[string]*string{
	// 		"api-version": to.Ptr("2024-05-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");
require("dotenv/config");
/**
 * 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/2024-05-01/examples/ApiManagementCreateServiceWithNatGatewayEnabled.json
 */
async function apiManagementCreateServiceWithNatGatewayEnabled() {
  const subscriptionId =
    process.env["APIMANAGEMENT_SUBSCRIPTION_ID"] || "00000000-0000-0000-0000-000000000000";
  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
using Azure;
using Azure.ResourceManager;
using System;
using System.Threading.Tasks;
using Azure.Core;
using Azure.Identity;
using Azure.ResourceManager.ApiManagement.Models;
using Azure.ResourceManager.Models;
using Azure.ResourceManager.Resources;
using Azure.ResourceManager.ApiManagement;
// Generated from example definition: specification/apimanagement/resource-manager/Microsoft.ApiManagement/stable/2024-05-01/examples/ApiManagementCreateServiceWithNatGatewayEnabled.json
// this example is just showing the usage of "ApiManagementService_CreateOrUpdate" operation, for the dependent resources, they will have to be created separately.
// get your azure access token, for more details of how Azure SDK get your access token, please refer to https://free.blessedness.top/en-us/dotnet/azure/sdk/authentication?tabs=command-line
TokenCredential cred = new DefaultAzureCredential();
// authenticate your client
ArmClient client = new ArmClient(cred);
// this example assumes you already have this ResourceGroupResource created on azure
// for more information of creating ResourceGroupResource, please refer to the document of ResourceGroupResource
string subscriptionId = "00000000-0000-0000-0000-000000000000";
string resourceGroupName = "rg1";
ResourceIdentifier resourceGroupResourceId = ResourceGroupResource.CreateResourceIdentifier(subscriptionId, resourceGroupName);
ResourceGroupResource resourceGroupResource = client.GetResourceGroupResource(resourceGroupResourceId);
// get the collection of this ApiManagementServiceResource
ApiManagementServiceCollection collection = resourceGroupResource.GetApiManagementServices();
// invoke the operation
string serviceName = "apimService1";
ApiManagementServiceData data = new ApiManagementServiceData(new AzureLocation("East US"), new ApiManagementServiceSkuProperties(ApiManagementServiceSkuType.Premium, 1), "apim@autorestsdk.com", "autorestsdk")
{
    NatGatewayState = ApiManagementNatGatewayState.Enabled,
    Tags =
    {
    ["tag1"] = "value1",
    ["tag2"] = "value2",
    ["tag3"] = "value3"
    },
};
ArmOperation<ApiManagementServiceResource> lro = await collection.CreateOrUpdateAsync(WaitUntil.Completed, serviceName, data);
ApiManagementServiceResource result = lro.Value;
// the variable result is a resource, you could call other operations on this instance as well
// but just for demo, we get its data from this resource instance
ApiManagementServiceData resourceData = result.Data;
// for demo we just print out the id
Console.WriteLine($"Succeeded on id: {resourceData.Id}");
To use the Azure SDK library in your project, see this documentation. To provide feedback on this code sample, open a GitHub issue
 
			 
				
					Exempelsvar
						
							Location: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rg1/providers/Microsoft.ApiManagement/service/apimService1/operationresults/ZWFzdHVzOmFuZHktdGVzdGluZy0yMDIyLTA0LTAxLXByZXZpZXctNF9BY3RfODQ2ZWE4Ng==?api-version=2024-05-01&asyncResponse
Azure-AsyncOperation: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rg1/providers/Microsoft.ApiManagement/service/apimService1/operationresults/ZWFzdHVzOmFuZHktdGVzdGluZy0yMDIyLTA0LTAxLXByZXZpZXctNF9BY3RfODQ2ZWE4Ng==?api-version=2024-05-01&asyncResponse
								
							{
  "id": "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rg1/providers/Microsoft.ApiManagement/service/apimService1",
  "name": "apimService1",
  "type": "Microsoft.ApiManagement/service",
  "tags": {
    "api-version": "2024-05-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/00000000-0000-0000-0000-000000000000/resourceGroups/rg1/providers/Microsoft.ApiManagement/service/apimService1",
  "name": "apimService1",
  "type": "Microsoft.ApiManagement/service",
  "tags": {
    "api-version": "2024-05-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"
  }
}
				 
				ApiManagementCreateServiceWithoutLegacyConfigurationApi
			
				Exempelbegäran
						
PUT https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rg1/providers/Microsoft.ApiManagement/service/apimService1?api-version=2024-05-01
{
  "properties": {
    "publisherEmail": "apim@autorestsdk.com",
    "publisherName": "autorestsdk",
    "configurationApi": {
      "legacyApi": "Disabled"
    }
  },
  "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.ConfigurationApi;
import com.azure.resourcemanager.apimanagement.models.LegacyApiState;
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/2024-05-01/examples/
     * ApiManagementCreateServiceWithoutLegacyConfigurationApi.json
     */
    /**
     * Sample code: ApiManagementCreateServiceWithoutLegacyConfigurationApi.
     * 
     * @param manager Entry point to ApiManagementManager.
     */
    public static void apiManagementCreateServiceWithoutLegacyConfigurationApi(
        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"))
            .withConfigurationApi(new ConfigurationApi().withLegacyApi(LegacyApiState.DISABLED)).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_without_legacy_configuration_api.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="00000000-0000-0000-0000-000000000000",
    )
    response = client.api_management_service.begin_create_or_update(
        resource_group_name="rg1",
        service_name="apimService1",
        parameters={
            "location": "Central US",
            "properties": {
                "configurationApi": {"legacyApi": "Disabled"},
                "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/2024-05-01/examples/ApiManagementCreateServiceWithoutLegacyConfigurationApi.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/v3"
)
// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/e436160e64c0f8d7fb20d662be2712f71f0a7ef5/specification/apimanagement/resource-manager/Microsoft.ApiManagement/stable/2024-05-01/examples/ApiManagementCreateServiceWithoutLegacyConfigurationApi.json
func ExampleServiceClient_BeginCreateOrUpdate_apiManagementCreateServiceWithoutLegacyConfigurationApi() {
	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{
			ConfigurationAPI: &armapimanagement.ConfigurationAPI{
				LegacyAPI: to.Ptr(armapimanagement.LegacyAPIStateDisabled),
			},
			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/00000000-0000-0000-0000-000000000000/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{
	// 		},
	// 		ConfigurationAPI: &armapimanagement.ConfigurationAPI{
	// 			LegacyAPI: to.Ptr(armapimanagement.LegacyAPIStateDisabled),
	// 		},
	// 		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");
require("dotenv/config");
/**
 * 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/2024-05-01/examples/ApiManagementCreateServiceWithoutLegacyConfigurationApi.json
 */
async function apiManagementCreateServiceWithoutLegacyConfigurationApi() {
  const subscriptionId =
    process.env["APIMANAGEMENT_SUBSCRIPTION_ID"] || "00000000-0000-0000-0000-000000000000";
  const resourceGroupName = process.env["APIMANAGEMENT_RESOURCE_GROUP"] || "rg1";
  const serviceName = "apimService1";
  const parameters = {
    configurationApi: { legacyApi: "Disabled" },
    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
using Azure;
using Azure.ResourceManager;
using System;
using System.Threading.Tasks;
using Azure.Core;
using Azure.Identity;
using Azure.ResourceManager.ApiManagement.Models;
using Azure.ResourceManager.Models;
using Azure.ResourceManager.Resources;
using Azure.ResourceManager.ApiManagement;
// Generated from example definition: specification/apimanagement/resource-manager/Microsoft.ApiManagement/stable/2024-05-01/examples/ApiManagementCreateServiceWithoutLegacyConfigurationApi.json
// this example is just showing the usage of "ApiManagementService_CreateOrUpdate" operation, for the dependent resources, they will have to be created separately.
// get your azure access token, for more details of how Azure SDK get your access token, please refer to https://free.blessedness.top/en-us/dotnet/azure/sdk/authentication?tabs=command-line
TokenCredential cred = new DefaultAzureCredential();
// authenticate your client
ArmClient client = new ArmClient(cred);
// this example assumes you already have this ResourceGroupResource created on azure
// for more information of creating ResourceGroupResource, please refer to the document of ResourceGroupResource
string subscriptionId = "00000000-0000-0000-0000-000000000000";
string resourceGroupName = "rg1";
ResourceIdentifier resourceGroupResourceId = ResourceGroupResource.CreateResourceIdentifier(subscriptionId, resourceGroupName);
ResourceGroupResource resourceGroupResource = client.GetResourceGroupResource(resourceGroupResourceId);
// get the collection of this ApiManagementServiceResource
ApiManagementServiceCollection collection = resourceGroupResource.GetApiManagementServices();
// invoke the operation
string serviceName = "apimService1";
ApiManagementServiceData data = new ApiManagementServiceData(new AzureLocation("Central US"), new ApiManagementServiceSkuProperties(ApiManagementServiceSkuType.Basic, 1), "apim@autorestsdk.com", "autorestsdk")
{
    LegacyApi = LegacyApiState.Disabled,
    Tags =
    {
    ["tag1"] = "value1",
    ["tag2"] = "value2",
    ["tag3"] = "value3"
    },
};
ArmOperation<ApiManagementServiceResource> lro = await collection.CreateOrUpdateAsync(WaitUntil.Completed, serviceName, data);
ApiManagementServiceResource result = lro.Value;
// the variable result is a resource, you could call other operations on this instance as well
// but just for demo, we get its data from this resource instance
ApiManagementServiceData resourceData = result.Data;
// for demo we just print out the id
Console.WriteLine($"Succeeded on id: {resourceData.Id}");
To use the Azure SDK library in your project, see this documentation. To provide feedback on this code sample, open a GitHub issue
 
			 
				
					Exempelsvar
						
							Location: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rg1/providers/Microsoft.ApiManagement/service/apimService1/operationresults/ZWFzdHVzOmFuZHktdGVzdGluZy0yMDIyLTA0LTAxLXByZXZpZXctNF9BY3RfODQ2ZWE4Ng==?api-version=2024-05-01&asyncResponse
Azure-AsyncOperation: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rg1/providers/Microsoft.ApiManagement/service/apimService1/operationresults/ZWFzdHVzOmFuZHktdGVzdGluZy0yMDIyLTA0LTAxLXByZXZpZXctNF9BY3RfODQ2ZWE4Ng==?api-version=2024-05-01&asyncResponse
								
							{
  "id": "/subscriptions/00000000-0000-0000-0000-000000000000/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": [],
    "disableGateway": false,
    "configurationApi": {
      "legacyApi": "Disabled"
    },
    "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/00000000-0000-0000-0000-000000000000/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": [],
    "disableGateway": false,
    "configurationApi": {
      "legacyApi": "Disabled"
    },
    "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"
  }
}
				 
				ApiManagementCreateServiceWithSystemCertificates
			
				Exempelbegäran
						
PUT https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rg1/providers/Microsoft.ApiManagement/service/apimService1?api-version=2024-05-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/2024-05-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="00000000-0000-0000-0000-000000000000",
    )
    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/2024-05-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/v3"
)
// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/e436160e64c0f8d7fb20d662be2712f71f0a7ef5/specification/apimanagement/resource-manager/Microsoft.ApiManagement/stable/2024-05-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/00000000-0000-0000-0000-000000000000/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");
require("dotenv/config");
/**
 * 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/2024-05-01/examples/ApiManagementCreateServiceWithSystemCertificates.json
 */
async function apiManagementCreateServiceWithSystemCertificates() {
  const subscriptionId =
    process.env["APIMANAGEMENT_SUBSCRIPTION_ID"] || "00000000-0000-0000-0000-000000000000";
  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
using Azure;
using Azure.ResourceManager;
using System;
using System.Threading.Tasks;
using Azure.Core;
using Azure.Identity;
using Azure.ResourceManager.ApiManagement.Models;
using Azure.ResourceManager.Models;
using Azure.ResourceManager.Resources;
using Azure.ResourceManager.ApiManagement;
// Generated from example definition: specification/apimanagement/resource-manager/Microsoft.ApiManagement/stable/2024-05-01/examples/ApiManagementCreateServiceWithSystemCertificates.json
// this example is just showing the usage of "ApiManagementService_CreateOrUpdate" operation, for the dependent resources, they will have to be created separately.
// get your azure access token, for more details of how Azure SDK get your access token, please refer to https://free.blessedness.top/en-us/dotnet/azure/sdk/authentication?tabs=command-line
TokenCredential cred = new DefaultAzureCredential();
// authenticate your client
ArmClient client = new ArmClient(cred);
// this example assumes you already have this ResourceGroupResource created on azure
// for more information of creating ResourceGroupResource, please refer to the document of ResourceGroupResource
string subscriptionId = "00000000-0000-0000-0000-000000000000";
string resourceGroupName = "rg1";
ResourceIdentifier resourceGroupResourceId = ResourceGroupResource.CreateResourceIdentifier(subscriptionId, resourceGroupName);
ResourceGroupResource resourceGroupResource = client.GetResourceGroupResource(resourceGroupResourceId);
// get the collection of this ApiManagementServiceResource
ApiManagementServiceCollection collection = resourceGroupResource.GetApiManagementServices();
// invoke the operation
string serviceName = "apimService1";
ApiManagementServiceData data = new ApiManagementServiceData(new AzureLocation("Central US"), new ApiManagementServiceSkuProperties(ApiManagementServiceSkuType.Basic, 1), "apim@autorestsdk.com", "autorestsdk")
{
    Certificates = {new CertificateConfiguration(CertificateConfigurationStoreName.CertificateAuthority)
    {
    EncodedCertificate = "*******Base64 encoded Certificate******************",
    CertificatePassword = "Password",
    }},
    Tags =
    {
    ["tag1"] = "value1",
    ["tag2"] = "value2",
    ["tag3"] = "value3"
    },
};
ArmOperation<ApiManagementServiceResource> lro = await collection.CreateOrUpdateAsync(WaitUntil.Completed, serviceName, data);
ApiManagementServiceResource result = lro.Value;
// the variable result is a resource, you could call other operations on this instance as well
// but just for demo, we get its data from this resource instance
ApiManagementServiceData resourceData = result.Data;
// for demo we just print out the id
Console.WriteLine($"Succeeded on id: {resourceData.Id}");
To use the Azure SDK library in your project, see this documentation. To provide feedback on this code sample, open a GitHub issue
 
			 
				
					Exempelsvar
						
							Location: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rg1/providers/Microsoft.ApiManagement/service/apimService1/operationresults/ZWFzdHVzOmFuZHktdGVzdGluZy0yMDIyLTA0LTAxLXByZXZpZXctNF9BY3RfODQ2ZWE4Ng==?api-version=2024-05-01&asyncResponse
Azure-AsyncOperation: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rg1/providers/Microsoft.ApiManagement/service/apimService1/operationresults/ZWFzdHVzOmFuZHktdGVzdGluZy0yMDIyLTA0LTAxLXByZXZpZXctNF9BY3RfODQ2ZWE4Ng==?api-version=2024-05-01&asyncResponse
								
							{
  "id": "/subscriptions/00000000-0000-0000-0000-000000000000/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/00000000-0000-0000-0000-000000000000/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
			
				Exempelbegäran
						
PUT https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rg1/providers/Microsoft.ApiManagement/service/apimService1?api-version=2024-05-01
{
  "properties": {
    "publisherEmail": "apim@autorestsdk.com",
    "publisherName": "autorestsdk"
  },
  "sku": {
    "name": "Consumption",
    "capacity": 0
  },
  "identity": {
    "type": "UserAssigned",
    "userAssignedIdentities": {
      "/subscriptions/00000000-0000-0000-0000-000000000000/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/2024-05-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/00000000-0000-0000-0000-000000000000/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="00000000-0000-0000-0000-000000000000",
    )
    response = client.api_management_service.begin_create_or_update(
        resource_group_name="rg1",
        service_name="apimService1",
        parameters={
            "identity": {
                "type": "UserAssigned",
                "userAssignedIdentities": {
                    "/subscriptions/00000000-0000-0000-0000-000000000000/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/2024-05-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/v3"
)
// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/e436160e64c0f8d7fb20d662be2712f71f0a7ef5/specification/apimanagement/resource-manager/Microsoft.ApiManagement/stable/2024-05-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/00000000-0000-0000-0000-000000000000/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/00000000-0000-0000-0000-000000000000/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/00000000-0000-0000-0000-000000000000/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");
require("dotenv/config");
/**
 * 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/2024-05-01/examples/ApiManagementCreateServiceWithUserAssignedIdentity.json
 */
async function apiManagementCreateServiceWithUserAssignedIdentity() {
  const subscriptionId =
    process.env["APIMANAGEMENT_SUBSCRIPTION_ID"] || "00000000-0000-0000-0000-000000000000";
  const resourceGroupName = process.env["APIMANAGEMENT_RESOURCE_GROUP"] || "rg1";
  const serviceName = "apimService1";
  const parameters = {
    identity: {
      type: "UserAssigned",
      userAssignedIdentities: {
        "/subscriptions/00000000000000000000000000000000/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
using Azure;
using Azure.ResourceManager;
using System;
using System.Threading.Tasks;
using Azure.Core;
using Azure.Identity;
using Azure.ResourceManager.ApiManagement.Models;
using Azure.ResourceManager.Models;
using Azure.ResourceManager.Resources;
using Azure.ResourceManager.ApiManagement;
// Generated from example definition: specification/apimanagement/resource-manager/Microsoft.ApiManagement/stable/2024-05-01/examples/ApiManagementCreateServiceWithUserAssignedIdentity.json
// this example is just showing the usage of "ApiManagementService_CreateOrUpdate" operation, for the dependent resources, they will have to be created separately.
// get your azure access token, for more details of how Azure SDK get your access token, please refer to https://free.blessedness.top/en-us/dotnet/azure/sdk/authentication?tabs=command-line
TokenCredential cred = new DefaultAzureCredential();
// authenticate your client
ArmClient client = new ArmClient(cred);
// this example assumes you already have this ResourceGroupResource created on azure
// for more information of creating ResourceGroupResource, please refer to the document of ResourceGroupResource
string subscriptionId = "00000000-0000-0000-0000-000000000000";
string resourceGroupName = "rg1";
ResourceIdentifier resourceGroupResourceId = ResourceGroupResource.CreateResourceIdentifier(subscriptionId, resourceGroupName);
ResourceGroupResource resourceGroupResource = client.GetResourceGroupResource(resourceGroupResourceId);
// get the collection of this ApiManagementServiceResource
ApiManagementServiceCollection collection = resourceGroupResource.GetApiManagementServices();
// invoke the operation
string serviceName = "apimService1";
ApiManagementServiceData data = new ApiManagementServiceData(new AzureLocation("West US"), new ApiManagementServiceSkuProperties(ApiManagementServiceSkuType.Consumption, 0), "apim@autorestsdk.com", "autorestsdk")
{
    Identity = new ManagedServiceIdentity("UserAssigned")
    {
        UserAssignedIdentities =
        {
        [new ResourceIdentifier("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rg1/providers/Microsoft.ManagedIdentity/userAssignedIdentities/apimService1")] = new UserAssignedIdentity()
        },
    },
    Tags =
    {
    ["tag1"] = "value1",
    ["tag2"] = "value2",
    ["tag3"] = "value3"
    },
};
ArmOperation<ApiManagementServiceResource> lro = await collection.CreateOrUpdateAsync(WaitUntil.Completed, serviceName, data);
ApiManagementServiceResource result = lro.Value;
// the variable result is a resource, you could call other operations on this instance as well
// but just for demo, we get its data from this resource instance
ApiManagementServiceData resourceData = result.Data;
// for demo we just print out the id
Console.WriteLine($"Succeeded on id: {resourceData.Id}");
To use the Azure SDK library in your project, see this documentation. To provide feedback on this code sample, open a GitHub issue
 
			 
				
					Exempelsvar
						
							Location: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rg1/providers/Microsoft.ApiManagement/service/apimService1/operationresults/ZWFzdHVzOmFuZHktdGVzdGluZy0yMDIyLTA0LTAxLXByZXZpZXctNF9BY3RfODQ2ZWE4Ng==?api-version=2024-05-01&asyncResponse
Azure-AsyncOperation: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rg1/providers/Microsoft.ApiManagement/service/apimService1/operationresults/ZWFzdHVzOmFuZHktdGVzdGluZy0yMDIyLTA0LTAxLXByZXZpZXctNF9BY3RfODQ2ZWE4Ng==?api-version=2024-05-01&asyncResponse
								
							{
  "id": "/subscriptions/00000000-0000-0000-0000-000000000000/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/00000000-0000-0000-0000-000000000000/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/00000000-0000-0000-0000-000000000000/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/00000000-0000-0000-0000-000000000000/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
			
				Exempelbegäran
						
PUT https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rg1/providers/Microsoft.ApiManagement/service/apimService1?api-version=2024-05-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/2024-05-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="00000000-0000-0000-0000-000000000000",
    )
    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/2024-05-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/v3"
)
// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/e436160e64c0f8d7fb20d662be2712f71f0a7ef5/specification/apimanagement/resource-manager/Microsoft.ApiManagement/stable/2024-05-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/00000000-0000-0000-0000-000000000000/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");
require("dotenv/config");
/**
 * 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/2024-05-01/examples/ApiManagementUndelete.json
 */
async function apiManagementUndelete() {
  const subscriptionId =
    process.env["APIMANAGEMENT_SUBSCRIPTION_ID"] || "00000000-0000-0000-0000-000000000000";
  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
using Azure;
using Azure.ResourceManager;
using System;
using System.Threading.Tasks;
using Azure.Core;
using Azure.Identity;
using Azure.ResourceManager.ApiManagement.Models;
using Azure.ResourceManager.Models;
using Azure.ResourceManager.Resources;
using Azure.ResourceManager.ApiManagement;
// Generated from example definition: specification/apimanagement/resource-manager/Microsoft.ApiManagement/stable/2024-05-01/examples/ApiManagementUndelete.json
// this example is just showing the usage of "ApiManagementService_CreateOrUpdate" operation, for the dependent resources, they will have to be created separately.
// get your azure access token, for more details of how Azure SDK get your access token, please refer to https://free.blessedness.top/en-us/dotnet/azure/sdk/authentication?tabs=command-line
TokenCredential cred = new DefaultAzureCredential();
// authenticate your client
ArmClient client = new ArmClient(cred);
// this example assumes you already have this ResourceGroupResource created on azure
// for more information of creating ResourceGroupResource, please refer to the document of ResourceGroupResource
string subscriptionId = "00000000-0000-0000-0000-000000000000";
string resourceGroupName = "rg1";
ResourceIdentifier resourceGroupResourceId = ResourceGroupResource.CreateResourceIdentifier(subscriptionId, resourceGroupName);
ResourceGroupResource resourceGroupResource = client.GetResourceGroupResource(resourceGroupResourceId);
// get the collection of this ApiManagementServiceResource
ApiManagementServiceCollection collection = resourceGroupResource.GetApiManagementServices();
// invoke the operation
string serviceName = "apimService1";
ApiManagementServiceData data = new ApiManagementServiceData(new AzureLocation("South Central US"), new ApiManagementServiceSkuProperties(ApiManagementServiceSkuType.Developer, 1), "foo@contoso.com", "foo")
{
    Restore = true,
};
ArmOperation<ApiManagementServiceResource> lro = await collection.CreateOrUpdateAsync(WaitUntil.Completed, serviceName, data);
ApiManagementServiceResource result = lro.Value;
// the variable result is a resource, you could call other operations on this instance as well
// but just for demo, we get its data from this resource instance
ApiManagementServiceData resourceData = result.Data;
// for demo we just print out the id
Console.WriteLine($"Succeeded on id: {resourceData.Id}");
To use the Azure SDK library in your project, see this documentation. To provide feedback on this code sample, open a GitHub issue
 
			 
				
					Exempelsvar
						
							Location: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rg1/providers/Microsoft.ApiManagement/service/apimService1/operationresults/ZWFzdHVzOmFuZHktdGVzdGluZy0yMDIyLTA0LTAxLXByZXZpZXctNF9BY3RfODQ2ZWE4Ng==?api-version=2024-05-01&asyncResponse
Azure-AsyncOperation: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rg1/providers/Microsoft.ApiManagement/service/apimService1/operationresults/ZWFzdHVzOmFuZHktdGVzdGluZy0yMDIyLTA0LTAxLXByZXZpZXctNF9BY3RfODQ2ZWE4Ng==?api-version=2024-05-01&asyncResponse
								
							{
  "id": "/subscriptions/00000000-0000-0000-0000-000000000000/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/00000000-0000-0000-0000-000000000000/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
  }
}
				 
		Definitioner
			
				
					| Name | Description | 
					
						| AdditionalLocation | Beskrivning av ytterligare en API Management-resursplats. | 
					
						| ApiManagementServiceIdentity | Identitetsegenskaper för Api Management-tjänstresursen. | 
					
						| ApiManagementServiceResource | En enda API Management-tjänstresurs i Lista eller Hämta svar. | 
					
						| ApiManagementServiceSkuProperties | Egenskaper för API Management-tjänstens resurs-SKU. | 
					
						| ApimIdentityType | Den typ av identitet som används för resursen. Typen "SystemAssigned, UserAssigned" innehåller både en implicit skapad identitet och en uppsättning användartilldelade identiteter. Typen "Ingen" tar bort alla identiteter från tjänsten. | 
					
						| ApiVersionConstraint | Kontrollplans-API:ets versionsvillkor för API Management-tjänsten. | 
					
						| ArmIdWrapper | En omslutning för ett ARM-resurs-ID | 
					
						| CertificateConfiguration | Certifikatkonfiguration som består av icke-betrodda mellanliggande objekt och rotcertifikat. | 
					
						| CertificateInformation | SSL-certifikatinformation. | 
					
						| CertificateSource | Certifikatkälla. | 
					
						| CertificateStatus | Certifikatstatus. | 
					
						| ConfigurationApi | Information om API-konfigurations-API:et för API Management-tjänsten. | 
					
						| createdByType | Den typ av identitet som skapade resursen. | 
					
						| developerPortalStatus | Status för utvecklarportalen i den här API Management-tjänsten. | 
					
						| ErrorAdditionalInfo | Ytterligare information om resurshanteringsfelet. | 
					
						| ErrorDetail | Felinformationen. | 
					
						| ErrorResponse | Felsvar | 
					
						| HostnameConfiguration | Konfiguration av anpassat värdnamn. | 
					
						| HostnameType | Typ av värdnamn. | 
					
						| LegacyApiState | Ange om det äldre konfigurations-API:et (v1) ska exponeras på API Management-tjänsten eller inte. Värdet är valfritt men måste vara Aktiverat eller Inaktiverat. Om "Inaktiverad" är äldre konfigurations-API (v1) inte tillgängligt för gatewayer med egen värd. Standardvärdet är "Aktiverat" | 
					
						| LegacyPortalStatus | Status för den äldre portalen i API Management-tjänsten. | 
					
						| NatGatewayState | Egenskapen kan användas för att aktivera NAT Gateway för den här API Management-tjänsten. | 
					
						| PlatformVersion | Beräkningsplattformsversion som kör tjänsten. | 
					
						| PrivateEndpointServiceConnectionStatus | Anslutningsstatus för privat slutpunkt. | 
					
						| PrivateLinkServiceConnectionState | En samling med information om tillståndet för anslutningen mellan tjänstkonsumenten och leverantören. | 
					
						| PublicNetworkAccess | Om offentlig slutpunktsåtkomst tillåts för den här API Management-tjänsten eller inte.  Värdet är valfritt, men om det skickas in måste det vara "Aktiverat" eller "Inaktiverat". Om "Inaktiverad" är privata slutpunkter den exklusiva åtkomstmetoden. Standardvärdet är "Aktiverat" | 
					
						| RemotePrivateEndpointConnectionWrapper | Fjärrresurs för privat slutpunktsanslutning. | 
					
						| SkuType | Namnet på SKU:n. | 
					
						| systemData | Metadata som rör skapande och senaste ändring av resursen. | 
					
						| UserIdentityProperties |  | 
					
						| VirtualNetworkConfiguration | Konfiguration av ett virtuellt nätverk som API Management-tjänsten distribueras till. | 
					
						| VirtualNetworkType | Den typ av VPN som API Management-tjänsten måste konfigureras i. Ingen (standardvärde) innebär att API Management-tjänsten inte ingår i något virtuellt nätverk, externt innebär att API Management-distributionen har konfigurerats i ett virtuellt nätverk med en Internetuppkopplad slutpunkt, och intern innebär att API Management-distributionen konfigureras i ett virtuellt nätverk som endast har en intranätuppkopplad slutpunkt. | 
			
			AdditionalLocation
			Objekt
			Beskrivning av ytterligare en API Management-resursplats.
				
					
						    | Name | Typ | Standardvärde | Description | 
	| disableGateway | 
					boolean
			 | False | Egenskapen är endast giltig för en Api Management-tjänst som distribuerats på flera platser. Detta kan användas för att inaktivera gatewayen på den här ytterligare platsen. | 
	| gatewayRegionalUrl | 
					string
			 |  | Gateway-URL för API Management-tjänsten i regionen. | 
	| location | 
					string
			 |  | Platsnamnet för den ytterligare regionen mellan Azure Data Center-regioner. | 
	| natGatewayState | 
					NatGatewayState
			 | Disabled | Egenskapen kan användas för att aktivera NAT Gateway för den här API Management-tjänsten. | 
	| outboundPublicIPAddresses | 
					string[]
			 |  | Utgående offentliga IPV4-adressprefix som är associerade med NAT Gateway-distribuerad tjänst. Endast tillgängligt för Premium SKU på stv2-plattformen. | 
	| platformVersion | 
					PlatformVersion
			 |  | Beräkningsplattformsversion som kör tjänsten. | 
	| privateIPAddresses | 
					string[]
			 |  | Privata statiska belastningsutjämnings-IP-adresser för API Management-tjänsten som distribueras i ett internt virtuellt nätverk på en viss ytterligare plats. Endast tillgängligt för SKU:n Basic, Standard, Premium och Isolated. | 
	| publicIPAddresses | 
					string[]
			 |  | Offentliga statiska belastningsutjämnings-IP-adresser för API Management-tjänsten på den ytterligare platsen. Endast tillgängligt för SKU:n Basic, Standard, Premium och Isolated. | 
	| publicIpAddressId | 
					string
			 |  | Public Standard SKU IP V4-baserad IP-adress som ska associeras med distribuerad tjänst för virtuellt nätverk på platsen. Stöds endast för Premium SKU som distribueras i virtuellt nätverk. | 
	| sku | 
					ApiManagementServiceSkuProperties
			 |  | SKU-egenskaper för API Management-tjänsten. | 
	| virtualNetworkConfiguration | 
					VirtualNetworkConfiguration
			 |  | Konfiguration av virtuellt nätverk för platsen. | 
	| zones | 
					string[]
			 |  | En lista över tillgänglighetszoner som anger var resursen måste komma ifrån. | 
				
			ApiManagementServiceIdentity
			Objekt
			Identitetsegenskaper för Api Management-tjänstresursen.
				
					
						    | Name | Typ | Description | 
	| principalId | 
					string
(uuid)
			 | Identitetens huvud-ID. | 
	| tenantId | 
					string
(uuid)
			 | Klientklient-ID:t för identiteten. | 
	| type | 
					ApimIdentityType
			 | Den typ av identitet som används för resursen. Typen "SystemAssigned, UserAssigned" innehåller både en implicit skapad identitet och en uppsättning användartilldelade identiteter. Typen "Ingen" tar bort alla identiteter från tjänsten. | 
	| userAssignedIdentities | 
				
		<string, 
		UserIdentityProperties>
			 | Listan över användaridentiteter som är associerade med resursen. Nyckelreferenserna för användaridentitetsordlistan är ARM-resurs-ID:er i formuläret: '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/ providers/Microsoft.ManagedIdentity/userAssignedIdentities/{identityName}'. | 
				
			ApiManagementServiceResource
			Objekt
			En enda API Management-tjänstresurs i Lista eller Hämta svar.
				
					
						    | Name | Typ | Standardvärde | Description | 
	| etag | 
					string
			 |  | ETag för resursen. | 
	| id | 
					string
			 |  | Resurs-ID. | 
	| identity | 
					ApiManagementServiceIdentity
			 |  | Hanterad tjänstidentitet för Api Management-tjänsten. | 
	| location | 
					string
			 |  | Resursplats. | 
	| name | 
					string
			 |  | Resursnamn. | 
	| properties.additionalLocations | 
					AdditionalLocation[]
			 |  | Ytterligare datacenterplatser för API Management-tjänsten. | 
	| properties.apiVersionConstraint | 
					ApiVersionConstraint
			 |  | Kontrollplans-API:ets versionsvillkor för API Management-tjänsten. | 
	| properties.certificates | 
					CertificateConfiguration[]
			 |  | Lista över certifikat som måste installeras i API Management-tjänsten. Maximalt antal certifikat som stöds som kan installeras är 10. | 
	| properties.configurationApi | 
					ConfigurationApi
			 |  | Konfigurations-API-konfiguration för API Management-tjänsten. | 
	| properties.createdAtUtc | 
					string
(date-time)
			 |  | Skapande av UTC-datum för API Management-tjänsten. Datumet överensstämmer med följande format: yyyy-MM-ddTHH:mm:ssZenligt ISO 8601-standarden. | 
	| properties.customProperties | 
					object
			 |  | Anpassade egenskaper för API Management-tjänsten.Inställning
 Microsoft.WindowsAzure.ApiManagement.Gateway.Security.Ciphers.TripleDes168inaktiverar chiffer TLS_RSA_WITH_3DES_EDE_CBC_SHA för alla TLS(1.0, 1.1 och 1.2).Inställning
 Microsoft.WindowsAzure.ApiManagement.Gateway.Security.Protocols.Tls11kan användas för att inaktivera bara TLS 1.1.Inställning
 Microsoft.WindowsAzure.ApiManagement.Gateway.Security.Protocols.Tls10kan användas för att inaktivera TLS 1.0 på en API Management-tjänst.Inställning
 Microsoft.WindowsAzure.ApiManagement.Gateway.Security.Backend.Protocols.Tls11kan användas för att inaktivera endast TLS 1.1 för kommunikation med serverdelar.Inställning
 Microsoft.WindowsAzure.ApiManagement.Gateway.Security.Backend.Protocols.Tls10kan användas för att inaktivera TLS 1.0 för kommunikation med serverdelar.Inställning
 Microsoft.WindowsAzure.ApiManagement.Gateway.Protocols.Server.Http2kan användas för att aktivera HTTP2-protokoll på en API Management-tjänst.Om du inte anger någon av dessa egenskaper för PATCH-åtgärden återställs utelämnade egenskapers värden till standardvärdena. För alla inställningar utom Http2 är standardvärdet
 Trueom tjänsten skapades den 1 april 2018 eller före den 1 april 2018 ochFalseannat. Http2-inställningens standardvärde ärFalse.
 Du kan inaktivera något av följande chiffer med hjälp av inställningarna
 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_128_CBC_SHA256, TLS_RSA_WITH_AES_256_CBC_SHA, TLS_RSA_WITH_AES_128_CBC_SHA. Till exempelMicrosoft.WindowsAzure.ApiManagement.Gateway.Security.Ciphers.TLS_RSA_WITH_AES_128_CBC_SHA256:false. Standardvärdet ärtrueför dem.Obs! Följande chiffer kan inte inaktiveras eftersom de krävs av interna plattformskomponenter: 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.developerPortalStatus | 
					developerPortalStatus
			 | Enabled | Status för utvecklarportalen i den här API Management-tjänsten. | 
	| properties.developerPortalUrl | 
					string
			 |  | DEveloper-portalens slutpunkts-URL för API Management-tjänsten. | 
	| properties.disableGateway | 
					boolean
			 | False | Egenskapen är endast giltig för en Api Management-tjänst som distribuerats på flera platser. Detta kan användas för att inaktivera gatewayen i huvudregionen. | 
	| properties.enableClientCertificate | 
					boolean
			 | False | Egenskapen är endast avsedd att användas för förbruknings-SKU-tjänsten. Detta framtvingar att ett klientcertifikat visas på varje begäran till gatewayen. Detta gör det också möjligt att autentisera certifikatet i principen på gatewayen. | 
	| properties.gatewayRegionalUrl | 
					string
			 |  | Gateway-URL för API Management-tjänsten i standardregionen. | 
	| properties.gatewayUrl | 
					string
			 |  | Gateway-URL för API Management-tjänsten. | 
	| properties.hostnameConfigurations | 
					HostnameConfiguration[]
			 |  | Konfiguration av anpassat värdnamn för API Management-tjänsten. | 
	| properties.legacyPortalStatus | 
					LegacyPortalStatus
			 | Enabled | Status för den äldre portalen i API Management-tjänsten. | 
	| properties.managementApiUrl | 
					string
			 |  | API-slutpunkts-URL för hantering av API Management. | 
	| properties.natGatewayState | 
					NatGatewayState
			 | Disabled | Egenskapen kan användas för att aktivera NAT Gateway för den här API Management-tjänsten. | 
	| properties.notificationSenderEmail | 
					string
			maxLength: 100 |  | E-postadress som meddelandet ska skickas från. | 
	| properties.outboundPublicIPAddresses | 
					string[]
			 |  | Utgående offentliga IPV4-adressprefix som är associerade med NAT Gateway-distribuerad tjänst. Endast tillgängligt för Premium SKU på stv2-plattformen. | 
	| properties.platformVersion | 
					PlatformVersion
			 |  | Beräkningsplattformsversion som kör tjänsten på den här platsen. | 
	| properties.portalUrl | 
					string
			 |  | Url för slutpunkts-URL för utgivarportalen för API Management-tjänsten. | 
	| properties.privateEndpointConnections | 
					RemotePrivateEndpointConnectionWrapper[]
			 |  | Lista över privata slutpunktsanslutningar för den här tjänsten. | 
	| properties.privateIPAddresses | 
					string[]
			 |  | Privata statiska belastningsutjämnings-IP-adresser för API Management-tjänsten i den primära regionen som distribueras i ett internt virtuellt nätverk. Endast tillgängligt för SKU:n Basic, Standard, Premium och Isolated. | 
	| properties.provisioningState | 
					string
			 |  | Det aktuella etableringstillståndet för API Management-tjänsten som kan vara något av följande: Skapad/Aktivera/Lyckades/Uppdatera/Misslyckad/Stoppad/Avslutande/AvslutningFailed/Borttagen. | 
	| properties.publicIPAddresses | 
					string[]
			 |  | Offentliga statiska belastningsutjämnings-IP-adresser för API Management-tjänsten i den primära regionen. Endast tillgängligt för SKU:n Basic, Standard, Premium och Isolated. | 
	| properties.publicIpAddressId | 
					string
			 |  | Public Standard SKU IP V4-baserad IP-adress som ska associeras med distribuerad tjänst för virtuellt nätverk i regionen. Stöds endast för utvecklare och Premium SKU som distribueras i virtuellt nätverk. | 
	| properties.publicNetworkAccess | 
					PublicNetworkAccess
			 |  | Om offentlig slutpunktsåtkomst tillåts för den här API Management-tjänsten eller inte.  Värdet är valfritt, men om det skickas in måste det vara "Aktiverat" eller "Inaktiverat". Om "Inaktiverad" är privata slutpunkter den exklusiva åtkomstmetoden. Standardvärdet är "Aktiverat" | 
	| properties.publisherEmail | 
					string
			maxLength: 100 |  | E-post för utgivare. | 
	| properties.publisherName | 
					string
			maxLength: 100 |  | Utgivarens namn. | 
	| properties.restore | 
					boolean
			 | False | Ta bort Api Management-tjänsten om den tidigare var mjuk borttagen. Om den här flaggan anges och är inställd på Sant ignoreras alla andra egenskaper. | 
	| properties.scmUrl | 
					string
			 |  | SCM-slutpunkts-URL för API Management-tjänsten. | 
	| properties.targetProvisioningState | 
					string
			 |  | Etableringstillståndet för API Management-tjänsten, som är mål för den tidskrävande åtgärden som startades på tjänsten. | 
	| properties.virtualNetworkConfiguration | 
					VirtualNetworkConfiguration
			 |  | Konfiguration av virtuellt nätverk för API Management-tjänsten. | 
	| properties.virtualNetworkType | 
					VirtualNetworkType
			 | None | Den typ av VPN som API Management-tjänsten måste konfigureras i. Ingen (standardvärde) innebär att API Management-tjänsten inte ingår i något virtuellt nätverk, externt innebär att API Management-distributionen har konfigurerats i ett virtuellt nätverk med en Internetuppkopplad slutpunkt, och intern innebär att API Management-distributionen konfigureras i ett virtuellt nätverk som endast har en intranätuppkopplad slutpunkt. | 
	| sku | 
					ApiManagementServiceSkuProperties
			 |  | SKU-egenskaper för API Management-tjänsten. | 
	| systemData | 
					systemData
			 |  | Metadata som rör skapande och senaste ändring av resursen. | 
	| tags | 
					object
			 |  | Resurstaggar. | 
	| type | 
					string
			 |  | Resurstypen för API Management-resursen är inställd på Microsoft.ApiManagement. | 
	| zones | 
					string[]
			 |  | En lista över tillgänglighetszoner som anger var resursen måste komma ifrån. | 
				
			ApiManagementServiceSkuProperties
			Objekt
			Egenskaper för API Management-tjänstens resurs-SKU.
				
					
						    | Name | Typ | Description | 
	| capacity | 
					integer
(int32)
			 | SKU:ns kapacitet (antalet distribuerade enheter i SKU:n). För SKU-kapacitet för förbrukning måste anges som 0. | 
	| name | 
					SkuType
			 | Namnet på SKU:n. | 
				
			ApimIdentityType
			Uppräkning
			Den typ av identitet som används för resursen. Typen "SystemAssigned, UserAssigned" innehåller både en implicit skapad identitet och en uppsättning användartilldelade identiteter. Typen "Ingen" tar bort alla identiteter från tjänsten.
				
					
							| Värde | Description | 
	| SystemAssigned |  | 
	| UserAssigned |  | 
	| SystemAssigned, UserAssigned |  | 
	| None |  | 
				
			ApiVersionConstraint
			Objekt
			Kontrollplans-API:ets versionsvillkor för API Management-tjänsten.
				
					
						    | Name | Typ | Description | 
	| minApiVersion | 
					string
			 | Begränsa API-anrop för kontrollplan till API Management-tjänsten med en version som är lika med eller nyare än det här värdet. | 
				
			ArmIdWrapper
			Objekt
			En omslutning för ett ARM-resurs-ID
				
					
						    | Name | Typ | Description | 
	| id | 
					string
			 |  | 
				
			CertificateConfiguration
			Objekt
			Certifikatkonfiguration som består av icke-betrodda mellanliggande objekt och rotcertifikat.
				
					
						    | Name | Typ | Description | 
	| certificate | 
					CertificateInformation
			 | Certifikatinformation. | 
	| certificatePassword | 
					string
			 | Certifikatlösenord. | 
	| encodedCertificate | 
					string
			 | Base64-kodat certifikat. | 
	| storeName | enum: 
			
					CertificateAuthority
			
					Root
			 | Certifikatarkivet System.Security.Cryptography.x509certificates.StoreName. Endast Rot- och CertificateAuthority är giltiga platser. | 
				
			
			Objekt
			SSL-certifikatinformation.
				
					
						    | Name | Typ | Description | 
	| expiry | 
					string
(date-time)
			 | Förfallodatum för certifikatet. Datumet överensstämmer med följande format: yyyy-MM-ddTHH:mm:ssZenligt ISO 8601-standarden. | 
	| subject | 
					string
			 | Certifikatets ämne. | 
	| thumbprint | 
					string
			 | Tumavtryck för certifikatet. | 
				
			CertificateSource
			Uppräkning
			Certifikatkälla.
				
					
							| Värde | Description | 
	| Managed |  | 
	| KeyVault |  | 
	| Custom |  | 
	| BuiltIn |  | 
				
			CertificateStatus
			Uppräkning
			Certifikatstatus.
				
					
							| Värde | Description | 
	| Completed |  | 
	| Failed |  | 
	| InProgress |  | 
				
			ConfigurationApi
			Objekt
			Information om API-konfigurations-API:et för API Management-tjänsten.
				
					
						    | Name | Typ | Standardvärde | Description | 
	| legacyApi | 
					LegacyApiState
			 | Enabled | Ange om det äldre konfigurations-API:et (v1) ska exponeras på API Management-tjänsten eller inte. Värdet är valfritt men måste vara Aktiverat eller Inaktiverat. Om "Inaktiverad" är äldre konfigurations-API (v1) inte tillgängligt för gatewayer med egen värd. Standardvärdet är "Aktiverat" | 
				
			createdByType
			Uppräkning
			Den typ av identitet som skapade resursen.
				
					
							| Värde | Description | 
	| User |  | 
	| Application |  | 
	| ManagedIdentity |  | 
	| Key |  | 
				
			developerPortalStatus
			Uppräkning
			Status för utvecklarportalen i den här API Management-tjänsten.
				
					
							| Värde | Description | 
	| Enabled | Utvecklarportalen är aktiverad för tjänsten. | 
	| Disabled | Utvecklarportalen är inaktiverad för tjänsten. | 
				
			ErrorAdditionalInfo
			Objekt
			Ytterligare information om resurshanteringsfelet.
				
					
						    | Name | Typ | Description | 
	| info | 
					object
			 | Ytterligare information. | 
	| type | 
					string
			 | Ytterligare informationstyp. | 
				
			ErrorDetail
			Objekt
			Felinformationen.
				
					
						    | Name | Typ | Description | 
	| additionalInfo | 
					ErrorAdditionalInfo[]
			 | Ytterligare information om felet. | 
	| code | 
					string
			 | Felkoden. | 
	| details | 
					ErrorDetail[]
			 | Felinformationen. | 
	| message | 
					string
			 | Felmeddelandet. | 
	| target | 
					string
			 | Felmålet. | 
				
			ErrorResponse
			Objekt
			Felsvar
				
			HostnameConfiguration
			Objekt
			Konfiguration av anpassat värdnamn.
				
					
						    | Name | Typ | Standardvärde | Description | 
	| certificate | 
					CertificateInformation
			 |  | Certifikatinformation. | 
	| certificatePassword | 
					string
			 |  | Certifikatlösenord. | 
	| certificateSource | 
					CertificateSource
			 |  | Certifikatkälla. | 
	| certificateStatus | 
					CertificateStatus
			 |  | Certifikatstatus. | 
	| defaultSslBinding | 
					boolean
			 | False | Ange true för att konfigurera certifikatet som är associerat med det här värdnamnet som standard-SSL-certifikat. Om en klient inte skickar SNI-huvudet blir det här certifikatet som kommer att utmanas. Egenskapen är användbar om en tjänst har flera anpassade värdnamn aktiverade och måste bestämma standard-SSL-certifikatet. Inställningen tillämpas endast på gatewayens värdnamnstyp. | 
	| encodedCertificate | 
					string
			 |  | Base64-kodat certifikat. | 
	| hostName | 
					string
			 |  | Värdnamn som ska konfigureras på Api Management-tjänsten. | 
	| identityClientId | 
					string
			 |  | Klient-ID för system- eller användartilldelad hanterad identitet som genererats av Azure AD, som har GET-åtkomst till keyVault som innehåller SSL-certifikatet. | 
	| keyVaultId | 
					string
			 |  | Url till KeyVault-hemligheten som innehåller Ssl-certifikatet. Om absolut URL som innehåller version tillhandahålls fungerar inte automatisk uppdatering av SSL-certifikatet. Detta kräver att Api Management-tjänsten konfigureras med aka.ms/apimmsi. Hemligheten ska vara av typen application/x-pkcs12 | 
	| negotiateClientCertificate | 
					boolean
			 | False | Ange true för att alltid förhandla om klientcertifikatet på värdnamnet. Standardvärdet är falskt. | 
	| type | 
					HostnameType
			 |  | Typ av värdnamn. | 
				
			HostnameType
			Uppräkning
			Typ av värdnamn.
				
					
							| Värde | Description | 
	| Proxy |  | 
	| Portal |  | 
	| Management |  | 
	| Scm |  | 
	| DeveloperPortal |  | 
	| ConfigurationApi |  | 
				
			LegacyApiState
			Uppräkning
			Ange om det äldre konfigurations-API:et (v1) ska exponeras på API Management-tjänsten eller inte. Värdet är valfritt men måste vara Aktiverat eller Inaktiverat. Om "Inaktiverad" är äldre konfigurations-API (v1) inte tillgängligt för gatewayer med egen värd. Standardvärdet är "Aktiverat"
				
					
							| Värde | Description | 
	| Enabled | Api för äldre konfiguration (v1) är aktiverat för tjänsten och gatewayer med egen värd kan ansluta till den. | 
	| Disabled | Äldre konfigurations-API (v1) är inaktiverat för tjänsten och gatewayer med egen värd kan inte ansluta till den. | 
				
			LegacyPortalStatus
			Uppräkning
			Status för den äldre portalen i API Management-tjänsten.
				
					
							| Värde | Description | 
	| Enabled | Den äldre portalen är aktiverad för tjänsten. | 
	| Disabled | Den äldre portalen är inaktiverad för tjänsten. | 
				
			NatGatewayState
			Uppräkning
			Egenskapen kan användas för att aktivera NAT Gateway för den här API Management-tjänsten.
				
					
							| Värde | Description | 
	| Enabled | Nat Gateway är aktiverat för tjänsten. | 
	| Disabled | Nat Gateway är inaktiverad för tjänsten. | 
				
			
			Uppräkning
			Beräkningsplattformsversion som kör tjänsten.
				
					
							| Värde | Description | 
	| undetermined | Det går inte att fastställa plattformsversionen eftersom beräkningsplattformen inte distribueras. | 
	| stv1 | Plattform som kör tjänsten på V1-plattformen för enskild klientorganisation. | 
	| stv2 | Plattform som kör tjänsten på V2-plattformen för enskild klientorganisation. | 
	| mtv1 | Plattform som kör tjänsten på V1-plattformen för flera klientorganisationer. | 
	| stv2.1 | Plattform som kör tjänsten på V2-plattformen för enskild klientorganisation på nyare maskinvara. | 
				
			PrivateEndpointServiceConnectionStatus
			Uppräkning
			Anslutningsstatus för privat slutpunkt.
				
					
							| Värde | Description | 
	| Pending |  | 
	| Approved |  | 
	| Rejected |  | 
				
			PrivateLinkServiceConnectionState
			Objekt
			En samling med information om tillståndet för anslutningen mellan tjänstkonsumenten och leverantören.
				
					
						    | Name | Typ | Description | 
	| actionsRequired | 
					string
			 | Ett meddelande som anger om ändringar på tjänstleverantören kräver några uppdateringar på konsumenten. | 
	| description | 
					string
			 | Orsak till godkännande/avvisande av anslutningen. | 
	| status | 
					PrivateEndpointServiceConnectionStatus
			 | Anger om anslutningen har godkänts/avvisats/tagits bort av tjänstens ägare. | 
				
			PublicNetworkAccess
			Uppräkning
			Om offentlig slutpunktsåtkomst tillåts för den här API Management-tjänsten eller inte.  Värdet är valfritt, men om det skickas in måste det vara "Aktiverat" eller "Inaktiverat". Om "Inaktiverad" är privata slutpunkter den exklusiva åtkomstmetoden. Standardvärdet är "Aktiverat"
				
					
							| Värde | Description | 
	| Enabled |  | 
	| Disabled |  | 
				
			RemotePrivateEndpointConnectionWrapper
			Objekt
			Fjärrresurs för privat slutpunktsanslutning.
				
					
						    | Name | Typ | Description | 
	| id | 
					string
			 | Resurs-ID för privat slutpunktsanslutning | 
	| name | 
					string
			 | Namn på privat slutpunktsanslutning | 
	| properties.groupIds | 
					string[]
			 | Alla grupp-ID:t. | 
	| properties.privateEndpoint | 
					ArmIdWrapper
			 | Resursen för den privata slutpunkten. | 
	| properties.privateLinkServiceConnectionState | 
					PrivateLinkServiceConnectionState
			 | En samling med information om tillståndet för anslutningen mellan tjänstkonsumenten och leverantören. | 
	| properties.provisioningState | 
					string
			 | Etableringstillståndet för den privata slutpunktsanslutningsresursen. | 
	| type | 
					string
			 | Resurstyp för privat slutpunktsanslutning | 
				
			SkuType
			Uppräkning
			Namnet på SKU:n.
				
					
							| Värde | Description | 
	| Developer | Utvecklar-SKU för Api Management. | 
	| Standard | Standard-SKU för Api Management. | 
	| Premium | Premium SKU för Api Management. | 
	| Basic | Grundläggande SKU för Api Management. | 
	| Consumption | Förbruknings-SKU för Api Management. | 
	| Isolated | Isolerad SKU för Api Management. | 
	| BasicV2 | BasicV2 SKU för Api Management. | 
	| StandardV2 | StandardV2 SKU för Api Management. | 
				
			systemData
			Objekt
			Metadata som rör skapande och senaste ändring av resursen.
				
					
						    | Name | Typ | Description | 
	| createdAt | 
					string
(date-time)
			 | Tidsstämpeln för resursskapande (UTC). | 
	| createdBy | 
					string
			 | Identiteten som skapade resursen. | 
	| createdByType | 
					createdByType
			 | Den typ av identitet som skapade resursen. | 
	| lastModifiedAt | 
					string
(date-time)
			 | Tidsstämpeln för resursens senaste ändring (UTC) | 
	| lastModifiedBy | 
					string
			 | Identiteten som senast ändrade resursen. | 
	| lastModifiedByType | 
					createdByType
			 | Den typ av identitet som senast ändrade resursen. | 
				
			UserIdentityProperties
			Objekt
			
				
					
						    | Name | Typ | Description | 
	| clientId | 
					string
			 | Klient-ID för användartilldelad identitet. | 
	| principalId | 
					string
			 | Huvud-ID för användartilldelad identitet. | 
				
			VirtualNetworkConfiguration
			Objekt
			Konfiguration av ett virtuellt nätverk som API Management-tjänsten distribueras till.
				
					
						    | Name | Typ | Description | 
	| subnetResourceId | 
					string
			pattern: ^/subscriptions/[^/]*/resourceGroups/[^/]*/providers/Microsoft.(ClassicNetwork|Network)/virtualNetworks/[^/]*/subnets/[^/]*$ | Det fullständiga resurs-ID:t för ett undernät i ett virtuellt nätverk för att distribuera API Management-tjänsten i. | 
	| subnetname | 
					string
			 | Namnet på undernätet. | 
	| vnetid | 
					string
			 | Det virtuella nätverks-ID:t. Detta är vanligtvis ett GUID. Förvänta dig ett null-GUID som standard. | 
				
			VirtualNetworkType
			Uppräkning
			Den typ av VPN som API Management-tjänsten måste konfigureras i. Ingen (standardvärde) innebär att API Management-tjänsten inte ingår i något virtuellt nätverk, externt innebär att API Management-distributionen har konfigurerats i ett virtuellt nätverk med en Internetuppkopplad slutpunkt, och intern innebär att API Management-distributionen konfigureras i ett virtuellt nätverk som endast har en intranätuppkopplad slutpunkt.
				
					
							| Värde | Description | 
	| None | Tjänsten ingår inte i något virtuellt nätverk. | 
	| External | Tjänsten är en del av det virtuella nätverket och är tillgänglig från Internet. | 
	| Internal | Tjänsten är en del av det virtuella nätverket och är endast tillgänglig från det virtuella nätverket. |