Pushing my fullstack app image to Azure Container Registry and Deploying using Container Instance and AppService.
Tags: azure, docker, devops
Published: 2023-05-18 09:49:33

I have learnt alot, really.Recently,my cloud mentor said developers usually push and pull their images to a centralised repository.

So i thought of pushing my generated image to an azure repository and try deploying my app from there.

First ofcos i had to set up an azure registry to hold my repository that holds the image.

![azurereg](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/ypcjoujfl0j33hxl6cyf.png)

Next, i left everything as default and created the registry.

![reg](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/f7cic8ygfhlav3ofezvo.png)

So creating the registry,under access keys
we should be able to see the registry name, loginserver name and be sure to **enable** the admin user to passwords.

![keys](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/y2asgz5ithjb38irebuw.png)

Now back to our app,i then tag my image
`docker tag nameofimage loginserver/nameofimage`

```
 docker tag node_mssql emmilyreg256.azurecr.io/node_mssql
```
![docker](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/6o4u1o63f71nvfw5sf06.png)

Before we login, we have to login using the admin details in the access keys in the registry.

```
docker login {loginserver}
```
Then enter the username and password

![docker](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/zv9jde1duuu66vyvg42p.png)



Next its time to push the image to the registry
`docker push loginservername/nameofimage`
```
docker push emmilyreg256.azurecr.io/node_mssql
```


![after](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/hggyk0m5xod1pbt4iiyv.png)

So after pushing , we can see our image in the docker registry in the portal.

![portal](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/uhs6cl2cm5c851r7dzzw.png)


![image](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/dljo0pia4f3wlzny6z10.png)

Now what do to with this image. Leme check the slides and do something cool next.

![im](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/scj8e0dp3rbxjqklgbq2.png)

Turns out i can either run the instance or create a web app.
First i tried creating a web app.
So clicking create webapp leads me to where i can fill details of the web app



![webapp](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/9rvgo78utbcq48y0gd0w.png)

Next we add the database connection string, be sure to include your password in the string.

![I](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/ysfzdlyimrbrgpa1ny57.png)

After saving, then check the domain link for the web app.
It should be up and running.

![web app](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/gunqph2upal8oohxxpp0.png)


Now if i try creating the instance,
i click on **run instance**

![run](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/6grvevs3xtxgf3jzigcf.png)

Remember to use the port number that you exposed when building the docker files your tcp.

![repo](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/4pgwydgugugtejn7minh.png)

After deploying,pick the public ip address an add your port to see the website.


![public](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/ltmkgi67kdur5f1oskm1.png)





So now i can create images, push them to registry and deploy them using container instances.

Wow i can't believe this.