Open bonyfusbouvet opened 2 years ago
Application should dynamically get supported locations for resource types.
Example PowerShell script for getting all supported locations in Norway and Europe for a resource type:
# Get-AzResourceTypeLocations.ps1 param ( [string]$ProviderNamespace, [string]$ResourceTypeName ) $Provider = Get-AzResourceProvider -ProviderNamespace $ProviderNamespace $ResourceType = $Provider.ResourceTypes | Where-Object { $_.ResourceTypeName -eq $ResourceTypeName } $Locations = $ResourceType.Locations | Where-Object { $_ -like '* Europe' -or $_ -like 'Norway *' } Write-Output $Locations
Checking supported locations for Storage Accounts:
.\Get-AzResourceTypeLocations.ps1 -ProviderNamespace 'Microsoft.Storage' -ResourceTypeName 'storageAccounts' Outputs:
.\Get-AzResourceTypeLocations.ps1 -ProviderNamespace 'Microsoft.Storage' -ResourceTypeName 'storageAccounts'
West Europe North Europe Norway East Checking supported locations for Virtual Machines:
.\Get-AzResourceTypeLocations.ps1 -ProviderNamespace 'Microsoft.Compute' -ResourceTypeName 'virtualMachines' Outputs:
.\Get-AzResourceTypeLocations.ps1 -ProviderNamespace 'Microsoft.Compute' -ResourceTypeName 'virtualMachines'
North Europe West Europe Norway East
Query secondary location: https://larry.claman.net/post/2020-04-09-querying-for-azure-regional-pairs/
@bonyfusbouvet is this in prod?
Application should dynamically get supported locations for resource types.
Example PowerShell script for getting all supported locations in Norway and Europe for a resource type:
Checking supported locations for Storage Accounts:
.\Get-AzResourceTypeLocations.ps1 -ProviderNamespace 'Microsoft.Storage' -ResourceTypeName 'storageAccounts'
Outputs:West Europe North Europe Norway East Checking supported locations for Virtual Machines:
.\Get-AzResourceTypeLocations.ps1 -ProviderNamespace 'Microsoft.Compute' -ResourceTypeName 'virtualMachines'
Outputs:North Europe West Europe Norway East