Dijeli putem


az sql server ms-support audit-policy

Manage a server's Microsoft support operations auditing policy.

Commands

Name Description Type Status
az sql server ms-support audit-policy show

Show server Microsoft support operations audit policy.

Core GA
az sql server ms-support audit-policy update

Update a server's Microsoft support operations auditing policy.

Core GA
az sql server ms-support audit-policy wait

Place the CLI in a waiting state until a condition of the server's Microsoft support operations audit policy is met.

Core GA

az sql server ms-support audit-policy show

Show server Microsoft support operations audit policy.

az sql server ms-support audit-policy show [--ids]
                                           [--name]
                                           [--resource-group]
                                           [--subscription]

Optional Parameters

--ids

One or more resource IDs (space-delimited). It should be a complete resource ID containing all information of 'Resource Id' arguments. You should provide either --ids or other 'Resource Id' arguments.

--name -n

Name of the Azure SQL Server. You can configure the default using az configure --defaults sql-server=<name>.

--resource-group -g

Name of resource group. You can configure the default group using az configure --defaults group=<name>.

--subscription

Name or ID of subscription. You can configure the default subscription using az account set -s NAME_OR_ID.

Global Parameters
--debug

Increase logging verbosity to show all debug logs.

--help -h

Show this help message and exit.

--only-show-errors

Only show errors, suppressing warnings.

--output -o

Output format.

Accepted values: json, jsonc, none, table, tsv, yaml, yamlc
Default value: json
--query

JMESPath query string. See http://jmespath.org/ for more information and examples.

--subscription

Name or ID of subscription. You can configure the default subscription using az account set -s NAME_OR_ID.

--verbose

Increase logging verbosity. Use --debug for full debug logs.

az sql server ms-support audit-policy update

Update a server's Microsoft support operations auditing policy.

If the Microsoft support operations policy is being enabled, --storage-account or both --storage-endpoint and --storage-key must be specified.

az sql server ms-support audit-policy update [--add]
                                             [--blob-storage-target-state {Disabled, Enabled}]
                                             [--eh]
                                             [--ehari]
                                             [--ehts {Disabled, Enabled}]
                                             [--force-string]
                                             [--ids]
                                             [--lats {Disabled, Enabled}]
                                             [--lawri]
                                             [--name]
                                             [--no-wait]
                                             [--remove]
                                             [--resource-group]
                                             [--set]
                                             [--state {Disabled, Enabled}]
                                             [--storage-account]
                                             [--storage-endpoint]
                                             [--storage-key]
                                             [--subscription]

Examples

Enable by storage account name.

az sql server ms-support audit-policy update -g mygroup -n myserver --state Enabled \
    --bsts Enabled --storage-account mystorage

Enable by storage endpoint and key.

az sql server ms-support audit-policy update -g mygroup -n myserver --state Enabled \
    --bsts Enabled --storage-endpoint https://mystorage.blob.core.windows.net \
    --storage-key MYKEY==

Disable a Microsoft support operations auditing policy.

az sql server ms-support audit-policy update -g mygroup -n myserver --state Disabled

Disable a blob storage Microsoft support operations auditing policy.

az sql server ms-support audit-policy update -g mygroup -n myserver --bsts Disabled

Enable a log analytics Microsoft support operations auditing policy.

az sql server ms-support audit-policy update -g mygroup -n myserver --state Enabled \
    --lats Enabled --lawri myworkspaceresourceid

Disable a log analytics Microsoft support operations auditing policy.

az sql server ms-support audit-policy update -g mygroup -n myserver
    --lats Disabled

Enable an event hub Microsoft support operations auditing policy.

az sql server ms-support audit-policy update -g mygroup -n myserver --state Enabled \
    --event-hub-target-state Enabled \
    --event-hub-authorization-rule-id eventhubauthorizationruleid \
    --event-hub eventhubname

Enable an event hub Microsoft support operations auditing policy for default event hub.

az sql server ms-support audit-policy update -g mygroup -n myserver --state Enabled \
    --event-hub-target-state Enabled \
    --event-hub-authorization-rule-id eventhubauthorizationruleid

Disable an event hub Microsoft support operations auditing policy.

az sql server ms-support audit-policy update -g mygroup -n myserver
    --event-hub-target-state Disabled

Optional Parameters

--add

Add an object to a list of objects by specifying a path and key value pairs. Example: --add property.listProperty <key=value, string or JSON string>.

Default value: []
--blob-storage-target-state --bsts

Indicate whether blob storage is a destination for audit records.

