Hi I'm trying to find resources on Microsoft.Machi...
# azure
b
Hi I'm trying to find resources on Microsoft.MachineLearningServices/workspaces@2024-04-01
a
The
2023-04-01
api is the one currently pinned as default for `pulumi-azure-native`'s machinelearningservices.Workspace but the
2024-01-01
version is also being generated. See here how you can import a specific version in Python, TS, Go or C#: https://gist.github.com/olafurnielsen/a25085a4d4b9d4d1c23b3ffd125b5f04 Unfortunately the provider documentation is only generated for the pinned version so sometimes you'll have to navigate to the reference of the library class to look up parameters and look at their docstring.
b
Sweet thanks for the info!
@adventurous-butcher-54166 I keep getting
Copy code
The type name 'v20240401' does not exist in the type 'Workspace'
I've tried using it on my using statement and inline with C#?
a
Can you please share the import line?
And what version of the pulumi-azure-native package are you using?
b
Copy code
using System.Threading.Tasks;
using Pulumi;
using Pulumi.AzureNative.Resources;
using Pulumi.AzureNative.MachineLearningServices.Workspace.v20240401;
using Pulumi.AzureNative.MachineLearningServices.Inputs;


return await Pulumi.Deployment.RunAsync(() =>
{
    var resourceGroup = new ResourceGroup("resourceGroup");


     var workspace = new Workspace("exampleWorkspace", new WorkspaceArgs
        {
            ResourceGroupName = resourceGroup.Name,
            Location = resourceGroup.Location,
            Sku = new SkuArgs
            {
                Name = "Basic" // Modify as per your needs
            },
            Tags = 
            {
                { "environment", "test" }
            },
            
        });
});
That's my full script
Copy code
<PackageReference Include="Pulumi" Version="3.*" />
    <PackageReference Include="Pulumi.AzureNative" Version="2.*" />
2.* it looks like
Also curious on how preview versions work is it v#s-preview? @adventurous-butcher-54166
a
Could the version module be case-sensitive? V20240401 (capital V)
b
@adventurous-butcher-54166
Copy code
.../quickstart/Program.cs(4,60): error CS0426: The type name 'V20240401' does not exist in the type 'Workspace' [.../quickstart/ai-model.csproj]
    Build FAILED.
No dice on capital
Looks like
Copy code
Pulumi.AzureNative.MachineLearningServices.V20240401
Works?
a
How about?
using Pulumi.AzureNative.MachineLearningServices.V20240401;
b
Yeah that works
Copy code
error CS0029: Cannot implicitly convert type 'Pulumi.AzureNative.MachineLearningServices.Inputs.SkuArgs' to 'Pulumi.Input<Pulumi.AzureNative.MachineLearningServices.V20240401.Inputs.SkuArgs>'
Which is not, not found it's a sku is wrong or wrong format
a
You should probably remove
using Pulumi.AzureNative.MachineLearningServices.Inputs;
b
Okay, I think I got that from Pulumi ai lol I'm a noob sorry
a
inputs are also part of each module as those are different between API versions