I tried to create test project with docker support (windows container) and deploy it to azure container registry. After that i tried "Deploy to web app" function from menu and after successful deploy only thing i can see on my resource is "Your App Service app is up and running" and i can't access my pages of methods from my app. What can be done with this?
Try to set WEBSITES_PORT configuration in your WebApp. In general the WebApp Service should detect the open port automatically and match it to 443 or 80 but in some cases it helps to set WEBSITES_PORT in the WebApp Configuration.
You can do this for example via CLI command az webapp config appsettings set --name <myname> WEBSITES_PORT='3000'.
You should restart the application afterwards.
Related
I am trying to deploy a sample application in VM using 'run docker container' template.
Everything is working fine but no ports are showing up in the container details while I am explicitly mentioning host and container port.
I am using gitlab container registry and azure app service. in the app service I pull container from gitlab and serve it as a service. My problem is I push the new image from gitlab-ci.yaml to app's container settings but the problem is it clears up the login and password info under container settings, each time I push a new container version. So, I have to type my gitlab deploy token in the container settings page. How can I prevent this? Thanks. See the image
Here agree with CSharpRocks, according to the official document, we need to use the az webapp config container set command to specify the container registry and the image to deploy for the web app:
az webapp config container set --name <app-name> --resource-group AppSvc-DockerTutorial-rg --docker-custom-image-name <registry-name>.azurecr.io/appsvc-tutorial-custom-image:latest --docker-registry-server-url https://<registry-name>.azurecr.io
For details:
Replace <app_name> with the name of your web app and replace <registry-name> in two places with the name of your registry.
When using a registry other than Docker Hub (as this example shows),
--docker-registry-server-url must be formatted as https:// followed by the fully qualified domain name of the registry.
The message, "No credential was provided to access Azure Container
Registry. Trying to look up..." tells you that Azure is using the
app's managed identity to authenticate with the container registry
rather than asking for a username and password.
If you encounter the error, "AttributeError: 'NoneType' object has no attribute 'reserved'", make sure your <app-name> is correct.
Instead of using this to update your Web App
az webapp create
Try using
az webapp config container set --docker-custom-image-name MyDockerCustomImage --docker-registry-server-password StrongPassword --docker-registry-server-url [] --docker-registry-server-user DockerUserId --name MyWebApp --resource-group MyResourceGroup
Documentation
Nodejs app works locally and also works on app service if deployed to Azure app service Linux directly from visual studio but does not work when deployed using azure devops
Artifact files and folders using visual studio -
config
demo
dist
src
gulpfile.babel.js
node_modules
package-lock.json
package.json
postcss.config.js
web.config
node_modules.tar.gz
oryx-manifest.toml
Artifact files using Azure devops -
config
demo
dist
src
gulpfile.babel.js
node_modules
package-lock.json
package.json
postcss.config.js
web.config
When I am trying to deploy using azure devops App service deploy task deployment works but URL is not working and logs errors are -
container test didn't respond to HTTP pings on port: 8080, failing site start. See container logs for debugging.
2020-09-12T05:37:46.165Z INFO - Stopping site because it failed during startup.
2020-09-12T05:53:51.152Z INFO - Starting container for site
2020-09-12T05:53:51.153Z INFO - docker run -d -p 1861:8080 --name -e WEBSITE_SITE_NAME=test -e WEBSITE_AUTH_ENABLED=False -e WEBSITE_ROLE_INSTANCE_ID=0 -e WEBSITE_HOSTNAME=test.azurewebsites.net -e
I don't have any docker-file , if ports is the issue, then why its works when I publish to Azure app service using visual studio?
These are my mentioned ports
serve({
port: process.env.PORT || 3000,
open: true,
server: {
baseDir: 'src'
},
Now what you are doing is to publish the webapp through devops. The phenomenon is that it cannot be accessed normally. The error message prompts that container test didn't respond to HTTP pings on port: 8080, failing site start. See container logs for debugging.
Similar related posts should be helpful to you.
Struggling to upload my node.js application to azure
Because the project is normal locally, we are now troubleshooting the problem.
Because azure app services only supports ports 80 and 443. So check if only one port is enabled in the program. Such as configuring port: process.env.PORT || 3000.
It is recommended to use git for continuous deployment to test whether your webapp project can run normally in azure app services
If continuous deployment using Git is successful:
If git continuous deployment can replace your deployment method requirements, and the project can start normally, then your problem will be solved.
But if you must want deploy apps by using devops, there may be errors when configuring release.
If you are really not sure where there is an error, you can raise a support ticket on the portal. Let an official engineer assist you in checking logs and troubleshooting problems.
I'm creating an App Service with containers in Azure but in logs I found out that when docker run command is executed, always takes port 80 for starting application, however my application in container is listening on port 5000. How I can change it in order to take port 5000 insted of 80 when it execute docker run command?
Had the same issue, you can either use Azure CLI to set:
az webapp config appsettings set --resource-group <resource-group-name> --name <app-name> --settings WEBSITES_PORT=5000
Or add directly from Azure Portal:
Hope if helps.
I'm trying to run a multicontainer web app based in two images that I stored in an azure container registry (launched with a docker compose yml custom file) but it fails because the docker-compose proccess cannot get the images due to an "unauthorized: autentication required" response. Both the container registry and the web app belongs to the same resource group.
How can we solve this problem? Thanks in advance.
#jennylwrnce from Azure Developer App Service Team tweeted this:
https://blogs.msdn.microsoft.com/appserviceteam/2018/06/27/use-acr-for-multicontainer-web-app/
So it can be solved via panel.azure.com
enter image description here
You need to configure authentication for the webapp, by default it can only pull public images.
this is the sample command to do that:
az webapp config container set --name <app_name>
--resource-group myResourceGroup
--docker-custom-image-name <azure-container-registry-name>.azurecr.io/mydockerimage
--docker-registry-server-url https://<azure-container-registry-name>.azurecr.io
--docker-registry-server-user <registry-username>
--docker-registry-server-password <password>
https://learn.microsoft.com/en-us/azure/app-service/containers/tutorial-custom-docker-image#use-a-docker-image-from-any-private-registry-optional
this article also talks about how to push to the private repo (ACR) and how to configure it