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:
- 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). - The ARM "script" then executes and...
- Fetches the "publish profile" XML from the newly created App Service "X".
- Fetches the repo address of the same App Service "X".
- Creates a github repo secret which contains the prior publish profile.
- Generates a custom github workflow file, referencing the publish profile.
- 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...
- Does not allow the app folder to be specified within the repo.
- Does not have a way for me to specify a special build-step (viz. provide a command to launch an Entity Framework database migration).