Quality, testing and security teams now have a single instance to look at and ensure all functional and regulatory requirements are met. System engineers now don’t have to worry about providing a system with the required specs as the container is already provisioned for that purpose.
Docker container software
Once you have completed the preparation step, it’s time to get our hands dirty.
Link your Azure SDK to your Azure subscription
If your installation was successful, you will see the following output. Of course, your code will be different.
Next it will take you to a web page where you can enter your code.
Once verified with Microsoft, you’ll get to see your subscription details back into the command line interface.
Create a resource group
The easiest way to manage your applications is to define a resource group. The purpose of this group is to have all related applications grouped together so it’s easy to enable, scale and disable them referencing a single group name.
The name for this resource group needs to be unique, so be creative. I was lucky to find
aciDemoApp not being used yet, but it could be that the chosen name is already taken. Adding a prefix of your company or a postfix with current date and time can also do the trick. Be creative!
Once the resource group is created, you’ll get again a confirmation in your command line interface.
Create an Azure container registry
Log in into your Azure container registry
Before we can create our container images and push them into our newly created container registry, we need to login into the Active Directory we just created.
This will return you a successful status message.
Prepare your docker setup
Build and run locally
Once the build is complete, we can run it to see if everything is working.
Make sure the image is available
Should provide you a listing of your current running apps
Tag your image with the Azure Image Registry
Use the following command if you need to find your registry URI that you’ll need to push your image to.
This will give you the URI you can use for tagging your image
Now tag your image and make sure you also provide a version (like
v1) as this will make it easier in the future to scale your application and have clean deployments of your application containers in the cloud.
Check again your Docker images to see the tag being applied correctly.
Push your Docker image to Azure registry
This might take some time to push your whole image upstream, but once it’s complete you should receive something similar to this.
Enable administrative rights on the registry
We now enable administrative permissions on our registry so we can actually deploy our container.
Get the password needed for deployment
Deploy your docker container
This command creates the application container and starts running it. In the details you get back from the service you get full details about your deployed container.
To get the status of your container you can use
az container show --resource-group aciDemoApp --name aci-tutorial-app --query instanceView.state, which will return you the status.
Immediately after you’ve started your container, your container needs to boot up.
But shortly after you’ve deployed your container, you’ll see the status indicating everything is a go.
To get the IP of your container use
az container show --resource-group aciDemoApp --name aci-tutorial-app --query ipAddress.ip
See the log output of your container
This will give you insights into the container activity
Updating your container
No project is perfect the first time. Neither are your services you put inside a container. Updating your container is just a matter of tagging a new version and putting it live.
To make it easy for you I’ve provided a branch called “update” so you can go immediately started.
Now that we’ve verified everything is working, it’s time to tag it again and push it upstream.
It could be your session got timed out, the following message will give you more details.
To login again, the following statement will help you further.
This should give you a success statement.
The moment authentication is again approved, you can now safely push your container upstream.
Again a new checksum will be calculated and returned.
Now it’s time to upgrade the container.
Notice we used the same password as before, but this time we’re using
acidemomvp.azurecr.io/aci-tutorial-app:v2, our updated container tag.
Destroy your container
It will ask for your confirmation
Next articles in the pipeline
Please leave feedback and let me know if this tutorial was interesting and what you like to see in the future as well.