-
Notifications
You must be signed in to change notification settings - Fork 3.3k
Description
Describe the bug
Currently, az functionapp list-flexconsumption-locations will show the full list of Azure regions including internal and early access regions that the customer subscription might not have access to. This command should implement what the Azure Portal does by getting all regions from ARM for the resource type for that customer subscription then it combines it with the regions Flex Consumption is in.
Related command
az functionapp list-flexconsumption-locations
Errors
No exception
Issue script & Debug output
➜ ~ az functionapp list-flexconsumption-locations --debug
cli.knack.cli: Command arguments: ['functionapp', 'list-flexconsumption-locations', '--debug']
cli.knack.cli: init debug log:
Enable color in terminal.
cli.knack.cli: Event: Cli.PreExecute []
cli.knack.cli: Event: CommandParser.OnGlobalArgumentsCreate [<function CLILogging.on_global_arguments at 0x1046e6fc0>, <function OutputProducer.on_global_arguments at 0x104fbbf60>, <function CLIQuery.on_global_arguments at 0x104ffd760>]
cli.knack.cli: Event: CommandInvoker.OnPreCommandTableCreate []
cli.azure.cli.core: Modules found from index for 'functionapp': ['azure.cli.command_modules.appservice', 'azure.cli.command_modules.serviceconnector']
cli.azure.cli.core: Loading command modules:
cli.azure.cli.core: Name Load Time Groups Commands
cli.azure.cli.core: appservice 0.162 79 270
cli.azure.cli.core: serviceconnector 0.023 20 315
cli.azure.cli.core: Total (2) 0.185 99 585
cli.azure.cli.core: These extensions are not installed and will be skipped: ['azext_ai_examples', 'azext_next']
cli.azure.cli.core: Loading extensions:
cli.azure.cli.core: Name Load Time Groups Commands Directory
cli.azure.cli.core: Total (0) 0.000 0 0
cli.azure.cli.core: Loaded 97 groups, 585 commands.
cli.azure.cli.core: Found a match in the command table.
cli.azure.cli.core: Raw command : functionapp list-flexconsumption-locations
cli.azure.cli.core: Command table: functionapp list
cli.azure.cli.core: remaining : flexconsumption-locations
cli.knack.cli: Event: CommandInvoker.OnPreCommandTableTruncate [<function AzCliLogging.init_command_file_logging at 0x105daa2a0>]
cli.azure.cli.core.azlogging: metadata file logging enabled - writing logs to '/Users/user1/.azure/commands/2024-12-04.16-04-27.functionapp_list-flexconsumption-locations.1659.log'.
az_command_data_logger: command args: functionapp list-flexconsumption-locations --debug
cli.knack.cli: Event: CommandInvoker.OnPreArgumentLoad [<function register_global_subscription_argument..add_subscription_parameter at 0x105e1e020>]
cli.knack.cli: Event: CommandInvoker.OnPostArgumentLoad []
cli.knack.cli: Event: CommandInvoker.OnPostCommandTableCreate [<function register_ids_argument..add_ids_arguments at 0x105e1e0c0>, <function register_cache_arguments..add_cache_arguments at 0x105e1e200>, <function register_upcoming_breaking_change_info..update_breaking_change_info at 0x105e1e2a0>]
cli.knack.cli: Event: CommandInvoker.OnCommandTableLoaded []
cli.knack.cli: Event: CommandInvoker.OnPreParseArgs []
cli.knack.cli: Event: CommandInvoker.OnPostParseArgs [<function OutputProducer.handle_output_argument at 0x104fd4040>, <function CLIQuery.handle_query_parameter at 0x104ffd800>, <function register_ids_argument..parse_ids_arguments at 0x105e1e160>]
cli.azure.cli.core.util: Found subscription ID e281b54d-48da-4573-b5de-910332a3f059 in the URL https://management.azure.com/subscriptions/e281b54d-48da-4573-b5de-910332a3f059/providers/Microsoft.Web/geoRegions?sku=FlexConsumption&api-version=2023-01-01
cli.azure.cli.core.util: Retrieving token for resource https://management.core.windows.net/, subscription e281b54d-48da-4573-b5de-910332a3f059
cli.azure.cli.core.auth.persistence: build_persistence: location='/Users/user1/.azure/msal_token_cache.json', encrypt=False
cli.azure.cli.core.auth.binary_cache: load: /Users/user1/.azure/msal_http_cache.bin
urllib3.util.retry: Converted retries value: 1 -> Retry(total=1, connect=None, read=None, redirect=None, status=None)
cli.azure.cli.core.auth.msal_credentials: UserCredential.get_token: scopes=('https://management.core.windows.net//.default',), claims=None, kwargs={}
msal.application: Cache hit an AT
msal.telemetry: Generate or reuse correlation_id: 7a34aa79-3cd6-456a-b56d-9a7d08e705fa
cli.azure.cli.core.util: Request URL: 'https://management.azure.com/subscriptions//providers/Microsoft.Web/geoRegions?sku=FlexConsumption&api-version=2023-01-01'
cli.azure.cli.core.util: Request method: 'GET'
cli.azure.cli.core.util: Request headers:
cli.azure.cli.core.util: 'User-Agent': 'python/3.12.7 (macOS-15.1.1-arm64-arm-64bit) AZURECLI/2.67.0 (HOMEBREW)'
cli.azure.cli.core.util: 'Accept-Encoding': 'gzip, deflate'
cli.azure.cli.core.util: 'Accept': '/'
cli.azure.cli.core.util: 'Connection': 'keep-alive'
cli.azure.cli.core.util: 'x-ms-client-request-id': 'f92de78f-19ce-45cd-8e8b-be746ef5d3f1'
cli.azure.cli.core.util: 'CommandName': 'functionapp list-flexconsumption-locations'
cli.azure.cli.core.util: 'ParameterSetName': '--debug'
cli.azure.cli.core.util: 'Authorization': 'Bearer eyJ0eXAiOiJKV...'
cli.azure.cli.core.util: Request body:
cli.azure.cli.core.util: None
urllib3.connectionpool: Starting new HTTPS connection (1): management.azure.com:443
urllib3.connectionpool: https://management.azure.com:443 "GET /subscriptions//providers/Microsoft.Web/geoRegions?sku=FlexConsumption&api-version=2023-01-01 HTTP/1.1" 200 7532
cli.azure.cli.core.util: Response status: 200
cli.azure.cli.core.util: Response headers:
cli.azure.cli.core.util: 'Cache-Control': 'no-cache'
cli.azure.cli.core.util: 'Pragma': 'no-cache'
cli.azure.cli.core.util: 'Content-Length': '7532'
cli.azure.cli.core.util: 'Content-Type': 'application/json'
cli.azure.cli.core.util: 'Expires': '-1'
cli.azure.cli.core.util: 'Strict-Transport-Security': 'max-age=31536000; includeSubDomains'
cli.azure.cli.core.util: 'x-ms-request-id': '5bcdbb85-fffb-45db-b08d-87fd9c3eb48a'
cli.azure.cli.core.util: 'X-AspNet-Version': '4.0.30319'
cli.azure.cli.core.util: 'X-Powered-By': 'ASP.NET'
cli.azure.cli.core.util: 'x-ms-ratelimit-remaining-subscription-reads': '249'
cli.azure.cli.core.util: 'x-ms-ratelimit-remaining-subscription-global-reads': '3749'
cli.azure.cli.core.util: 'x-ms-correlation-request-id': 'e6bdf748-3e72-46f7-99a8-bd8227989b69'
cli.azure.cli.core.util: 'x-ms-routing-request-id': 'WESTUS2:20241205T000429Z:e6bdf748-3e72-46f7-99a8-bd8227989b69'
cli.azure.cli.core.util: 'X-Content-Type-Options': 'nosniff'
cli.azure.cli.core.util: 'X-Cache': 'CONFIG_NOCACHE'
cli.azure.cli.core.util: 'X-MSEdge-Ref': 'Ref A: 7821E7CAC7A243DCA8EC4D172EA8A54B Ref B: CO6AA3150220037 Ref C: 2024-12-05T00:04:28Z'
cli.azure.cli.core.util: 'Date': 'Thu, 05 Dec 2024 00:04:28 GMT'
cli.azure.cli.core.util: Response content:
cli.azure.cli.core.util: {"value":[{"id":"/subscriptions//providers/Microsoft.Web/geoRegions/North Europe","name":"North Europe","type":"Microsoft.Web/geoRegions","properties":{"name":"North Europe","description":"North Europe","sortOrder":1,"displayName":"North Europe","orgDomain":"ZONEREDUNDANCY;PUBLIC;DREAMSPARK;MSFTPUBLIC;FUNCTIONS;DYNAMIC;LINUX;DSERIES;LINUXDSERIES;SFCONTAINERS;LINUXDYNAMIC;ELASTICPREMIUM;LINUXFREE;ELASTICLINUX;XENON;XENONV3;WINDOWSV3;LINUXV3;WINDOWSMV3;LINUXMV3;WINDOWSP0V3;LINUXP0V3;XENONMV3;FLEXCONSUMPTION;MANAGEDAPP","subDomains":"northeurope-01.azurewebsites.net"}},{"id":"/subscriptions//providers/Microsoft.Web/geoRegions/Southeast Asia","name":"Southeast Asia","type":"Microsoft.Web/geoRegions","properties":{"name":"Southeast Asia","description":"Southeast Asia","sortOrder":3,"displayName":"Southeast Asia","orgDomain":"ZONEREDUNDANCY;PUBLIC;DREAMSPARK;MSFTPUBLIC;FUNCTIONS;DYNAMIC;LINUX;DSERIES;LINUXDSERIES;XENON;ELASTICPREMIUM;LINUXFREE;ELASTICLINUX;LINUXDYNAMIC;XENON;XENONV3;WINDOWSV3;LINUXV3;WINDOWSMV3;WINDOWSP0V3;LINUXP0V3;LINUXMV3;XENONMV3;FLEXCONSUMPTION;MANAGEDAPP","subDomains":"southeastasia-01.azurewebsites.net"}},{"id":"/subscriptions//providers/Microsoft.Web/geoRegions/East Asia","name":"East Asia","type":"Microsoft.Web/geoRegions","properties":{"name":"East Asia","description":null,"sortOrder":4,"displayName":"East Asia","orgDomain":"ZONEREDUNDANCY;PUBLIC;DREAMSPARK;MSFTPUBLIC;FUNCTIONS;DYNAMIC;LINUX;DSERIES;LINUXDSERIES;SFCONTAINERS;LINUXDYNAMIC;ELASTICPREMIUM;LINUXFREE;ELASTICLINUX;XENON;XENONV3;WINDOWSV3;LINUXV3;WINDOWSP0V3;LINUXP0V3;WINDOWSMV3;LINUXMV3;FLEXCONSUMPTION;XENONMV3;MANAGEDAPP;FCZONEREDUNDANCY","subDomains":"eastasia-01.azurewebsites.net"}},{"id":"/subscriptions//providers/Microsoft.Web/geoRegions/East US 2","name":"East US 2","type":"Microsoft.Web/geoRegions","properties":{"name":"East US 2","description":"East US 2","sortOrder":9,"displayName":"East US 2","orgDomain":"ZONEREDUNDANCY;PUBLIC;DREAMSPARK;MSFTPUBLIC;FUNCTIONS;DYNAMIC;DSERIES;LINUX;LINUXDSERIES;ELASTICPREMIUM;LINUXFREE;LINUXDYNAMIC;ELASTICLINUX;XENON;XENONV3;WINDOWSV3;LINUXV3;WINDOWSMV3;LINUXMV3;WINDOWSP0V3;LINUXP0V3;XENONMV3;FLEXCONSUMPTION;MANAGEDAPP","subDomains":"eastus2-01.azurewebsites.net"}},{"id":"/subscriptions//providers/Microsoft.Web/geoRegions/South Central US","name":"South Central US","type":"Microsoft.Web/geoRegions","properties":{"name":"South Central US","description":"South Central US","sortOrder":11,"displayName":"South Central US","orgDomain":"ZONEREDUNDANCY;PUBLIC;DREAMSPARK;MSFTPUBLIC;FUNCTIONS;DYNAMIC;DSERIES;LINUX;LINUXDSERIES;ELASTICPREMIUM;LINUXFREE;LINUXDYNAMIC;ELASTICLINUX;XENON;XENONV3;WINDOWSV3;LINUXV3;WINDOWSMV3;LINUXMV3;WINDOWSP0V3;LINUXP0V3;XENONMV3;FLEXCONSUMPTION;MANAGEDAPP","subDomains":"southcentralus-01.azurewebsites.net"}},{"id":"/subscriptions//providers/Microsoft.Web/geoRegions/Australia East","name":"Australia East","type":"Microsoft.Web/geoRegions","properties":{"name":"Australia East","description":"Australia East","sortOrder":13,"displayName":"Australia East","orgDomain":"ZONEREDUNDANCY;PUBLIC;DREAMSPARK;MSFTPUBLIC;FUNCTIONS;DYNAMIC;LINUX;DSERIES;LINUXDSERIES;XENON;ELASTICPREMIUM;LINUXFREE;LINUXDYNAMIC;ELASTICLINUX;XENON;XENONV3;WINDOWSV3;LINUXV3;LINUXMV3;LINUXP0V3;WINDOWSMV3;WINDOWSP0V3;XENONMV3;FLEXCONSUMPTION;MANAGEDAPP","subDomains":"australiaeast-01.azurewebsites.net"}},{"id":"/subscriptions//providers/Microsoft.Web/geoRegions/East US","name":"East US","type":"Microsoft.Web/geoRegions","properties":{"name":"East US","description":null,"sortOrder":2147483647,"displayName":"East US","orgDomain":"ZONEREDUNDANCY;PUBLIC;DREAMSPARK;MSFTPUBLIC;FUNCTIONS;DYNAMIC;LINUX;DSERIES;FAKEORG;LINUXDSERIES;XENON;SFCONTAINERS;LINUXDYNAMIC;LINUXFREE;ELASTICLINUX;ELASTICPREMIUM;XENON;XENONV3;WINDOWSV3;LINUXV3;WINDOWSMV3;LINUXMV3;WINDOWSP0V3;LINUXP0V3;XENONMV3;FLEXCONSUMPTION;MANAGEDAPP","subDomains":"eastus-01.azurewebsites.net"}},{"id":"/subscriptions//providers/Microsoft.Web/geoRegions/North Central US (Stage)","name":"North Central US (Stage)","type":"Microsoft.Web/geoRegions","properties":{"name":"North Central US (Stage)","description":null,"sortOrder":2147483647,"displayName":"North Central US (Stage)","orgDomain":"MSFTINT;LINUX;LINUXFREE;LINUXDYNAMIC;DSERIES;ELASTICPREMIUM;ELASTICLINUX;LINUXV3;MANAGEDAPP;FLEXCONSUMPTION;ZONEREDUNDANCY","subDomains":null}},{"id":"/subscriptions//providers/Microsoft.Web/geoRegions/West US 2","name":"West US 2","type":"Microsoft.Web/geoRegions","properties":{"name":"West US 2","description":"West US 2","sortOrder":2147483647,"displayName":"West US 2","orgDomain":"PUBLIC;DREAMSPARK;MSFTPUBLIC;FUNCTIONS;DYNAMIC;LINUX;DSERIES;LINUXDSERIES;LINUXFREE;LINUXDYNAMIC;ELASTICPREMIUM;ELASTICLINUX;XENON;XENONV3;WINDOWSV3;LINUXV3;WINDOWSMV3;LINUXMV3;WINDOWSP0V3;LINUXP0V3;ZONEREDUNDANCY;FLEXCONSUMPTION;XENONMV3;MANAGEDAPP","subDomains":"westus2-01.azurewebsites.net"}},{"id":"/subscriptions//providers/Microsoft.Web/geoRegions/UK South","name":"UK South","type":"Microsoft.Web/geoRegions","properties":{"name":"UK South","description":"UK South","sortOrder":2147483647,"displayName":"UK South","orgDomain":"ZONEREDUNDANCY;PUBLIC;MSFTPUBLIC;DYNAMIC;DSERIES;LINUX;LINUXDSERIES;LINUXFREE;LINUXDYNAMIC;ELASTICPREMIUM;ELASTICLINUX;XENON;XENONV3;WINDOWSV3;LINUXV3;WINDOWSMV3;LINUXMV3;WINDOWSP0V3;LINUXP0V3;XENONMV3;FLEXCONSUMPTION;MANAGEDAPP","subDomains":"uksouth-01.azurewebsites.net"}},{"id":"/subscriptions//providers/Microsoft.Web/geoRegions/East US 2 EUAP","name":"East US 2 EUAP","type":"Microsoft.Web/geoRegions","properties":{"name":"East US 2 EUAP","description":null,"sortOrder":2147483647,"displayName":"East US 2 EUAP","orgDomain":"ZONEREDUNDANCY;EUAP;XENON;LINUXDSERIES;ELASTICPREMIUM;FUNCTIONS;DYNAMIC;LINUX;LINUXFREE;ELASTICLINUX;WINDOWSV3;XENONV3;LINUXV3;WINDOWSMV3;LINUXMV3;WINDOWSP0V3;LINUXP0V3;XENONMV3;LINUXDYNAMIC;DSERIES;FLEXCONSUMPTION;MANAGEDAPP","subDomains":"eastus2euap-01.azurewebsites.net"}},{"id":"/subscriptions//providers/Microsoft.Web/geoRegions/West US 3","name":"West US 3","type":"Microsoft.Web/geoRegions","properties":{"name":"West US 3","description":"West US 3","sortOrder":2147483647,"displayName":"West US 3","orgDomain":"ZONEREDUNDANCY;PUBLIC;DSERIES;LINUX;LINUXDSERIES;XENON;XENONV3;WINDOWSV3;LINUXV3;ELASTICPREMIUM;ELASTICLINUX;FUNCTIONS;DYNAMIC;LINUXDYNAMIC;MSFTPUBLIC;LINUXMV3;LINUXP0V3;WINDOWSMV3;WINDOWSP0V3;LINUXFREE;XENONMV3;FLEXCONSUMPTION;MANAGEDAPP","subDomains":"westus3-01.azurewebsites.net"}},{"id":"/subscriptions//providers/Microsoft.Web/geoRegions/Sweden Central","name":"Sweden Central","type":"Microsoft.Web/geoRegions","properties":{"name":"Sweden Central","description":"Sweden Central","sortOrder":2147483647,"displayName":"Sweden Central","orgDomain":"ZONEREDUNDANCY;PUBLIC;DSERIES;LINUX;LINUXDSERIES;XENON;XENONV3;WINDOWSV3;LINUXV3;ELASTICPREMIUM;ELASTICLINUX;FUNCTIONS;DYNAMIC;MSFTPUBLIC;LINUXDYNAMIC;WINDOWSMV3;LINUXMV3;WINDOWSP0V3;LINUXP0V3;LINUXFREE;FLEXCONSUMPTION;MANAGEDAPP;XENONMV3","subDomains":"swedencentral-01.azurewebsites.net"}}],"nextLink":null,"id":null}
cli.knack.cli: Event: CommandInvoker.OnTransformResult [<function _resource_group_transform at 0x105dd79c0>, <function _x509_from_base64_to_hex_transform at 0x105dd7a60>]
cli.knack.cli: Event: CommandInvoker.OnFilterResult []
[
{
"name": "northeurope"
},
{
"name": "southeastasia"
},
{
"name": "eastasia"
},
{
"name": "eastus2"
},
{
"name": "southcentralus"
},
{
"name": "australiaeast"
},
{
"name": "eastus"
},
{
"name": "northcentralus(stage)"
},
{
"name": "westus2"
},
{
"name": "uksouth"
},
{
"name": "eastus2euap"
},
{
"name": "westus3"
},
{
"name": "swedencentral"
}
]
cli.knack.cli: Event: Cli.SuccessfulExecute []
cli.knack.cli: Event: Cli.PostExecute [<function AzCliLogging.deinit_cmd_metadata_logging at 0x105daa520>]
az_command_data_logger: exit code: 0
cli.main: Command ran in 1.909 seconds (init: 0.219, invoke: 1.691)
telemetry.main: Begin splitting cli events and extra events, total events: 1
telemetry.client: Accumulated 0 events. Flush the clients.
telemetry.main: Finish splitting cli events and extra events, cli events: 1
telemetry.save: Save telemetry record of length 3846 in cache file under /Users/user1/.azure/telemetry/20241204160429205
telemetry.main: Begin creating telemetry upload process.
telemetry.process: Creating upload process: "/opt/homebrew/Cellar/azure-cli/2.67.0/libexec/bin/python /opt/homebrew/Cellar/azure-cli/2.67.0/libexec/lib/python3.12/site-packages/azure/cli/telemetry/init.py /Users/user1/.azure /Users/user1/.azure/telemetry/20241204160429205"
telemetry.process: Return from creating process 1666
telemetry.main: Finish creating telemetry upload process.
Expected behavior
az functionapp list-flexconsumption-locations shows only the list of regions that the customer is allowed to use and that support Flex Consumption, instead of the full list of regions that support Flex Consumption.
Environment Summary
azure-cli 2.67.0
core 2.67.0
telemetry 1.1.0
Extensions:
load 1.3.1
Dependencies:
msal 1.31.0
azure-mgmt-resource 23.1.1
Python location '/opt/homebrew/Cellar/azure-cli/2.67.0/libexec/bin/python'
Extensions directory '/Users/thiagobrancherdealmeida/.azure/cliextensions'
Python (Darwin) 3.12.7 (main, Oct 1 2024, 02:05:46) [Clang 16.0.0 (clang-1600.0.26.3)]
Legal docs and information: aka.ms/AzureCliLegal
Your CLI is up-to-date.
Additional context
No response