Skip to content

Commit 0b4bd76

Browse files
[Az.Functions] Fix cloud portability by using dynamic endpoints for storage (#29035)
1 parent ce93512 commit 0b4bd76

File tree

2 files changed

+7
-6
lines changed

2 files changed

+7
-6
lines changed

src/Functions/Functions.Autorest/custom/HelperFunctions.ps1

Lines changed: 5 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -160,15 +160,14 @@ function GetEndpointSuffix
160160
[Microsoft.Azure.PowerShell.Cmdlets.Functions.DoNotExportAttribute()]
161161
param()
162162

163-
$environmentName = (Get-AzContext).Environment.Name
163+
$storageEndpointSuffix = (Get-AzContext).Environment.StorageEndpointSuffix
164164

165-
switch ($environmentName)
165+
if ([string]::IsNullOrWhiteSpace($storageEndpointSuffix))
166166
{
167-
"AzureUSGovernment" { ';EndpointSuffix=core.usgovcloudapi.net' }
168-
"AzureChinaCloud" { ';EndpointSuffix=core.chinacloudapi.cn' }
169-
"AzureCloud" { ';EndpointSuffix=core.windows.net' }
170-
default { '' }
167+
return ''
171168
}
169+
170+
return ";EndpointSuffix=$storageEndpointSuffix"
172171
}
173172

174173
function NewAppSetting

src/Functions/Functions/ChangeLog.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,8 @@
1919
-->
2020
## Upcoming Release
2121

22+
* Fixed cloud portability by using dynamic endpoints for storage [#29034]
23+
2224
## Version 4.3.0
2325
* 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)
2426
* Added a new cmdlet Get-AzFunctionAppFlexConsumptionRuntime to retrieve Flex Consumption runtimes for a specified location

0 commit comments

Comments
 (0)