MLOpsPython
MLOpsPython copied to clipboard
Create webapp from arm template automatically
This PR adds the ability to create the azure web app automatically from an ARM template (#275), so one does not have to do those manual steps. There are two points worth mentioning:
-
It seems like the azure web app must have an actual docker image available when it is created (with docker support), so instead of deploying the web app in the environment-setup pipeline, we have to set it up in the normal pipeline, after the docker image is pushed to the ACR. This should not be much of a problem, but there can be problems if you have policies in your tenant which automatically sets some properties (i.e. ftps only).
-
EDIT: This has now been changed to use AZ CLI instead. To get the password from the ACI I had to resort to quite an ugly hack. I tried to have the following in
webapp-env.json, but it just did not work (authentication error).
"name": "DOCKER_REGISTRY_SERVER_PASSWORD",
"value": "[listCredentials(resourceId('Microsoft.ContainerRegistry/registries',parameters('acr')),'2019-05-01').username]"
If instead I entered the password directly it worked. And if I put that exact line in the "outputs" section in printed the password fine. It might have something to do with evaluation order of the function listCredentials, IDK. So instead I had to create another ARM script which got the credentials, passed them as an output and then this output got used by the main ARM template as a parameter. :facepalm:
This closes #275
I rebased, ported to the new CI/CD setup, and use AZ cli instead of ARM to get username/password. Unfortunately, with the new CI/CD this project has now deviated a bit from our internal version (which is based on this repository from a few months ago), so that part of it has not been tested.
Have added additional instructions to the WebApp deployment part to detail required steps, until this is checked/automated. As mentioned, the image has to be created before the webapp can be created.