Skip to content

Commit

Permalink
Switch back to CLI
Browse files Browse the repository at this point in the history
  • Loading branch information
plzm committed Apr 25, 2024
1 parent 2d147e5 commit 0427e52
Showing 1 changed file with 12 additions and 6 deletions.
18 changes: 12 additions & 6 deletions scripts/AzureMonitor.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -895,12 +895,18 @@ function Test-ResourceTypeSupportsDiagnosticsSettings()
$apiVersion = "2021-05-01-preview"
$mgmtApiUri = "https://management.azure.com" + $ResourceId + "/providers/Microsoft.Insights/diagnosticSettings?api-version=$apiVersion"
Write-Debug -Debug:$true -Message "mgmtApiUri = $mgmtApiUri"
$statusCode = (Invoke-AzRestMethod -Uri $mgmtApiUri).StatusCode
Write-Debug -Debug:$true -Message "statusCode = $statusCode"
if ($statusCode -eq 200)
{
$result = $true
}

$settings = az rest --uri $mgmtApiUri 2>nul | ConvertFrom-Json

if ($settings) { $result = $true }
#$statusCode = (Invoke-AzRestMethod -Uri $mgmtApiUri).StatusCode

#Write-Debug -Debug:$true -Message "statusCode = $statusCode"
#if ($statusCode -eq 200)
#{
# $result = $true
#}

Write-Debug -Debug:$true -Message "result = $result"

return $result
Expand Down

0 comments on commit 0427e52

Please sign in to comment.