Open sdg002 opened 2 years ago
Thanks for reporting. This is due to API version of DiagnosticSetting is too old. We plan to upgrade its API version in upcoming month.
@dingmeng-xue Thanks for looking into this. In the mean time, does MSFT have an alternative approach to set/query the Diagnostic information programmatically (IAC) ?
Please use below code and send request with specific API version directly
Invoke-AzRestMethod https://management.azure.com/subscriptions/635a2074-cc31-43ac-bebe-2bcd67e1abfe/resourceGroups/rg-demo-automation-account/providers/Microsoft.Automation/automationAccounts/sauautomationaccount001/providers/Microsoft.Insights/diagnosticSettings?api-version=2021-05-01-preview
@dingmeng-xue
Thanks for reporting. This is due to API version of DiagnosticSetting is too old. We plan to upgrade its API version in upcoming month.
That month can't come soon enough 🤣, still facing this issue. Any timeframe for a fix?
@Kaloszer - looks like this was fixed in v9.0.1.
[Breaking Change] Upgraded API version for DiagnosticSetting from 2017-05-01-preview to 2021-05-01-preview
Cool! I don't think it's implemented in the current version of ADO yaml inline powershell core pipelines then yet as I was looking at the same issue on Friday, just went with the azrestmethod method to work around the issue.
I think the recommended method for Azure PowerShell on ADO pipelines is AzurePowerShell@5
which has the preferredAzurePowerShellVersion
property, but for some reason, docs list that as only supporting 1.0.0, 1.6.0, 2.3.2, 2.6.0, and 3.1.0
with the latest being released in 26/11/2019 . So either docs or module support are v outdated. ref: https://learn.microsoft.com/en-us/azure/devops/pipelines/tasks/reference/azure-powershell-v5?view=azure-pipelines
I think the recommended method for Azure PowerShell on ADO pipelines is
AzurePowerShell@5
which has thepreferredAzurePowerShellVersion
property, but for some reason, docs list that as only supporting1.0.0, 1.6.0, 2.3.2, 2.6.0, and 3.1.0
with the latest being released in 26/11/2019 . So either docs or module support are v outdated. ref: https://learn.microsoft.com/en-us/azure/devops/pipelines/tasks/reference/azure-powershell-v5?view=azure-pipelines
It's actually just outdated, I'm using azurePowerShellVersion: LatestVersion
In the pipeline so...
Description
Steps for reproducing
PowerShell command to retrieve the diagnostic setting
Did I try using the Azure CLI?
Yes. It comes up empty
Environment data
Module versions
Error output