https://pulumi.com logo
#azure
Title
a

adorable-pilot-23972

07/05/2023, 7:37 AM
This is the error I get when deploying my resources:
Copy code
error: autorest/azure: Service returned an error. Status=400 Code="BadRequest" Message="WorkspaceResourceId is not in valid format" InnerError={"trace":["System.ArgumentException"]}
b

blue-midnight-76846

07/06/2023, 9:39 AM
👋 I did face issues while trying to do the same as you are doing and I ended using the `@pulumi/azure-native/insights/v20200202`version using JS/TS. In that API version, the support for adding a workspace is there. Here is an example of what I’m doing:
Copy code
new Component(
    `${name}-app-insights-component`,
    {
      applicationType: type ?? DEFAULT_APPLICATION_TYPE,
      flowType: FlowType.Bluefield,
      kind: kind ?? DEFAULT_KIND,
      resourceGroupName: resourceGroup,
      resourceName: `${name}-logs`,
      ingestionMode: mode ?? DEFAULT_INGESTION_MODE,
      workspaceResourceId:
        workspaceId ||
        createLogAnalyticWorkspace({ name, resourceGroup, resourceOptions: resourceOptions?.workspace }, tags).id,
      tags,
    },
    resourceOptions?.component
  );
a

adorable-pilot-23972

07/06/2023, 2:50 PM
All the resources in C# have the latest version in the "regular" namespace. This is the first one that has the versioned namespace as the latest version. I was a little confused. But after trying a bunch I learned the right namespace. Thanks for sharing the info here!