< Back

Import-AzureRmApiManagementApi

Tue Jan 29, 2019 9:29 pm

NAME Import-AzureRmApiManagementApi



SYNOPSIS

Imports an API from a file or a URL.





SYNTAX

Import-AzureRmApiManagementApi [-ApiId <String>] [-ApiType {Http | Soap}] -Context <PsApiManagementContext> [-DefaultProfile

<IAzureContextContainer>] [-Path <String>] -SpecificationFormat {Wadl | Swagger | Wsdl} -SpecificationPath <String> [-WsdlEndpointName <String>]

[-WsdlServiceName <String>] [<CommonParameters>]



Import-AzureRmApiManagementApi [-ApiId <String>] [-ApiType {Http | Soap}] -Context <PsApiManagementContext> [-DefaultProfile

<IAzureContextContainer>] [-Path <String>] -SpecificationFormat {Wadl | Swagger | Wsdl} -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.





PARAMETERS

-ApiId <String>

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



Required? false

Position? named

Default value None

Accept pipeline input? True (ByPropertyName)

Accept wildcard characters? false



-ApiType <PsApiManagementApiType>

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.



Required? false

Position? named

Default value None

Accept pipeline input? True (ByPropertyName)

Accept wildcard characters? false



-Context <PsApiManagementContext>

Specifies a PsApiManagementContext object.



Required? true

Position? named

Default value None

Accept pipeline input? True (ByPropertyName)

Accept wildcard characters? false



-DefaultProfile <IAzureContextContainer>

The credentials, account, tenant, and subscription used for communication with azure.



Required? false

Position? named

Default value None

Accept pipeline input? False

Accept wildcard characters? false



-Path <String>

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.



Required? false

Position? named

Default value None

Accept pipeline input? True (ByPropertyName)

Accept wildcard characters? false



-SpecificationFormat <PsApiManagementApiFormat>

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



Required? true

Position? named

Default value None

Accept pipeline input? True (ByPropertyName)

Accept wildcard characters? false



-SpecificationPath <String>

Specifies the specification file path.



Required? true

Position? named

Default value None

Accept pipeline input? True (ByPropertyName)

Accept wildcard characters? false



-SpecificationUrl <String>

Specifies the specification URL.



Required? true

Position? named

Default value None

Accept pipeline input? True (ByPropertyName)

Accept wildcard characters? false



-WsdlEndpointName <String>

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.



Required? false

Position? named

Default value None

Accept pipeline input? True (ByPropertyName)

Accept wildcard characters? false



-WsdlServiceName <String>

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.



Required? false

Position? named

Default value None

Accept pipeline input? True (ByPropertyName)

Accept wildcard characters? false



<CommonParameters>

This cmdlet supports the common parameters: Verbose, Debug,

ErrorAction, ErrorVariable, WarningAction, WarningVariable,

OutBuffer, PipelineVariable, and OutVariable. For more information, see

about_CommonParameters (http://go.microsoft.com/fwlink/?LinkID=113216).



INPUTS

None

This cmdlet does not accept any input.





OUTPUTS

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

This cmdlet returns the imported API as a PsApiManagementApi object.





NOTES









Example 1 Import an API from a WADL file



PS C:\\>$ApiMgmtContext = New-AzureRmApiManagementContext -ResourceGroupName "Api-Default-WestUS" -ServiceName "contoso"

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:\\>$ApiMgmtContext = New-AzureRmApiManagementContext -ResourceGroupName "Api-Default-WestUS" -ServiceName "contoso"

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:\\>$ApiMgmtContext = New-AzureRmApiManagementContext -ResourceGroupName "Api-Default-WestUS" -ServiceName "contoso"

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.







RELATED LINKS

Online Version: https://docs.microsoft.com/en-us/powers ... agementapi

Export-AzureRmApiManagementApi

Get-AzureRmApiManagementApi

New-AzureRmApiManagementApi

Remove-AzureRmApiManagementApi

Set-AzureRmApiManagementApi