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

Imports an API from a file or a URL.

Syntax

Import-AzureRmApiManagementApi
      -Context <PsApiManagementContext>
      [-ApiId <String>]
      -SpecificationFormat <PsApiManagementApiFormat>
      -SpecificationPath <String>
      [-Path <String>]
      [-InformationAction <ActionPreference>]
      [-InformationVariable <String>]
      [-WsdlServiceName <String>]
      [-WsdlEndpointName <String>]
      [<CommonParameters>]
Import-AzureRmApiManagementApi
      -Context <PsApiManagementContext>
      [-ApiId <String>]
      -SpecificationFormat <PsApiManagementApiFormat>
      [-Path <String>]
      -SpecificationUrl <String>
      [-InformationAction <ActionPreference>]
      [-InformationVariable <String>]
      [-WsdlServiceName <String>]
      [-WsdlEndpointName <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. The acceptable values for this parameter are: Wadl, Wsdl, and Swagger.

Type:PsApiManagementApiFormat
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
-InformationAction

Specifies how this cmdlet responds to an information event.The acceptable values for this parameter are:- Continue

  • Ignore
  • Inquire
  • SilentlyContinue
  • Stop
  • Suspend
Type:ActionPreference
Aliases:infa
Position:Named
Default value:None
Accept pipeline input:False
Accept wildcard characters:False
-InformationVariable

Specifies an information variable.

Type:String
Aliases:iv
Position:Named
Default value:None
Accept pipeline input:False
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

Specifies the local name of WSDL Endpoint, or port, that this cmdlet imports. Specify this parameter if you specify Wsdl for the SpecificationFormat parameter.

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

Specifies the local name of WSDL Service that this cmdlet imports. Specify this parameter if you specify Wsdl for SpecificationFormat.

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

Outputs

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