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

mysterious-australia-14256

07/17/2023, 7:40 PM
I am trying to use V2 of Azure Native to run up an Azure API Management instance but am struggling to define the Protocols in the ApiArgs. The code I have is similar to the below (stripped back to just show the relevant bits)
Copy code
var protocols = new Pulumi.InputList<APIM.Protocol>();
            protocols.Add(APIM.Protocol.Https);
            protocols.Add(APIM.Protocol.Http);

            var apiArgs = new APIM.ApiArgs
            {
                Protocols = protocols
			,
            };
The error I get with this is Cannot implicitly convert type 'Pulumi.InputList<Pulumi.AzureNative.ApiManagement.Protocol>' to 'Pulumi.InputList<Pulumi.Union<string, Pulumi.AzureNative.ApiManagement.Protocol>>' The docs site just shows setting
Copy code
Protocols = new[]
        {
            "https",
            "http",
        }
But that also fails for me with a similar error Cannot implicitly convert type string[] to 'Pulumi.InputList<Pulumi.Union<string, Pulumi.AzureNative.ApiManagement.Protocol>>' Can someone let me know the correct syntax for this? Cheers Alan