white-london-35720
11/07/2023, 10:11 PMpolicy
in Azure with Pulumi.
I have imported the ApiManagement api azure-native:apimanagement:Api
but when I try to overwrite the policy in my pulumi program I get an error:
Type Name Status Info
pulumi:pulumi:Stack MyService.deploy-dev **failed** 1 error
~ ├─ kubernetes:apps/v1:Deployment MyService updated (4s) [diff: ~spec]
~ ├─ kubernetes:apps/v1:Deployment MyService-servicebus updated (4s) [diff: ~spec]
+ ├─ azure-native:apimanagement:ApiPolicy apiPolicy **creating failed** 1 error
~ └─ azure-native:apimanagement:Api MyService updated (12s) [diff: ~value]
Diagnostics:
pulumi:pulumi:Stack (c4sservice.deploy-dev):
error: update failed
azure-native:apimanagement:ApiPolicy (apiPolicy):
error: autorest/azure: error response cannot be parsed: {"" '\x00' '\x00'} error: EOF
Resources:
~ 3 updated
14 unchanged
Here is the policy I want pulumi to use:
var policy =
$@"<policies>
<inbound>
<set-header name='Authorization' exists-action='override'>
<value>{apiManagementServiceValue}</value>
</set-header>
<base />
</inbound>
<backend>
<base />
</backend>
<outbound>
<base />
</outbound>
<on-error>
<base />
</on-error>
</policies>";
//Policy
var apiPolicy = new ApiPolicy("apiPolicy", new()
{
ApiId = MyServiceApi.Id,
Format = PolicyContentFormat.Xml,
PolicyId = "policy",
ResourceGroupName = apiManagementResourceGroupName,
ServiceName = apiManagementService,
Value = policy
}, new()
{
Provider = ElkAzureResourceProviders.GetProvider(),
Protect = true,
DependsOn = MyServiceApi
});
Pulumi plugin:
azure-native version 2.3.0
Does anyone have an idea why this is not working?
Thanks!bored-activity-40468
11/08/2023, 4:36 AM<value>{{apiManagementServiceValue}}</value>
work?white-london-35720
11/09/2023, 8:33 AM