How do you add rules to the cdn with pulumi? A rul...
# azure
b
How do you add rules to the cdn with pulumi? A rule that makes deeplinking in React possible when hosting on storage account and with a cdn in front with az cli i will write this -> # #create redirect url for 404 to index.html to enable deeplinking az cdn endpoint rule add -n “${random}cdnendpoint” -g $resourceGroupName --profile-name “${random}cdn” --rule-name sparewrite --order 2 --action-name “UrlRewrite” --source-pattern ‘/’ --destination /index.html --preserve-unmatched-path false --match-variable UrlFileExtension --operator LessThan
t
b
okay thank you so not a part of the cdn endpoint but more a “resource” on top?
t
yes, I think so
b
cool thanks
is there any repos with examples of such rules?
t
Not directly, no. You may find some ARM template examples and try to translate to Pulumi, e.g. from https://github.com/Azure/azure-quickstart-templates
Btw, I think you could add rules to the
Endpoint
resource directly too, if you prefer that for some reason. `
Copy code
deliveryPolicy.rules
seems to allow that.
TBH, I’m just looking at the docs - not an expert in this API, unfortunately.