Skip to content

Python

How to create an Azure Batch's Application Package automatically

While using Azure Batch, you may need to create an application package to run your applications in the cloud.

The creation can be done manually, generating and uploading a .zip file to the Azure Batch resource Portal. However, this process can be tedious and time-consuming, especially if you have multiple applications or need to update the package frequently, for instance at every new release (or hotfix!).

In this post we will cover how to automate the creation of an Azure Batch application package using a Python script.

Create a Comand line interface in few minutes

cli title

A command line interface could seem an ancient tool to all non expert users, nowadays used to fancy click and drop user interfaces. Nothing more wrong! It is also a valid tool to enhance your libraries and projects, reusable in bash scripts and ci/cd pipelines.

In this tutorial we will deep dive into the python click library and create a simple command line interface (CLI) to manage the settings value and interact with our project.

Manage settings with Pydantic

pydantic-image Pydantic is a wonderful library that allows to easily validate your data, simply defining a schema. It is highly customizable and can be used, for instance, to validate data coming from a POST request.

In this tutorial we will use it to create a Settings class whose fields can be changed in different ways, triggering any time the validation.