Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Microsoft.OperationalInsights/workspaces/linkedServices - Api versions must be the latest or under 2 years old (730 days) #701

Closed
drewkg opened this issue Oct 6, 2022 · 2 comments · Fixed by #709
Assignees
Labels
bug Something isn't working

Comments

@drewkg
Copy link

drewkg commented Oct 6, 2022

Using this resource definition in ARM

{
  "name": "[variables('logAnalyticsWorkSpaceName')]",
  "type": "Microsoft.OperationalInsights/workspaces",
  "apiVersion": "2022-10-01",
  "location": "[parameters('location')]",
  "properties": {
    "sku": {
      "name": "PerGB2018"
    },
    "retentionInDays": 30
  },
  "resources": [
    {
      "name": "[concat(variables('logAnalyticsWorkSpaceName'), '/' , 'Automation')]",
      "type": "Microsoft.OperationalInsights/workspaces/linkedServices",
      "apiVersion": "2020-08-01",
      "dependsOn": [
        "[variables('logAnalyticsWorkspaceName')]",
        "[variables('automationAccountName')]"
      ],
      "properties": {
        "resourceId": "[resourceId('Microsoft.Automation/automationAccounts', variables('automationAccountName'))]"
      }
    }
  ]
}

I am getting the following failed test

  [-] apiVersions Should Be Recent 67ms
    RuntimeException: Api versions must be the latest or under 2 years old (730 days) - API version 2020-08-01 of Microsoft.OperationalInsights/workspaces/linkedServices is 796 days old
    at <ScriptBlock>, C:\Users\drewk\Source Code\GitHub\drewkg\Azure\ARM-TTK\arm-ttk\Test-AzTemplate.ps1: line 481  

Checking against Azure, this is the right API Version

(Get-AzResourceProvider -ProviderNamespace Microsoft.OperationalInsights | select -expand resourceTypes | where-object{$_.resourceTypeName -eq "workspaces/linkedServices"}).apiVersions
2020-08-01
2020-03-01-preview
2019-08-01-preview
2015-11-01-preview

@ghost ghost added the Needs: triage 🔍 label Oct 6, 2022
@bmoore-msft bmoore-msft added bug Something isn't working and removed Needs: triage 🔍 labels Oct 7, 2022
@bmoore-msft
Copy link
Contributor

@StartAutomating - this is a case where the latest apiVersion is > 2 years old... since it's the latest version it should still be in the list of valid versions.

@StartAutomating
Copy link
Collaborator

@bmoore-msft I'll take a look

StartAutomating pushed a commit to StartAutomating/arm-ttk that referenced this issue Oct 21, 2022
bmoore-msft pushed a commit that referenced this issue Nov 18, 2022
* Fixing apiVersions tests.  Standardizing case (Fixes #696) and walking up references (Fixes #701)

* Adding Nested API Version Test

* Updating recency test (fixing pipelining)

* Updating test apiVersion

Co-authored-by: James Brundage <@github.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants