public async Task FileServiceCorsTest()
        {
            // Create resource group
            var rgName = await CreateResourceGroupAsync();

            string accountName = Recording.GenerateAssetName("sto");

            // Create storage account
            StorageAccount account = await CreateStorageAccountAsync(rgName, accountName);

            VerifyAccountProperties(account, true);

            // implement case
            Response <FileServiceProperties> properties1 = await FileServicesClient.GetServicePropertiesAsync(rgName, accountName);

            Assert.AreEqual(0, properties1.Value.Cors.CorsRulesValue.Count());

            properties1.Value.Cors = new CorsRules
            {
                CorsRulesValue =
                {
                    new CorsRule(allowedOrigins: new string[]                     { "http://www.contoso.com", "http://www.fabrikam.com"    },
                                 allowedMethods: new CorsRuleAllowedMethodsItem[] { "GET",                    "HEAD", "POST", "OPTIONS", "MERGE", "PUT"},
                                 maxAgeInSeconds: 100,
                                 exposedHeaders: new string[]                     { "x-ms-meta-*" },
                                 allowedHeaders: new string[]                     { "x-ms-meta-abc",          "x-ms-meta-data*", "x-ms-meta-target*"}),

                    new CorsRule(allowedOrigins: new string[]                     { "*" },
                                 allowedMethods: new CorsRuleAllowedMethodsItem[] { "GET" },
                                 maxAgeInSeconds: 2,
                                 exposedHeaders: new string[]                     { "*" },
                                 allowedHeaders: new string[]                     { "*" }),

                    new CorsRule(allowedOrigins: new string[]                     { "http://www.abc23.com",   "https://www.fabrikam.com/*" },
                                 allowedMethods: new CorsRuleAllowedMethodsItem[] { "GET",                    "PUT", "CONNECT"             },
                                 maxAgeInSeconds: 2000,
                                 exposedHeaders: new string[]                     { "x-ms-meta-abc",          "x-ms-meta-data*", "x -ms-meta-target*"},
                                 allowedHeaders: new string[]                     { "x-ms-meta-12345675754564*" })
                }
            };

            Response <FileServiceProperties> properties3 = await FileServicesClient.SetServicePropertiesAsync(rgName, accountName, properties1.Value);

            //Validate CORS Rules
            Assert.AreEqual(properties1.Value.Cors.CorsRulesValue.Count, properties3.Value.Cors.CorsRulesValue.Count);
            for (int i = 0; i < properties1.Value.Cors.CorsRulesValue.Count; i++)
            {
                CorsRule putRule = properties1.Value.Cors.CorsRulesValue[i];
                CorsRule getRule = properties3.Value.Cors.CorsRulesValue[i];

                Assert.AreEqual(putRule.AllowedHeaders, getRule.AllowedHeaders);
                Assert.AreEqual(putRule.AllowedMethods, getRule.AllowedMethods);
                Assert.AreEqual(putRule.AllowedOrigins, getRule.AllowedOrigins);
                Assert.AreEqual(putRule.ExposedHeaders, getRule.ExposedHeaders);
                Assert.AreEqual(putRule.MaxAgeInSeconds, getRule.MaxAgeInSeconds);
            }

            Response <FileServiceProperties> properties4 = await FileServicesClient.GetServicePropertiesAsync(rgName, accountName);

            //Validate CORS Rules
            Assert.AreEqual(properties1.Value.Cors.CorsRulesValue.Count, properties4.Value.Cors.CorsRulesValue.Count);
            for (int i = 0; i < properties1.Value.Cors.CorsRulesValue.Count; i++)
            {
                CorsRule putRule = properties1.Value.Cors.CorsRulesValue[i];
                CorsRule getRule = properties4.Value.Cors.CorsRulesValue[i];

                Assert.AreEqual(putRule.AllowedHeaders, getRule.AllowedHeaders);
                Assert.AreEqual(putRule.AllowedMethods, getRule.AllowedMethods);
                Assert.AreEqual(putRule.AllowedOrigins, getRule.AllowedOrigins);
                Assert.AreEqual(putRule.ExposedHeaders, getRule.ExposedHeaders);
                Assert.AreEqual(putRule.MaxAgeInSeconds, getRule.MaxAgeInSeconds);
            }
        }