Azure-sdk-for-go: Can't create App Insights workbook

Created on 7 Jan 2021  路  3Comments  路  Source: Azure/azure-sdk-for-go

Bug Report

  • import path of package ../services/appinsights/mgmt/2015-05-01/insights/
  • SDK version v46.1.0
  • go version go1.15.6 darwin/amd64
  • What happened?
    While trying to create an AppInsihgts Workbook with the CreateOrUpdate method I had the following error.
Original Error: autorest/azure: Service returned an error. Status=400 Code="NoRegisteredProviderFound" Message="No registered resource provider found for location 'westeurope' and API version '2015-05-01' for type 'workbooks'. The supported api-versions are '2018-06-01-preview, 2018-06-17-preview, 2020-02-12, 2020-10-20'. The supported locations are ', westeurope, southcentralus, eastus, northeurope, southeastasia, westus2, japaneast, australiaeast, koreacentral, francecentral, centralus, eastus2, eastasia, westus, canadacentral, centralindia, uksouth, ukwest, southafricanorth, northcentralus, brazilsouth, switzerlandnorth, norwayeast, australiasoutheast'."

What I understand is that API Version 2015-05-01 is not supported for appinsights workbook creation. But it is hardcoded in the SDK.
https://github.com/Azure/azure-sdk-for-go/blob/70d0f828426dae2b24a242cf5ff7e77eca046212/services/appinsights/mgmt/2015-05-01/insights/workbooks.go#L109

  • What did you expect or want to happen?

I want to be able to create a workbook with the go SDK.

  • How can we reproduce it?

Just try creating a workbook with SDK, e.g

package main

import (
    "context"
    "github.com/Azure/azure-sdk-for-go/profiles/latest/appinsights/mgmt/insights"
    "github.com/Azure/go-autorest/autorest/azure/auth"
    "log"
)

func main() {
    wClient := insights.NewWorkbooksClient("<sub-id>")
    authorizer, err := auth.NewAuthorizerFromCLI()
    if err == nil {
        wClient.Authorizer = authorizer
    }

    workbookname := "test"
    location := "westeurope"

    parameters := insights.Workbook{
        Kind:               "shared", // "user" workbook will be deprecated early 2021 so forcing shared here https://github.com/microsoft/Application-Insights-Workbooks/blob/master/Documentation/DataSources/PrivateWorkbooksDeprecation.md
        WorkbookProperties: nil,
        Name:               &workbookname,
        Location:           &location,
        Tags:               nil,
    }

    workbook, err := wClient.CreateOrUpdate(context.Background(), "rg", "test", parameters)
    if err != nil {
        log.Print(err)
    }
    log.Print(workbook)
}
  • Anything we should know about your environment.
    馃し
Monitor - ApplicationInsights Service Attention customer-reported question

Most helpful comment

Bump - last activity seems to be 4 months ago

All 3 comments

Hi @Tirke thanks for opening this issue!

Regarding the api-version issue, we do have a lot of other api-versions for appinsights, but the appinsights team did not release them in go SDK (taking compute as an example here, you can see a lot of api-versions here: https://github.com/Azure/azure-sdk-for-go/tree/master/services/compute/mgmt).
And also, if an API is not acceptable by the service, that API should not be in the swagger, this is a swagger issue, I will tag this issue and the corresponding service team might take it a look.
For the new packages, I will take some time to notify the service team to release their new api-versions.

Thanks for the feedback! We are routing this to the appropriate team for follow-up. cc @azmonapplicationinsights.


Issue Details

Bug Report

  • import path of package ../services/appinsights/mgmt/2015-05-01/insights/
  • SDK version v46.1.0
  • go version go1.15.6 darwin/amd64
  • What happened?
    While trying to create an AppInsihgts Workbook with the CreateOrUpdate method I had the following error.
Original Error: autorest/azure: Service returned an error. Status=400 Code="NoRegisteredProviderFound" Message="No registered resource provider found for location 'westeurope' and API version '2015-05-01' for type 'workbooks'. The supported api-versions are '2018-06-01-preview, 2018-06-17-preview, 2020-02-12, 2020-10-20'. The supported locations are ', westeurope, southcentralus, eastus, northeurope, southeastasia, westus2, japaneast, australiaeast, koreacentral, francecentral, centralus, eastus2, eastasia, westus, canadacentral, centralindia, uksouth, ukwest, southafricanorth, northcentralus, brazilsouth, switzerlandnorth, norwayeast, australiasoutheast'."

What I understand is that API Version 2015-05-01 is not supported for appinsights workbook creation. But it is hardcoded in the SDK.
https://github.com/Azure/azure-sdk-for-go/blob/70d0f828426dae2b24a242cf5ff7e77eca046212/services/appinsights/mgmt/2015-05-01/insights/workbooks.go#L109

  • What did you expect or want to happen?

I want to be able to create a workbook with the go SDK.

  • How can we reproduce it?

Just try creating a workbook with SDK, e.g

package main

import (
    "context"
    "github.com/Azure/azure-sdk-for-go/profiles/latest/appinsights/mgmt/insights"
    "github.com/Azure/go-autorest/autorest/azure/auth"
    "log"
)

func main() {
    wClient := insights.NewWorkbooksClient("<sub-id>")
    authorizer, err := auth.NewAuthorizerFromCLI()
    if err == nil {
        wClient.Authorizer = authorizer
    }

    workbookname := "test"
    location := "westeurope"

    parameters := insights.Workbook{
        Kind:               "shared", // "user" workbook will be deprecated early 2021 so forcing shared here https://github.com/microsoft/Application-Insights-Workbooks/blob/master/Documentation/DataSources/PrivateWorkbooksDeprecation.md
        WorkbookProperties: nil,
        Name:               &workbookname,
        Location:           &location,
        Tags:               nil,
    }

    workbook, err := wClient.CreateOrUpdate(context.Background(), "rg", "test", parameters)
    if err != nil {
        log.Print(err)
    }
    log.Print(workbook)
}
  • Anything we should know about your environment.
    馃し
Author: Tirke
Assignees: -
Labels: `Monitor - ApplicationInsights`, `Service Attention`, `customer-reported`, `needs-triage`, `question`
Milestone: -

Bump - last activity seems to be 4 months ago

Was this page helpful?
0 / 5 - 0 ratings