question

Nibbler avatar image
0 Votes"
Nibbler asked suvasara-MSFT commented

Front Door Purge Script

Hello,

I seems that running a purge script with "-AsJob" is not possible. Is there any alternative to this?

windows-server-powershellazure-front-door
5 |1600 characters needed characters left characters exceeded

Up to 10 attachments (including images) can be used with a maximum of 3.0 MiB each and 30.0 MiB total.

suvasara-MSFT avatar image
0 Votes"
suvasara-MSFT answered Nibbler commented

@KE1980 , Adding "&" at the end of the command does the job for me,

90020-image.png





Please do not forget to "Accept the answer" wherever the information provided helps you to help others in the community.


image.png (148.1 KiB)
· 2
5 |1600 characters needed characters left characters exceeded

Up to 10 attachments (including images) can be used with a maximum of 3.0 MiB each and 30.0 MiB total.

Hi @suvasara-MSFT

Thanks! And quick and sharp with a solution as allways. Appreciate it!

1 Vote 1 ·

Hi @suvasara-MSFT

When I use the script ion a deploy-pipeline, I do get the error

"The ampersand (&) character is not allowed. The & operator is reserved for future use"

Any suggestions to solve this one?



0 Votes 0 ·
suvasara-MSFT avatar image
0 Votes"
suvasara-MSFT answered suvasara-MSFT commented

@KE1980, I did try running it as wrapped PS script and it did work,

90678-image.png

May be Your deployment pipeline requires this & to escape. Try adding double quotes around this whole command and do a redeploy. Also, try this way, '"command"' [singlequote+doublequote+command+doublequote+singlequote]


image.png (32.0 KiB)
· 3
5 |1600 characters needed characters left characters exceeded

Up to 10 attachments (including images) can be used with a maximum of 3.0 MiB each and 30.0 MiB total.

@suvasara-MSFT Yeah, I was thinking the same with doublequote, although not with the singlequoe+doublequote.

I do work, as it does with doublequote, in the cloud shell, but not when it is in deploy pipeline.

Error message:
A positional parameter cannot be found that accepts argument '"&"'.

0 Votes 0 ·

@suvasara-MSFT Any good ideas on this :-)

0 Votes 0 ·

@KE1980 , here is the solution,

 start-job -ScriptBlock {Remove-AzFrontDoorContent -ResourceGroupName Networking-Resources -Name frontface -ContentPath "/*"}

0 Votes 0 ·