Azure / Azure/azure-powershell
[Feature]: OData API support for Az.ApiManagement module
- Dominant language
- C#
- Stars
- 4.8k
- Forks
- 4.3k
- Avg merge
- 2d 17h
- Merged PRs (30d)
- 51
Description
### Description of the new feature
Currently, there is 0 support for doing anything with OData APIs in API Management with the Az module.
Even a simple [Get-AzApiManagementApi](https://learn.microsoft.com/en-us/powershell/module/az.apimanagement/get-azapimanagementapi?view=azps-12.1.0) does not fetch an existing OData API, let alone adding an OData based API.
The only way to do it currently is with the management API, adding an OData API like this:
```
$body = @{
properties = @{
format = "odata"
value = $ApiSpecification
path = $ApiName
displayName = $ApiDisplayName
serviceUrl = $ApiServiceUrl
protocols = @("https")
type = "odata"
}
}
$restApiUrl = "https://management.azure.com/subscriptions/$((Get-AzContext).Subscription.Id)/resourceGroups/$($ApiMgmtContext.ResourceGroupName)/providers/Microsoft.ApiManagement/service/$($ApiMgmtContext.ServiceName)/apis/$($ApiId)?import=true&api-version=2023-03-01-preview"
Invoke-AzRestMethod -Method Put -Uri $restApiUrl -Payload $($body | ConvertTo-Json -Depth 10)
```
### Proposed implementation details (optional)
At least these functions should support OData APIs:
`Get-AzApiManagementApi`
`New-AzApiManagementApi`
`Remove-AzApiManagementApi`
`Set-AzApiManagementApi`
And all other API functions, not limited to:
`New-AzApiManagementApiRelease`
`New-AzApiManagementApiRevision`
Ideally, it should be supported in:
`Import-AzApiManagementApi`
But I understand that even in the resource manager interface, OData isn't really being imported, although it should make sense to do so.
Contributor guide
Research direction
Start by tracing the listed Az.ApiManagement entry points—Get-AzApiManagementApi, New-AzApiManagementApi, Remove-AzApiManagementApi, Set-AzApiManagementApi, the release and revision commands, and Import-AzApiManagementApi—against the management API request shown. Done means existing OData APIs can be retrieved and the relevant create, update, remove, release, revision, and import operations support the OData format.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- azure, csharp, powershell
- Domain
- api, backend-api-design, cloud
- Issue type
- Feature
- Difficulty
- 5/5
- Estimated time
- Over a week
- Activity status
- Quiet
- Clarity
- Mostly clear
- Newbie friendliness
- 42/100