Hello everyone! I am currently struggling to deplo...
# python
r
Hello everyone! I am currently struggling to deploy a Rule resource for frontdoor in Azure, but I am always running into this error: error: Status=400 Code="InvalidResource" Message="Invalid @odata.type property value." I tried many different options, even deployed a rule in Azure first, and then copied it from the template into my pulumi project, but I always run into the same error. Pulumi doc to the resource: https://www.pulumi.com/registry/packages/azure-native/api-docs/cdn/rule/ This is from the Azure template:
Copy code
"actions": [
                    {
                        "name": "ModifyRequestHeader",
                        "parameters": {
                            "typeName": "DeliveryRuleHeaderActionParameters",
                            "headerAction": "Append",
                            "headerName": "X-Azure",
                            "value": "MSFT"
                        }
                    }
                ],
This is my pulumi code in python.
Copy code
def create_fd_rule(self, name, config: FrontDoorConfig):
        """"""

        return cdn.Rule(
            name,
            actions=[
                {
                    "name": "ModifyRequestHeader",
                    "parameters": {
                        "type_name": "DeliveryRuleHeaderActionParameters",
                        "header_action": "Append",
                        "header_name": "X-Azure",
                        "value": "MSFT",
                    },
                }
            ],
            order=0,
            profile_name=self.fd_profile.name,
            resource_group_name=config.resource_group.name,
            rule_name=name,
            rule_set_name=self.fd_ruleset.name,
            opts=pulumi.ResourceOptions(
                depends_on=[self.fd_ruleset],
            ),
        )
f
Check the keys like
type_name
enable verbose login to capture azure response and request. Then inspect how pulumi-azure-native sends these parameters to azure.