Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[AppService] az functionapp create: Use app insights connection string instead of instrumentation key #27803

Merged
merged 6 commits into from
Jan 10, 2024

Conversation

kamperiadis
Copy link
Contributor

Related command
az functionapp create

Description
Resolves #27607

Testing Guide
Create function app and check that app setting added is APPLICATIONINSIGHTS_CONNECTION_STRING instead of APPINSIGHTS_INSTRUMENTATION_KEY


This checklist is used to make sure that common guidelines for a pull request are followed.

Copy link

azure-client-tools-bot-prd bot commented Nov 9, 2023

️✔️AzureCLI-FullTest
️✔️acr
️✔️2020-09-01-hybrid
️✔️3.11
️✔️3.9
️✔️latest
️✔️3.11
️✔️3.9
️✔️acs
️✔️2020-09-01-hybrid
️✔️3.11
️✔️3.9
️✔️latest
️✔️3.11
️✔️3.9
️✔️advisor
️✔️latest
️✔️3.11
️✔️3.9
️✔️ams
️✔️latest
️✔️3.11
️✔️3.9
️✔️apim
️✔️latest
️✔️3.11
️✔️3.9
️✔️appconfig
️✔️latest
️✔️3.11
️✔️3.9
️✔️appservice
️✔️latest
️✔️3.11
️✔️3.9
️✔️aro
️✔️latest
️✔️3.11
️✔️3.9
️✔️backup
️✔️latest
️✔️3.11
️✔️3.9
️✔️batch
️✔️latest
️✔️3.11
️✔️3.9
️✔️batchai
️✔️latest
️✔️3.11
️✔️3.9
️✔️billing
️✔️latest
️✔️3.11
️✔️3.9
️✔️botservice
️✔️latest
️✔️3.11
️✔️3.9
️✔️cdn
️✔️latest
️✔️3.11
️✔️3.9
️✔️cloud
️✔️latest
️✔️3.11
️✔️3.9
️✔️cognitiveservices
️✔️latest
️✔️3.11
️✔️3.9
️✔️config
️✔️latest
️✔️3.11
️✔️3.9
️✔️configure
️✔️latest
️✔️3.11
️✔️3.9
️✔️consumption
️✔️latest
️✔️3.11
️✔️3.9
️✔️container
️✔️latest
️✔️3.11
️✔️3.9
️✔️containerapp
️✔️latest
️✔️3.11
️✔️3.9
️✔️core
️✔️2018-03-01-hybrid
️✔️3.11
️✔️3.9
️✔️2019-03-01-hybrid
️✔️3.11
️✔️3.9
️✔️2020-09-01-hybrid
️✔️3.11
️✔️3.9
️✔️latest
️✔️3.11
️✔️3.9
️✔️cosmosdb
️✔️latest
️✔️3.11
️✔️3.9
️✔️databoxedge
️✔️2019-03-01-hybrid
️✔️3.11
️✔️3.9
️✔️2020-09-01-hybrid
️✔️3.11
️✔️3.9
️✔️latest
️✔️3.11
️✔️3.9
️✔️dla
️✔️latest
️✔️3.11
️✔️3.9
️✔️dls
️✔️latest
️✔️3.11
️✔️3.9
️✔️dms
️✔️latest
️✔️3.11
️✔️3.9
️✔️eventgrid
️✔️latest
️✔️3.11
️✔️3.9
️✔️eventhubs
️✔️latest
️✔️3.11
️✔️3.9
️✔️feedback
️✔️latest
️✔️3.11
️✔️3.9
️✔️find
️✔️latest
️✔️3.11
️✔️3.9
️✔️hdinsight
️✔️latest
️✔️3.11
️✔️3.9
️✔️identity
️✔️latest
️✔️3.11
️✔️3.9
️✔️iot
️✔️2019-03-01-hybrid
️✔️3.11
️✔️3.9
️✔️2020-09-01-hybrid
️✔️3.11
️✔️3.9
️✔️latest
️✔️3.11
️✔️3.9
️✔️keyvault
️✔️2018-03-01-hybrid
️✔️3.11
️✔️3.9
️✔️2020-09-01-hybrid
️✔️3.11
️✔️3.9
️✔️latest
️✔️3.11
️✔️3.9
️✔️kusto
️✔️latest
️✔️3.11
️✔️3.9
️✔️lab
️✔️latest
️✔️3.11
️✔️3.9
️✔️managedservices
️✔️latest
️✔️3.11
️✔️3.9
️✔️maps
️✔️latest
️✔️3.11
️✔️3.9
️✔️marketplaceordering
️✔️latest
️✔️3.11
️✔️3.9
️✔️monitor
️✔️latest
️✔️3.11
️✔️3.9
️✔️mysql
️✔️latest
️✔️3.11
️✔️3.9
️✔️netappfiles
️✔️latest
️✔️3.11
️✔️3.9
️✔️network
️✔️2018-03-01-hybrid
️✔️3.11
️✔️3.9
️✔️latest
️✔️3.11
️✔️3.9
️✔️policyinsights
️✔️latest
️✔️3.11
️✔️3.9
️✔️privatedns
️✔️latest
️✔️3.11
️✔️3.9
️✔️profile
️✔️latest
️✔️3.11
️✔️3.9
️✔️rdbms
️✔️latest
️✔️3.11
️✔️3.9
️✔️redis
️✔️latest
️✔️3.11
️✔️3.9
️✔️relay
️✔️latest
️✔️3.11
️✔️3.9
️✔️resource
️✔️2018-03-01-hybrid
️✔️3.11
️✔️3.9
️✔️2019-03-01-hybrid
️✔️3.11
️✔️3.9
️✔️latest
️✔️3.11
️✔️3.9
️✔️role
️✔️latest
️✔️3.11
️✔️3.9
️✔️search
️✔️latest
️✔️3.11
️✔️3.9
️✔️security
️✔️latest
️✔️3.11
️✔️3.9
️✔️servicebus
️✔️latest
️✔️3.11
️✔️3.9
️✔️serviceconnector
️✔️latest
️✔️3.11
️✔️3.9
️✔️servicefabric
️✔️latest
️✔️3.11
️✔️3.9
️✔️signalr
️✔️latest
️✔️3.11
️✔️3.9
️✔️sql
️✔️latest
️✔️3.11
️✔️3.9
️✔️sqlvm
️✔️latest
️✔️3.11
️✔️3.9
️✔️storage
️✔️2018-03-01-hybrid
️✔️3.11
️✔️3.9
️✔️2019-03-01-hybrid
️✔️3.11
️✔️3.9
️✔️2020-09-01-hybrid
️✔️3.11
️✔️3.9
️✔️latest
️✔️3.11
️✔️3.9
️✔️synapse
️✔️latest
️✔️3.11
️✔️3.9
️✔️telemetry
️✔️2018-03-01-hybrid
️✔️3.11
️✔️3.9
️✔️2019-03-01-hybrid
️✔️3.11
️✔️3.9
️✔️2020-09-01-hybrid
️✔️3.11
️✔️3.9
️✔️latest
️✔️3.11
️✔️3.9
️✔️util
️✔️latest
️✔️3.11
️✔️3.9
️✔️vm
️✔️2018-03-01-hybrid
️✔️3.11
️✔️3.9
️✔️2019-03-01-hybrid
️✔️3.11
️✔️3.9
️✔️2020-09-01-hybrid
️✔️3.11
️✔️3.9
️✔️latest
️✔️3.11
️✔️3.9

