diff --git a/.github/actions/env-setup/action.yml b/.github/actions/env-setup/action.yml index eb943ffa6ef..241615503e9 100644 --- a/.github/actions/env-setup/action.yml +++ b/.github/actions/env-setup/action.yml @@ -10,7 +10,7 @@ runs: label: ${{ toJSON(github.event.label) }} shell: bash run: | - echo version cal job start + echo start azdev env setup - name: Checkout CLI extension repo uses: actions/checkout@v4 with: diff --git a/.github/workflows/AzdevLinter.yml b/.github/workflows/AzdevLinter.yml index c297df3cbae..9f6b72d0a92 100644 --- a/.github/workflows/AzdevLinter.yml +++ b/.github/workflows/AzdevLinter.yml @@ -89,5 +89,9 @@ jobs: for mod in ${changed_module_list[@]} do echo changed module: "${mod}" - azdev extension add "${mod}" && azdev linter "${mod}" --min-severity medium --repo ./ --src "$diff_branch" --tgt "$merge_base" + azdev extension add "${mod}" + # ado linter task + azdev linter "${mod}" --min-severity medium + # linter task that needs git commit info + azdev linter "${mod}" --repo ./ --src "$diff_branch" --tgt "$merge_base" --rules missing_command_example done \ No newline at end of file diff --git a/.github/workflows/AzdevStyle.yml b/.github/workflows/AzdevStyle.yml index 2cea8c37efc..fcea306e8ac 100644 --- a/.github/workflows/AzdevStyle.yml +++ b/.github/workflows/AzdevStyle.yml @@ -90,5 +90,5 @@ jobs: do echo changed module: "${mod}" azdev extension add "${mod}" - azdev style "${mod}" + azdev style "${mod}" done \ No newline at end of file diff --git a/src/application-insights/azext_applicationinsights/_help.py b/src/application-insights/azext_applicationinsights/_help.py index b1a4d4acaa2..b650e21afb3 100644 --- a/src/application-insights/azext_applicationinsights/_help.py +++ b/src/application-insights/azext_applicationinsights/_help.py @@ -9,7 +9,7 @@ helps['monitor app-insights'] = """ type: group - short-summary: Commands for querying data in Application Insights applications. + short-summary: Commands for querying data in Application Insights applications. parameters: - name: --offset short-summary: > @@ -140,6 +140,20 @@ az monitor app-insights query --app e292531c-eb03-4079-9bb0-fe6b56b99f8b --analytics-query 'requests | summarize count() by bin(timestamp, 1h)' --offset 1h30m """ +helps['monitor app-insights query-add'] = """ + type: command + short-summary: Execute a query over data in your application. + parameters: + - name: --offset + short-summary: > + Time offset of the query range, in ##d##h format. + long-summary: > + Can be used with either --start-time or --end-time. If used with --start-time, then + the end time will be calculated by adding the offset. If used with --end-time (default), then + the start time will be calculated by subtracting the offset. If --start-time and --end-time are + provided, then --offset will be ignored. +""" + helps['monitor app-insights metrics show'] = """ type: command short-summary: View the value of a single metric. diff --git a/src/application-insights/azext_applicationinsights/commands.py b/src/application-insights/azext_applicationinsights/commands.py index 40fc38934ce..e9d567c4d4c 100644 --- a/src/application-insights/azext_applicationinsights/commands.py +++ b/src/application-insights/azext_applicationinsights/commands.py @@ -94,6 +94,7 @@ def load_command_table(self, _): with self.command_group('monitor app-insights', query_sdk) as g: g.custom_command('query', 'execute_query') + g.custom_command('query-add', 'execute_query_add') with self.command_group('monitor app-insights component linked-storage'): from .custom import LinkedStorageAccountLink, LinkedStorageAccountUpdate, LinkedStorageAccountShow, LinkedStorageAccountUnlink diff --git a/src/application-insights/azext_applicationinsights/custom.py b/src/application-insights/azext_applicationinsights/custom.py index 7b03265f296..7b4bbf28fcd 100644 --- a/src/application-insights/azext_applicationinsights/custom.py +++ b/src/application-insights/azext_applicationinsights/custom.py @@ -42,6 +42,9 @@ def execute_query(cmd, client, application, analytics_query, start_time=None, en raise ValueError("The Application Insight is not found. Please check the app id again.") raise ex +def execute_query_add(cmd, client, offset='1h'): + pass + def get_events(cmd, client, application, event_type, event=None, start_time=None, end_time=None, offset='1h', resource_group_name=None): timespan = get_timespan(cmd.cli_ctx, start_time, end_time, offset)