limited-carpenter-34991
06/22/2020, 9:10 AMvar backend = new Backend(namePlaceHolder, new BackendArgs
{
ApiManagementName = apiManagement.Name,
ResourceGroupName = resourceGroup,
Protocol = "http",
Url = Output.Format($"https://{app.DefaultHostname}/api")
});
Output<string> backendId = backend.Name.Apply(id => id);
var backendIdParameter = Output.Format(@$"""{backendId}""");
var apiPolicy = new ApiPolicy($"{namePlaceHolderWithoutSpecialCharacter}", new ApiPolicyArgs
{
ApiManagementName = apiManagement.Name,
ResourceGroupName = resourceGroup,
ApiName = api.Name,
XmlContent = $@"
<policies>
<inbound>
<base/>
<set-backend-service id="4711" backend-id={backendIdParameter} />
</inbound>
<backend>
<base/>
</backend>
<outbound>
<base/>
</outbound>
<on-error>
<base/>
</on-error>
</policies>",});
Every time the xmlContent is filled inside the backend-id with "Pulum.Output<string>" and not the string value.
What i have to do to get the value inside this xmlContent?tall-librarian-49374
06/22/2020, 9:44 AMbackendIdParameter
is an output, so you can’t use it inside string formatting directly. You should use Output.Format
to define that xml string.limited-carpenter-34991
06/22/2020, 10:00 AM