Copy link

azure-client-tools-bot-prd bot commented Nov 9, 2023

️✔️AzureCLI-BreakingChangeTest
️✔️Non Breaking Changes

@yonzhan
Copy link
Collaborator

yonzhan commented Nov 9, 2023

AppService

@microsoft-github-policy-service microsoft-github-policy-service bot added the Functions az functionapp label Nov 9, 2023
@zhoxing-ms
Copy link
Contributor

zhoxing-ms commented Nov 27, 2023

@kamperiadis May I ask will the behavioral changes here cause breaking changes to the automation scripts of customers?

@zhoxing-ms
Copy link
Contributor

@kaibocai Could you please help review the Function App related PR?

@kamperiadis
Copy link
Contributor Author

@zhoxing-ms This is not a breaking change as using either app setting would work. These changes are made for this effort to migrate from the instrumentation key to the connection string.

@zhoxing-ms
Copy link
Contributor

This is not a breaking change as using either app setting would work. These changes are made for this effort to migrate from the instrumentation key to the connection string.

Okay, so this is just an internal logic modification and won't have any impact on the customers' script, right?

@zhoxing-ms
Copy link
Contributor

Could you please resolve these CI issues?

@kamperiadis
Copy link
Contributor Author

This is not a breaking change as using either app setting would work. These changes are made for this effort to migrate from the instrumentation key to the connection string.

