0

This is the sample code provided in pulumi documentation however this does throw an compilation error. https://www.pulumi.com/registry/packages/azure-native/api-docs/apimanagement/backend/

compilation error in local

Please let me know any idea to resolve or help me to provide a sample code through which i can create a Backend resource in APIM which can connect to the Named value in Headers.

Sample Backend Resource in Azure APIM through GUI

Refer to this picture about my comment of adding the named value in the Headers

Amaresh
  • 31
  • 3

1 Answers1

0

The example are automatically generated and it looks like the generator didn't handle the type initialization correctly. Here is one way to fix it (replace the relevant lines):

Header = 
{
    {
        "x-my-1", new[] { "val1", "val2" }.ToImmutableArray()
    },
},
Query = 
{
    {
        "sv", new[] { "xx", "bb", "cc" }.ToImmutableArray()
    },
},
Mikhail Shilkov
  • 34,128
  • 3
  • 68
  • 107
  • Hi @Mikhail Thanks, this did work. This will attach the Manual value in the Headers. If i want to attach the Named Value , can you please share a sample of code. Uploaded the picture in the main description for reference. – Amaresh Dec 01 '21 at 04:58
  • Sorry I'm not too deep on that part of API management. Isn't that what https://www.pulumi.com/registry/packages/azure-native/api-docs/apimanagement/namedvalue/ is for? – Mikhail Shilkov Dec 02 '21 at 01:48
  • No worries @Mikhail. The link that you shared is for creating the Named Value. And that named value can be used in the Header of the Backend. Trying to find a sample piece of code. However your code snippet did helped a lot. Thanks again. – Amaresh Dec 02 '21 at 03:35