Accepted values: Disabled, Enabled
--eh --event-hub

The name of the event hub. If none is specified when providing event_hub_authorization_rule_id, the default event hub will be selected.

--ehari --event-hub-authorization-rule-id

The resource Id for the event hub authorization rule.

--ehts --event-hub-target-state

Indicate whether event hub is a destination for audit records.

Accepted values: Disabled, Enabled
--force-string

When using 'set' or 'add', preserve string literals instead of attempting to convert to JSON.

Default value: False
--ids

One or more resource IDs (space-delimited). It should be a complete resource ID containing all information of 'Resource Id' arguments. You should provide either --ids or other 'Resource Id' arguments.

--lats --log-analytics-target-state

Indicate whether log analytics is a destination for audit records.

Accepted values: Disabled, Enabled
--lawri --log-analytics-workspace-resource-id

The workspace ID (resource ID of a Log Analytics workspace) for a Log Analytics workspace to which you would like to send Audit Logs.

--name -n

Name of the Azure SQL Server. You can configure the default using az configure --defaults sql-server=<name>.

--no-wait

Do not wait for the long-running operation to finish.

Default value: False
--remove

Remove a property or an element from a list. Example: --remove property.list <indexToRemove> OR --remove propertyToRemove.

Default value: []
--resource-group -g

Name of resource group. You can configure the default group using az configure --defaults group=<name>.

--set

Update an object by specifying a property path and value to set. Example: --set property1.property2=<value>.

Default value: []
--state

Auditing policy state.

Accepted values: Disabled, Enabled
--storage-account

Name of the storage account.

--storage-endpoint

The storage account endpoint.

--storage-key

Access key for the storage account.

--subscription

Name or ID of subscription. You can configure the default subscription using az account set -s NAME_OR_ID.

Global Parameters
--debug

Increase logging verbosity to show all debug logs.

--help -h

Show this help message and exit.

--only-show-errors

Only show errors, suppressing warnings.

--output -o

Output format.

Accepted values: json, jsonc, none, table, tsv, yaml, yamlc
Default value: json
--query

JMESPath query string. See http://jmespath.org/ for more information and examples.

--subscription

Name or ID of subscription. You can configure the default subscription using az account set -s NAME_OR_ID.

--verbose

Increase logging verbosity. Use --debug for full debug logs.

az sql server ms-support audit-policy wait

Place the CLI in a waiting state until a condition of the server's Microsoft support operations audit policy is met.

az sql server ms-support audit-policy wait [--created]
                                           [--custom]
                                           [--deleted]
                                           [--exists]
                                           [--ids]
                                           [--interval]
                                           [--name]
                                           [--resource-group]
                                           [--subscription]
                                           [--timeout]
                                           [--updated]

Examples

Place the CLI in a waiting state until it determines that server's Microsoft support operations audit policy exists

az sql server ms-support audit-policy wait -g mygroup -n myserver --exists

Optional Parameters

--created

Wait until created with 'provisioningState' at 'Succeeded'.

Default value: False
--custom

Wait until the condition satisfies a custom JMESPath query. E.g. provisioningState!='InProgress', instanceView.statuses[?code=='PowerState/running'].

--deleted

Wait until deleted.

Default value: False
--exists

Wait until the resource exists.

Default value: False
--ids

One or more resource IDs (space-delimited). It should be a complete resource ID containing all information of 'Resource Id' arguments. You should provide either --ids or other 'Resource Id' arguments.

--interval

Polling interval in seconds.

Default value: 30
--name -n

Name of the Azure SQL Server. You can configure the default using az configure --defaults sql-server=<name>.

--resource-group -g

Name of resource group. You can configure the default group using az configure --defaults group=<name>.

--subscription

Name or ID of subscription. You can configure the default subscription using az account set -s NAME_OR_ID.

--timeout

Maximum wait in seconds.

Default value: 3600
--updated

Wait until updated with provisioningState at 'Succeeded'.

Default value: False
Global Parameters
--debug

Increase logging verbosity to show all debug logs.

--help -h

Show this help message and exit.

--only-show-errors

Only show errors, suppressing warnings.

--output -o

Output format.

Accepted values: json, jsonc, none, table, tsv, yaml, yamlc
Default value: json
--query

JMESPath query string. See http://jmespath.org/ for more information and examples.

--subscription

Name or ID of subscription. You can configure the default subscription using az account set -s NAME_OR_ID.

--verbose

Increase logging verbosity. Use --debug for full debug logs.