Azure / azure-powershell

Microsoft Azure PowerShell
Other
4.21k stars 3.81k forks source link

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

Open erwinkramer opened 1 month ago

erwinkramer commented 1 month ago

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.

microsoft-github-policy-service[bot] commented 4 weeks ago

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

microsoft-github-policy-service[bot] commented 4 weeks ago

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