https://pulumi.com logo
Title
a

average-nightfall-8153

02/10/2023, 2:43 PM
I am getting following error using Pulumi GitHub action v3 (v3.54.0):
azure-native:storage:BlobServiceProperties (euslstcontentbea37blobcorsrules):
562
      error: autorest/azure: Service returned an error. Status=400 Code="ContainerOperationFailure" Message="The value for one of the XML nodes is not in the correct format.\nRequestId:ca46ec38-701e-001a-645c-3d4f4a000000\nTime:2023-02-10T14:34:28.1856704Z"
Is this a know issue?
b

billowy-army-68599

02/10/2023, 2:43 PM
This doesn’t look like an an action issue? Do you not get this issue locally?
a

average-nightfall-8153

02/10/2023, 3:15 PM
running self-hosted runner - ubuntu
not getting it when running locally
b

billowy-army-68599

02/10/2023, 3:20 PM
are you setting CORS, or trying to set it?
a

average-nightfall-8153

02/10/2023, 3:22 PM
Yes, setting CORS on blob service
b

billowy-army-68599

02/10/2023, 3:24 PM
Can you share your code?
a

average-nightfall-8153

02/10/2023, 3:25 PM
public static BlobServiceProperties AddBlobCorsRules(this StorageAccount account,
        GetResourceGroupResult resourceGroup,
        string propertiesName)
    {
        InputList<string> allowedOrigins = new InputList<string>();

        if (DeploymentEnvironment.IsDebug)
        {
            allowedOrigins = new[] {"*"};
        }
        else if (DeploymentEnvironment.IsStaging)
        {
            allowedOrigins = new[] { TrafficManagerCommonInfo.DevHostName, TrafficManagerCommonInfo.StagingHostName };
            allowedOrigins.AddRange(TrafficManagerCommonInfo.PullRequestTrafficManagerInfoList.Select(e => e.Fqdn).ToArray());
        }
        else if (DeploymentEnvironment.IsProduction)
        {
            allowedOrigins = new[] { TrafficManagerCommonInfo.ProductionHostName };
        }
        
        var properties = new BlobServiceProperties(propertiesName, new BlobServicePropertiesArgs
        {
            AccountName = account.Name,
            ResourceGroupName = resourceGroup.Name,
            BlobServicesName = "default",
            Cors = new CorsRulesArgs
            {
                CorsRules = new[]
                {
                    new CorsRuleArgs
                    {
                        AllowedHeaders = new[]
                        {
                            "*"
                        },
                        AllowedMethods = new[]
                        {
                            "GET", "POST", "PATCH"
                        },
                        AllowedOrigins = allowedOrigins,
                        ExposedHeaders = new[]
                        {
                            "*"
                        },
                        MaxAgeInSeconds = 3000
                    }
                }
            }
        });

        return properties;
    }
using Pulumi.Azure 5.13.0 and Pulumi.AzureNative 1.66.0
b

billowy-army-68599

02/10/2023, 3:59 PM
It’s not totally clear, but I suspect the issue is in your allowedOrigins, I’d start by checking that and eliminating it as a possibility
but the issues you’re getting isn’t related to actions, it’s because your cors settings aren’t correvt
a

average-nightfall-8153

02/10/2023, 4:27 PM
I believe you are right. The property is not being set when running on runner.
Yep, that was the issue. Thanks for helping out.