https://pulumi.com logo
#azure
Title
# azure
b

brave-winter-60074

01/18/2021, 11:38 AM
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

tall-librarian-49374

01/18/2021, 11:41 AM
b

brave-winter-60074

01/18/2021, 11:42 AM
okay thank you so not a part of the cdn endpoint but more a “resource” on top?
t

tall-librarian-49374

01/18/2021, 11:42 AM
yes, I think so
b

brave-winter-60074

01/18/2021, 11:43 AM
cool thanks
is there any repos with examples of such rules?
t

tall-librarian-49374

01/18/2021, 11:46 AM
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.
3 Views