Skip to content

Commit 6bc4db5

Browse files
Revert Application Insights WhatIf change due to missing cloud endpoint property
1 parent b0fbd66 commit 6bc4db5

File tree

1 file changed

+1
-12
lines changed

1 file changed

+1
-12
lines changed

src/Functions/Functions.Autorest/custom/New-AzFunctionApp.ps1

Lines changed: 1 addition & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -982,19 +982,8 @@ Example:
982982
{
983983
Write-Verbose "WhatIf: Creating Application Insights '$Name' in resource group '$ResourceGroupName' at location '$($functionAppDef.Location)'..."
984984
# Create a mock object for WhatIf to avoid null reference issues
985-
# Use the current cloud's Application Insights endpoint
986-
$appInsightsSuffix = (Get-AzContext).Environment.AzureApplicationInsightsEndpointResourceId
987-
if ([string]::IsNullOrWhiteSpace($appInsightsSuffix))
988-
{
989-
$appInsightsSuffix = "applicationinsights.azure.com"
990-
}
991-
else
992-
{
993-
# Extract domain from the resource ID (e.g., remove leading https:// or trailing /)
994-
$appInsightsSuffix = $appInsightsSuffix -replace '^https?://', '' -replace '/$', ''
995-
}
996985
$newAppInsightsProject = New-Object PSObject -Property @{
997-
ConnectionString = "InstrumentationKey=00000000-0000-0000-0000-000000000000;IngestionEndpoint=https://$appInsightsSuffix/"
986+
ConnectionString = "InstrumentationKey=00000000-0000-0000-0000-000000000000;IngestionEndpoint=https://placeholder.applicationinsights.azure.com/"
998987
Name = $Name
999988
}
1000989
$appSettings.Add((NewAppSetting -Name 'APPLICATIONINSIGHTS_CONNECTION_STRING' -Value $newAppInsightsProject.ConnectionString))

0 commit comments

Comments
 (0)