public static void AssertProfileUpdate(Profile updatedProfile, ProfileUpdateOptions updateOptions) { Assert.AreEqual(updatedProfile.Data.Tags.Count, updateOptions.Tags.Count); foreach (var kv in updatedProfile.Data.Tags) { Assert.True(updateOptions.Tags.ContainsKey(kv.Key)); Assert.AreEqual(kv.Value, updateOptions.Tags[kv.Key]); } }
public async Task Update() { Subscription subscription = await Client.GetDefaultSubscriptionAsync(); ResourceGroup rg = await CreateResourceGroup(subscription, "testRg-"); string afdProfileName = Recording.GenerateAssetName("AFDProfile-"); Profile afdProfile = await CreateAfdProfile(rg, afdProfileName, SkuName.StandardAzureFrontDoor); ProfileUpdateOptions updateOptions = new ProfileUpdateOptions(); updateOptions.Tags.Add("newTag", "newValue"); var lro = await afdProfile.UpdateAsync(true, updateOptions); Profile updatedAfdProfile = lro.Value; ResourceDataHelper.AssertProfileUpdate(updatedAfdProfile, updateOptions); }
public async Task Update() { Subscription subscription = await Client.GetDefaultSubscriptionAsync(); ResourceGroup rg = await CreateResourceGroup(subscription, "testRg-"); string cdnProfileName = Recording.GenerateAssetName("profile-"); Profile cdnProfile = await CreateCdnProfile(rg, cdnProfileName, SkuName.StandardAkamai); ProfileUpdateOptions updateOptions = new ProfileUpdateOptions(); updateOptions.Tags.Add("newTag", "newValue"); var lro = await cdnProfile.UpdateAsync(updateOptions); Profile updatedCdnProfile = lro.Value; ResourceDataHelper.AssertProfileUpdate(updatedCdnProfile, updateOptions); }