Skip to content

Commit

Permalink
{ApiManagement} | Add a sample to update an existing API (#18347)
Browse files Browse the repository at this point in the history
* {ApiManagement} | Add a sample to update an existing API

Fixes #18296

* {API Management} | Updating example number

Fixes PR #18347

* Fixing a typo

Fixing a typo
  • Loading branch information
RakeshMohanMSFT authored Jun 7, 2022
1 parent 13e3a8f commit 90505e8
Showing 1 changed file with 11 additions and 3 deletions.
14 changes: 11 additions & 3 deletions src/ApiManagement/ApiManagement/help/Import-AzApiManagementApi.md
Original file line number Diff line number Diff line change
Expand Up @@ -52,15 +52,23 @@ Import-AzApiManagementApi -Context $ApiMgmtContext -SpecificationFormat "Swagger

This command imports an API from the specified Swagger file.

### Example 3: Import an API from a WADL link
### Example 3: Import an API from a Swagger file and update an existing API
```powershell
$ApiMgmtContext = New-AzApiManagementContext -ResourceGroupName "Api-Default-WestUS" -ServiceName "contoso"
Import-AzApiManagementApi -Context $ApiMgmtContext -ApiId "26591405e27d4ff3a8d8478d7e60c7b0" -SpecificationFormat "Swagger" -SpecificationPath "C:\contoso\specifications\echoapi.swagger" -Path "apis"
```

This command imports an API from the specified Swagger file and updates an existing API.

### Example 4: Import an API from a WADL link
```powershell
$ApiMgmtContext = New-AzApiManagementContext -ResourceGroupName "Api-Default-WestUS" -ServiceName "contoso"
Import-AzApiManagementApi -Context $ApiMgmtContext -SpecificationFormat "Wadl" -SpecificationUrl "http://contoso.com/specifications/wadl/echoapi" -Path "apis"
```

This command imports an API from the specified WADL link.

### Example 4: Import an API from a Open Api Link
### Example 5: Import an API from a Open Api Link
```powershell
$context = New-AzApiManagementContext -ResourceGroupName "Api-Default-WestUS" -ServiceName "contoso"
Import-AzApiManagementApi -Context $context -SpecificationFormat OpenApi -SpecificationUrl https://raw.githubusercontent.com/OAI/OpenAPI-Specification/master/examples/v3.0/petstore.yaml -Path "petstore30"
Expand Down Expand Up @@ -95,7 +103,7 @@ ServiceName : contoso

This command imports an API from the specified Open 3.0 specification link.

### Example 5: Import an API from a Open Api Link into a ApiVersion Set
### Example 6: Import an API from a Open Api Link into a ApiVersion Set

```powershell
$context = New-AzApiManagementContext -ResourceGroupName "Api-Default-WestUS" -ServiceName "contoso"
Expand Down

0 comments on commit 90505e8

Please sign in to comment.