0

When deploying an Azure App Service from an ARM template, I can give the App Service a sourcecontrols child resource which specifies the source repo URI for the App Service. Furthermore, that child resource can generate a github workflow action YML file and THEN commit that file to the aforementioned repo.

However, the auto-generated workflow action YML file has both errors and deficiencies. As a consequence, I want instead for my ARM template to contain an ARM script that creates/templatizes my own github workflow action file...and commits it to the pertinent repo.

I presume this is possible. Does anyone have sample PowerShell (or bash) scripts that will do this?

Step by step, I think it would look like this:

  1. ARM template deploys an App Service named "X", and uses a sourcecontrols child resource to also link the App Service to the repo (but does not auto-generate the workflow file).
  2. The ARM "script" then executes and...
    1. Fetches the "publish profile" XML from the newly created App Service "X".
    2. Fetches the repo address of the same App Service "X".
    3. Creates a github repo secret which contains the prior publish profile.
    4. Generates a custom github workflow file, referencing the publish profile.
    5. Commits the customized workflow file to the repo.

I suppose a simplified variation of the above would be to allow the ARM template to create the "deficient" github workflow file, and then have the ARM-based script simply modify and commit updates to the prior auto-generated workflow file. The only catch for this simplified approach - might be that the moment the first workflow file is committed, it could immediately kick-off a build (before the modified workflow file is properly put in place).

Incidentally, the reason I say that the auto-generated workflow file has errors and deficiences, are two-fold. The default, auto-generated github workflow file...

Brent Arias
  • 29,277
  • 40
  • 133
  • 234
  • This could help - https://github.com/MicrosoftDocs/azure-docs/blob/main/articles/azure-resource-manager/templates/deployment-tutorial-pipeline.md – Venkatesan Mar 10 '23 at 12:18

0 Answers0