diff --git a/src/Functions/Functions.Autorest/custom/HelperFunctions.ps1 b/src/Functions/Functions.Autorest/custom/HelperFunctions.ps1 index 737ad02ef1dc..9cac8132f4af 100644 --- a/src/Functions/Functions.Autorest/custom/HelperFunctions.ps1 +++ b/src/Functions/Functions.Autorest/custom/HelperFunctions.ps1 @@ -160,15 +160,14 @@ function GetEndpointSuffix [Microsoft.Azure.PowerShell.Cmdlets.Functions.DoNotExportAttribute()] param() - $environmentName = (Get-AzContext).Environment.Name + $storageEndpointSuffix = (Get-AzContext).Environment.StorageEndpointSuffix - switch ($environmentName) + if ([string]::IsNullOrWhiteSpace($storageEndpointSuffix)) { - "AzureUSGovernment" { ';EndpointSuffix=core.usgovcloudapi.net' } - "AzureChinaCloud" { ';EndpointSuffix=core.chinacloudapi.cn' } - "AzureCloud" { ';EndpointSuffix=core.windows.net' } - default { '' } + return '' } + + return ";EndpointSuffix=$storageEndpointSuffix" } function NewAppSetting diff --git a/src/Functions/Functions/ChangeLog.md b/src/Functions/Functions/ChangeLog.md index 08cd92ed7076..c17caafcc69d 100644 --- a/src/Functions/Functions/ChangeLog.md +++ b/src/Functions/Functions/ChangeLog.md @@ -19,6 +19,8 @@ --> ## Upcoming Release +* Fixed cloud portability by using dynamic endpoints for storage [#29034] + ## Version 4.3.0 * Added FlexConsumption support to Get-AzFunctionAppAvailableLocation, which returns a list of regions that supported Flex Consumption, including locations supporting zone redundancy (currently applied only to Flex Consumption) * Added a new cmdlet Get-AzFunctionAppFlexConsumptionRuntime to retrieve Flex Consumption runtimes for a specified location