Okay, so this is just an internal logic modification and won't have any impact on the customers' script, right?

That is correct.

@zhoxing-ms zhoxing-ms merged commit 69bec3f into Azure:dev Jan 10, 2024
53 checks passed
MaxHorstmann pushed a commit to MaxHorstmann/azure-cli that referenced this pull request Jan 19, 2024
class FunctionAppWithAppInsightsConnString(ScenarioTest):
def __init__(self, method_name, config_file=None, recording_name=None, recording_processors=None, replay_processors=None, recording_patches=None, replay_patches=None, random_config_dir=False):
super().__init__(method_name, config_file, recording_name, recording_processors, replay_processors, recording_patches, replay_patches, random_config_dir)
self.cmd('extension add -n application-insights')
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

extension add -n should not be here. It causes CI failure:

==================================== ERRORS ====================================
__________ ERROR collecting tests/latest/test_functionapp_commands.py __________
/usr/lib64/az/lib/python3.9/site-packages/azure/cli/command_modules/appservice/tests/latest/test_functionapp_commands.py:990: in __init__
    self.cmd('extension add -n application-insights')
/usr/lib64/az/lib/python3.9/site-packages/azure/cli/testsdk/base.py:176: in cmd
    return execute(self.cli_ctx, command, expect_failure=expect_failure).assert_with_checks(checks)
/usr/lib64/az/lib/python3.9/site-packages/azure/cli/testsdk/base.py:260: in __init__
    raise AssertionError('The command failed. Exit code: {}'.format(self.exit_code))
E   AssertionError: The command failed. Exit code: 1
__________ ERROR collecting tests/latest/test_functionapp_commands.py __________
/usr/lib64/az/lib/python3.9/site-packages/azure/cli/command_modules/appservice/tests/latest/test_functionapp_commands.py:1579: in __init__
    self.cmd('extension add -n application-insights')
/usr/lib64/az/lib/python3.9/site-packages/azure/cli/testsdk/base.py:176: in cmd
    return execute(self.cli_ctx, command, expect_failure=expect_failure).assert_with_checks(checks)
/usr/lib64/az/lib/python3.9/site-packages/azure/cli/testsdk/base.py:260: in __init__
    raise AssertionError('The command failed. Exit code: {}'.format(self.exit_code))
E   AssertionError: The command failed. Exit code: 1
__________ ERROR collecting tests/latest/test_functionapp_commands.py __________
/usr/lib64/az/lib/python3.9/site-packages/azure/cli/command_modules/appservice/tests/latest/test_functionapp_commands.py:1707: in __init__
    self.cmd('extension add -n application-insights')
/usr/lib64/az/lib/python3.9/site-packages/azure/cli/testsdk/base.py:176: in cmd
    return execute(self.cli_ctx, command, expect_failure=expect_failure).assert_with_checks(checks)
/usr/lib64/az/lib/python3.9/site-packages/azure/cli/testsdk/base.py:260: in __init__
    raise AssertionError('The command failed. Exit code: {}'.format(self.exit_code))
E   AssertionError: The command failed. Exit code: 1
---------- generated xml file: /azure_cli_test_result/appservice.xml -----------
=========================== short test summary info ============================
ERROR tests/latest/test_functionapp_commands.py::FunctionAppManagedEnvironment
ERROR tests/latest/test_functionapp_commands.py::FunctionAppWithAppInsightsConnString
ERROR tests/latest/test_functionapp_commands.py::FunctionappAppInsightsWorkspace

https://dev.azure.com/azclitools/public/_build/results?buildId=209680&view=logs&j=fce0fe10-dd1b-5814-f04b-ea25f95c49f0&t=f9fbf0f4-0b46-5841-08eb-fc21c02e7e0a&l=3124

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@kamperiadis Could you please take a look at this issue?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@zhoxing-ms I've created this PR to solve this issue: #30636

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Auto-Assign Auto assign by bot Functions az functionapp
Projects
None yet
Development

Successfully merging this pull request may close these issues.

az functionapp create does not use newly created application insight's connection string
4 participants