Skip to content

Commit ea079be

Browse files
authored
Update disable-local-authentication.md
1 parent 0a12584 commit ea079be

File tree

1 file changed

+18
-18
lines changed

1 file changed

+18
-18
lines changed

articles/automation/disable-local-authentication.md

Lines changed: 18 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -25,24 +25,24 @@ In the Azure portal, you may receive a warning message on the landing page for t
2525
Disabling local authentication doesn't take effect immediately. Allow a few minutes for the service to block future authentication requests.
2626

2727
>[!NOTE]
28-
> - Currently, PowerShell support for the new API version (2021-06-22) or the flag – `DisableLocalAuth` is not available. However, you can use the Rest-API with this API version to update the flag. Here is how to do it with the [`Invoke-AzRestMethod`](https://learn.microsoft.com/powershell/azure/manage-azure-resources-invoke-azrestmethod) cmdlet.
29-
30-
```azurepowershell-interactive
31-
$SubscriptionId = "your-subscription-id"
32-
$ResourceGroupName = "your-resource-group-name"
33-
$AutomationAccountName = "your-automation-account-name"
34-
$RequestUri = "https://management.azure.com/subscriptions/$SubscriptionId/resourceGroups/$ResourceGroupName/providers/Microsoft.Automation/automationAccounts/$($AutomationAccountName)?api-version=2023-11-01"
35-
$Payload = @{
36-
properties = @{
37-
disableLocalAuth = $true
38-
}
39-
} | ConvertTo-Json
40-
Invoke-AzRest -Method Patch -Uri $RequestUri -Payload $Payload
41-
42-
# Verify
43-
$AutomationAccount = (Invoke-AzRest -Method Get -Uri $RequestUri).Content | ConvertFrom-Json
44-
"disableLocalAuth = $($AutomationAccount.properties.disableLocalAuth)"
45-
```
28+
> - Currently, PowerShell support for the new API version (2021-06-22) or the flag – `DisableLocalAuth` is not available. However, you can use the REST-API with this API version to update the flag. Here is how to do it with the [`Invoke-AzRestMethod`](/powershell/azure/manage-azure-resources-invoke-azrestmethod) cmdlet.
29+
>
30+
> ```azurepowershell-interactive
31+
> $SubscriptionId = "your-subscription-id"
32+
> $ResourceGroupName = "your-resource-group-name"
33+
> $AutomationAccountName = "your-automation-account-name"
34+
> $RequestUri = "https://management.azure.com/subscriptions/$SubscriptionId/resourceGroups/$ResourceGroupName/providers/Microsoft.Automation/automationAccounts/$($AutomationAccountName)?api-version=2023-11-01"
35+
> $Payload = @{
36+
> properties = @{
37+
> disableLocalAuth = $true
38+
> }
39+
> } | ConvertTo-Json
40+
> Invoke-AzRest -Method Patch -Uri $RequestUri -Payload $Payload
41+
>
42+
> # Verify
43+
> $AutomationAccount = (Invoke-AzRest -Method Get -Uri $RequestUri).Content | ConvertFrom-Json
44+
> "disableLocalAuth = $($AutomationAccount.properties.disableLocalAuth)"
45+
> ```
4646
4747
## Re-enable local authentication
4848

0 commit comments

Comments
 (0)