0

I want to do the following stuff via Azure ARM template:

  1. create an Azure resource Azure Spring Apps Service via ARM template
  2. call the Action enable-test-endpoint for the resource in step 1

It looks like ARM template only support create/update resource, it doesn't support call an Action. Is it a way to call an Action via ARM template?

I have read ARM template user guide

Jackson
  • 1
  • 2

1 Answers1

0

I do not know Azure Spring Apps, and therefore I do not know if it is possible as a property in ARM which you can enable (I cannot see it in the ARM template schema).

What you can do in this scenario, is to run an inline deployment script https://learn.microsoft.com/en-us/azure/azure-resource-manager/templates/deployment-script-template

This would allow to have ARM run code that would usually be done as part of a deployment pipeline. In your example I would run this as a dependant resource on your Spring App deployment using PowerShell. You can also get the script to return the output if needed in subsequent steps.

Alistair

TheAlistairRoss
  • 305
  • 1
  • 3
  • Thank Alistair and Peter so much for the help! I've confirmed there's no such property and I have to call the http POST action. For our use case, a web UI calls ARM template API to create resource via ajax. we can't call the htp POST action from web UI after the resource is created as end user may close the browser before resource is created. deployment script is too compliated for us. Does ARM template support calling http POST action besides deployment script? If No I will go with another way: implement a server side API to combine the two steps(call ARM template and POST action) together. – Jackson May 16 '23 at 04:12
  • No it doesn't. When it runs an inline script, effectively it is creating a compute instance to execute the code in. The only other option will be to run the POST request as part of a deployment script or pipeline. – TheAlistairRoss May 17 '23 at 18:29