Closed ankkp closed 7 months ago
@ankkp Thanks for your feedback! We will investigate and update as appropriate.
@dbradish-microsoft Could you please review it.
@ankkp, @TPavanBalaji It looks to me like there is a quoting difference between Bash and PowerShell environments. Please take a look at these three docs, one of which is dedicated to az rest
.
Script example if you are executing Azure CLI in Bash:
az rest --method patch \
--url https://management.azure.com/subscriptions/<mySubscriptionID>/resourceGroups/<myResourceGroup>/providers/Microsoft.HybridCompute/machines/<machineName>?api-version=yyyy-mm-dd-preview \
--resource https://management.azure.com/ \
--headers Content-Type=application/json \
--body '{"properties": {"agentUpgrade": {"enableAutomaticUpgrade": false}}}'
Script example if you are executing Azure CLI in PowerShell:
az rest --method patch `
--url https://management.azure.com/subscriptions/<mySubscriptionID>/resourceGroups/<myResourceGroup>/providers/Microsoft.HybridCompute/machines/<machineName>?api-version=yyyy-mm-dd-preview `
--resource https://management.azure.com/ `
--headers Content-Type=application/json `
--body '{\"properties\": {\"agentUpgrade\": {\"enableAutomaticUpgrade\": false}}}'
[Enter feedback here]
below is in doc and it is wrong
az rest --method Put --uri /subscriptions/00000000-1111-2222-3333-444444444444/resourceGroups/vulnerabilityaseessmenttestRg/providers/Microsoft.Sql/servers/vulnerabilityaseessmenttest/sqlVulnerabilityAssessments/default?api-version=2022-02-01-preview --body '{ \"properties\": { \"state\": \"Disabled\" }}'
It should be like below.
az rest --method Put --uri /subscriptions/00000000-1111-2222-3333-444444444444/resourceGroups/vulnerabilityaseessmenttestRg/providers/Microsoft.Sql/servers/vulnerabilityaseessmenttest/sqlVulnerabilityAssessments/default?api-version=2022-02-01-preview --body '{ "properties": { "state": "Disabled" }}'
same need to be updated for enabling example
Document Details
⚠ Do not edit this section. It is required for learn.microsoft.com ➟ GitHub issue linking.