0

We are working on an Azure ARM Template which is creating an VM and running a Bashscript on startup using Custom script extension. It was working well for sometime but then suddenly it started caching the SH file. I added few commands which ended in some error, so I removed them but still I am getting same error.I tried deleting SH file from URI but still the error persisted.

Command which I added to my custom script was for creating a directory(mkdir) only.

Has anyone seen anything like this on Azure ??

BlindSniper
  • 1,731
  • 3
  • 16
  • 30

1 Answers1

2

Yes, its not the template that's caching it, its the extensión that does that. You need to either delete the extensión from the VM before retrying or use the ForceUpdateTag` in the template.

Docs here.

ForceUpdateTag:
Specifies that the extension should be run again with the same public or protected settings. The value can be any string different from the current value. If forceUpdateTag is not changed, updates to public or protected settings would still be applied by the handler.

ps. Azure Powershell DSC extensión has the same behavior.

4c74356b41
  • 69,186
  • 6
  • 100
  • 141
  • It was not caching it. Actually when my script gave error, I corrected it and then redeployed nd forgot to delete my VM. Azure instead of giving me error about trying to create already existing VM,showed me old error logs. WIll raise a ticket for that. – BlindSniper Dec 04 '17 at 07:37
  • Thats a lot of misunderstanding on your part. Thats not how ARM Templates work. And it showed you "old" errors because it ran tha same extensión again – 4c74356b41 Dec 04 '17 at 07:42
  • Can you explain a bit more. I am new at this – BlindSniper Dec 04 '17 at 07:50
  • well, thats a bit too much for a comment. I've explained why you are getting "old" errors, if you dont understand ARM Templates (declarative nature of those) you should read up on those – 4c74356b41 Dec 04 '17 at 08:19
  • https://stackoverflow.com/questions/37723567/how-to-force-vm-created-with-an-arm-template-customscriptextension-to-redownlo?rq=1 found this Thanx – BlindSniper Dec 04 '17 at 08:27