Import-​Azure​Rm​Api​Management​Api

Imports an API from a file or a URL.

Syntax

Import-AzureRmApiManagementApi
      [-ApiId <String>]
      [-ApiType <PsApiManagementApiType>]
      -Context <PsApiManagementContext>
      [-Path <String>]
      -SpecificationFormat <PsApiManagementApiFormat>
      -SpecificationPath <String>
      [-WsdlEndpointName <String>]
      [-WsdlServiceName <String>]
      [<CommonParameters>]
Import-AzureRmApiManagementApi
      [-ApiId <String>]
      [-ApiType <PsApiManagementApiType>]
      -Context <PsApiManagementContext>
      [-Path <String>]
      -SpecificationFormat <PsApiManagementApiFormat>
      -SpecificationUrl <String>
      [-WsdlEndpointName <String>]
      [-WsdlServiceName <String>]
      [<CommonParameters>]

Description

The Import-AzureRmApiManagementApi cmdlet imports an Azure API Management API from a file or a URL in Web Application Description Language (WADL), Web Services Description Language (WSDL), or Swagger format.

Examples

Example 1 Import an API from a WADL file

PS C:\>Import-AzureRmApiManagementApi -Context $ApiMgmtContext -SpecificationFormat "Wadl" -SpecificationPath "C:\contoso\specifications\echoapi.wadl" -Path "apis"

This command imports an API from the specified WADL file.

Example 2 Import an API from a Swagger file

PS C:\>Import-AzureRmApiManagementApi -Context $ApiMgmtContext -SpecificationFormat "Swagger" -SpecificationPath "C:\contoso\specifications\echoapi.swagger" -Path "apis"

This command imports an API from the specified Swagger file.

Example 3: Import an API from a WADL link

PS C:\>Import-AzureRmApiManagementApi -Context $ApiMgmtContext -SpecificationFormat "Wadl" -SpecificationUrl "http://contoso.com/specifications/wadl/echoapi" -Path "apis"

This command imports an API from the specified WADL link.

Required Parameters

-Context

Specifies a PsApiManagementContext object.

Type:PsApiManagementContext
Position:Named
Default value:None
Accept pipeline input:True (ByPropertyName)
Accept wildcard characters:False
-SpecificationFormat

Specifies the specification format. psdx_paramvalues Wadl, Wsdl, and Swagger.

Type:PsApiManagementApiFormat
Parameter Sets:Wadl, Swagger, Wsdl
Position:Named
Default value:None
Accept pipeline input:True (ByPropertyName)
Accept wildcard characters:False
-SpecificationPath

Specifies the specification file path.

Type:String
Position:Named
Default value:None
Accept pipeline input:True (ByPropertyName)
Accept wildcard characters:False
-SpecificationUrl

Specifies the specification URL.

Type:String
Position:Named
Default value:None
Accept pipeline input:True (ByPropertyName)
Accept wildcard characters:False

Optional Parameters

-ApiId

Specifies an ID for the API to import. If you do not specify this parameter, an ID is generated for you.

Type:String
Position:Named
Default value:None
Accept pipeline input:True (ByPropertyName)
Accept wildcard characters:False
-ApiType

This parameter is optional with a default value of Http. The Soap option is only applicable when importing WSDL and will create a SOAP Passthrough API.

Type:PsApiManagementApiType
Parameter Sets:Http, Soap
Position:Named
Default value:None
Accept pipeline input:True (ByPropertyName)
Accept wildcard characters:False
-Path

Specifies a web API path as the last part of the API's public URL. This URL is used by API consumers for sending requests to the web service. Must be 1 to 400 characters long. The default value is $Null.

Type:String
Position:Named
Default value:None
Accept pipeline input:True (ByPropertyName)
Accept wildcard characters:False
-WsdlEndpointName

Local name of WSDL Endpoint (port) to be imported. Must be 1 to 400 characters long. This parameter is optional and only required for importing Wsdl. Default value is $null.

Type:String
Position:Named
Default value:None
Accept pipeline input:True (ByPropertyName)
Accept wildcard characters:False
-WsdlServiceName

Local name of WSDL Service to be imported. Must be 1 to 400 characters long. This parameter is optional and only required for importing Wsdl . Default value is $null.

Type:String
Position:Named
Default value:None
Accept pipeline input:True (ByPropertyName)
Accept wildcard characters:False

Outputs

Microsoft.Azure.Commands.ApiManagement.ServiceManagement.Models.PsApiManagementApi

This cmdlet returns the imported API as a PsApiManagementApi object.