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

[SQL VM] az sql vm update: Add configuration options for SQL Assessment pre-requisites #22672

Merged
merged 15 commits into from
Jun 13, 2022

Conversation

vadeveka
Copy link
Contributor

@vadeveka vadeveka commented May 31, 2022

Related command
az sql vm update --enable-assessment true -g <Resource Group Name> -n <SQL VM Name> --workspace-name <LA workspace's name> --workspace-rg <LA workspace's resource group name>

Description

  • SQL VM offers ability to configure and run assessment via previous PR. This PR adds support for verifying and managing pre-requisites such as Log Analytics extension on VM and custom log definition on workspace.
    • Re-use az vm's code for managing Log Analytics extension. See src/azure-cli/azure/cli/command_modules/sqlvm/_util.py
    • Rename SQL Best Practice Assessment to SQL best practices assessment as per branding requirement
    • Move LogAnalyticsWorkspacePreparer to cli-test-sdk for use across modules
  • Fix usage of is_r_services field when populating request object

Testing Guide

# Deploy pre-requisites for SQL best practices assessment using given LA workspace
az sql vm update --enable-assessment true -g <Resource Group Name> -n <SQL VM Name> --workspace-name <LA workspace's name> --workspace-rg <LA workspace's resource group name>

# Deploy pre-requisites for SQL best practices assessment using workspace already associated with VM, if not throw appropriate error
az sql vm update –assessment-weekly-interval 3 --assessment-day-of-week Sunday –assessment-start-time-local "23:00" -g <Resource Group Name> -n <SQL VM Name>

Scenarios:

  1. No workspace attached to VM. User does not provide workspace arguments -> Throw error
  2. No workspace attached to VM. User provides workspace arguments -> Deploy VM extension and custom log if not present.
  3. Workspace attached to VM. User does not provide workspace arguments -> Determine workspace from extension. Verify workspace exists. Deploy custom log if necessary.
  4. Workspace attached to VM. User provides workspace arguments -> Determine workspace from extension. Verify workspace exists and matches user arguments. Deploy custom log if necessary.
  5. Configure assessment/workspace via CLI on 1 VM. Configure via Portal for another VM for same workspace -> Custom log definition created by CLI also recognized by Portal

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

@ghost ghost requested a review from yonzhan May 31, 2022 00:13
@ghost ghost added the Auto-Assign Auto assign by bot label May 31, 2022
@ghost ghost assigned zhoxing-ms May 31, 2022
@ghost ghost added this to the Jun 2022 (2022-07-05) milestone May 31, 2022
@ghost ghost added Compute az vm/vmss/image/disk/snapshot SQL az sql labels May 31, 2022
@ghost ghost requested review from evelyn-ys and calvinhzy May 31, 2022 00:13
@ghost ghost assigned evelyn-ys May 31, 2022
@yonzhan
Copy link
Collaborator

yonzhan commented May 31, 2022

SQL VM

@vadeveka vadeveka changed the title [SQL VM] az sql vm update: Add configuration options for Log Analytics pre-requisites [SQL VM] az sql vm update: Add configuration options for SQL Assessment pre-requisites May 31, 2022
@evelyn-ys evelyn-ys merged commit 430aac4 into Azure:dev Jun 13, 2022
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 Compute az vm/vmss/image/disk/snapshot SQL az sql
Projects
None yet
Development

Successfully merging this pull request may close these issues.

6 participants