-
Notifications
You must be signed in to change notification settings - Fork 1.1k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Create webapp from arm template automatically #285
base: master
Are you sure you want to change the base?
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Requesting change to use the CLI instead of ARM template to get credentials - thanks!
I rebased, ported to the new CI/CD setup, and use AZ cli instead of ARM to get username/password. |
@@ -40,3 +40,6 @@ steps: | |||
# Set environment variable using the last line of logs that has the package location | |||
IMAGE_LOCATION=$(tail -n 1 image_logs.txt) | |||
echo "##vso[task.setvariable variable=IMAGE_LOCATION]$IMAGE_LOCATION" | |||
echo $IMAGE_LOCATION > image_location.txt | |||
IMAGE_TAGGED="$(sed 's/@sha256.*/:latest/g' image_location.txt)" | |||
echo "##vso[task.setvariable variable=IMAGE_TAGGED]$IMAGE_TAGGED" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Why the need for this additional environment variable? Can we reuse the image location variable?
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. |
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).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. 🤦This closes #275