-
Notifications
You must be signed in to change notification settings - Fork 31
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Updating Apim operation policy leads to no changes #3202
Comments
@vdboots I've just re-created and run your example given above, filling in the missing resources: using Pulumi;
using Pulumi.AzureNative.Resources;
using System.Collections.Generic;
using Pulumi.AzureNative.ApiManagement;
using Pulumi.AzureNative.ApiManagement.Inputs;
return await Pulumi.Deployment.RunAsync(() =>
{
var resourceGroup = new ResourceGroup("resourceGroup", new ResourceGroupArgs
{
Location = "EastUS"
});
var ams = new ApiManagementService("apim", new ApiManagementServiceArgs
{
ResourceGroupName = resourceGroup.Name,
Location = resourceGroup.Location,
PublisherEmail = "test@pulumi.com",
PublisherName = "Pulumi",
Sku = new ApiManagementServiceSkuPropertiesArgs
{
Capacity = 0,
Name = "Consumption",
},
});
var api = new Api("api", new ApiArgs
{
ResourceGroupName = resourceGroup.Name,
ServiceName = ams.Name,
DisplayName = "My API",
Path = "myapi",
SubscriptionRequired = true,
Protocols = new List<Union<string, Protocol>> { Protocol.Https },
});
var apiOperation = new ApiOperation("operation", new ApiOperationArgs
{
ResourceGroupName = resourceGroup.Name,
ServiceName = ams.Name,
ApiId = api.Name,
DisplayName = "My Operation",
Method = "GET",
UrlTemplate = "operation",
});
var xml = @"
<policies>
<inbound>
</inbound>
<backend>
<base />
</backend>
<outbound>
<base />
</outbound>
<on-error>
<base />
</on-error>
</policies>";
var policy = new ApiOperationPolicy($"policy", new ApiOperationPolicyArgs
{
ResourceGroupName = resourceGroup.Name,
ServiceName = ams.Name,
ApiId = api.Name,
OperationId = apiOperation.Name,
Value = xml,
Format = "xml",
}, new CustomResourceOptions() { ReplaceOnChanges = { "*" }, DeleteBeforeReplace = true });
}); The initial deployment completes correctly, and making a minor change to the XML (e.g. replace
Removing the additional resource options and updating the XML also works for me without error:
Please elaborate on how to recreate the error you're seeing. |
will try it out tommorew it told me the same. But the policy didn't update on azure itself. |
@danielrbradley Have you checked if the change was applied on Azure, given the last comment from @vdboots ? |
@mikhailshilkov Yes, my change was applied in the Azure portal ... I added the following rules to the <base />
<find-and-replace from="xyz" to="abc" /> What's the change you're actually applying to the policy value @vdboots ? |
@danielrbradley On a different machine I tried the same as @vdboots NAME VERSION Initial deployment went well. Resources: This is exact the same behaviour as vdboots mentioned. |
What happened?
when updating an api operation policy with plumi and the policy does not exist this runs well. but when It already exists the policy won't be updated.
Example
Output of plumi after deploying making a change in the xml and deploying again:
Output of
pulumi about
NAME VERSION
Pulumi 3.60.0
Pulumi.AzureNative 2.35.0
Additional context
When this is deployed and you make a change to the XML and deploy it again. The change won't be committed
The text was updated successfully, but these errors were encountered: