Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

{ApiManagement} | Add a sample to update an existing API #18347

Merged
merged 4 commits into from
Jun 7, 2022
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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