Azure createUiDefinition json ArmApiControl using PostgreSQL Flexible Server location-based capabilities API

Arsen Vladimirskiy
2 min readAug 10, 2022

--

In this video, we look at how to use the ArmApiControl in createUiDefinition.json to query and display Azure PostgreSQL Flexible Server location-based capabilities within DropDown UI elements in Azure Portal.

Azure PostgreSQL Flexible Server service has different capabilities that are based on the Azure subscription and region where it is being deployed. For example, a given region may only allow deployment within specific zones for a given subscription or only support specific PostgreSQL server versions.

If an Azure Managed Application needs to create a PostgreSQL Flexible Server, it needs to be able to show only the appropriate location-based capabilities to the user to avoid deployment-time failures that use features that are not available in the selected region and subscription.

You can see the code used in the video at https://github.com/arsenvlad/createuidefinition-examples/tree/main/postgresql-flexible-server

Video Walkthrough

Tip: Play the video full screen or on YouTube to see all of the details.

Try it yourself

  • Visit the GitHub repo.
  • Copy postgresql-flexibleserver-selectors.json into Create UI Definition Sandbox.
  • Try various regions to see how available options change based on the region selected (e.g., East US — for all options, West US — for regional only without zones, West US 2 — for no availability of PostgreSQL Flexible Server).
  • Review the code to see how contains() and an array are used to filter the drop downs to narrow down the options that the location-based capabilities API returns to ones that you want to have (e.g., say only GeneralPurpose instead of Burstable tier and version 13 only, etc.).
PostgreSQL Flexible Server is available in the selected region
PostgreSQL Flexible Server is not available for subscription in the selected region

Thank you!

Please leave feedback and questions below, on the YouTube video, or on Twitter https://twitter.com/ArsenVlad

--

--

Arsen Vladimirskiy
Arsen Vladimirskiy

Written by Arsen Vladimirskiy

Principal Engineer / Architect, FastTrack for Azure at Microsoft