azure-powershell icon indicating copy to clipboard operation
azure-powershell copied to clipboard

[Feature]: OData API support for Az.ApiManagement module

Open erwinkramer opened this issue 1 year ago • 2 comments

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 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.

erwinkramer avatar Aug 08 '24 18:08 erwinkramer

Thanks for the feedback! We are routing this to the appropriate team for follow-up. cc @solankisamir, @mikebudzynski, @KedarJoshi, @yingru97.

Thanks for the feedback! We are routing this to the appropriate team for follow-up. cc @solankisamir, @mikebudzynski, @KedarJoshi, @yingru97.