Deploying compute workloads by using images and containers Part 2 – Deploy a Docker container image to Container Registry

Now let’s deploy a docker container to an Azure Container Registry.

Launch the cloudshell from the Azure Portal and create a folder and a dotnet console application.

cd clouddrive
mkdir ipcheck
cd ipcheck/

Create a new console project

dotnet new console

Create a new file called Dockerfile and launch code inside the cloudshell.

Copy the sourcecode from the learn excercise and run the application to verify that the ipaddress is found.

And finally copy the sourcecode to the Dockerfile, save and close.

Now in the next part we will create an Azure container registry and publish our ipcheck console application!

Deploying compute workloads in Azure by using images and containers Part 1 – Create a VM using Azure CLI

In Lab 05 here we will deploy Docker containers into Azure Container Registry.

Connect to Azure and create a resource group and the VM.

az group create --location westeurope -n 05lab-rg
az vm create --name quickvm -g 05lab-rg --image Debian --admin-username xyz --admin-password xyz

Now check the ipadress and note it.

az vm list-ip-addresses

Now let’s connect using SSH.

ssh student@ip-adress

There you go! You just connected to your very own debian vm in Azure!

In the next post we’ll create a docker container.

Asynchronously processing messages by using Azure Queue Storage Part 4 – Download Azure Storage Explorer and add messages to the queue.

Head over to Azure Storage Explorer here and download and install.

Open and connect to your storage account and queue and add a message. Make sure you don’t encode in base64.

Run your dotnet application and watch it collect your message in your very own Azure Storage Queue!

You’ve just created a storage account, message queue and written a C# program that uses the resources. Great work!

Now go ahead and delete the storage account and the resource group if you don’t want them anymore.

az storage account delete -n lab11stgacc -g lab11-rg
az group delete -g lab11-rg

Asynchronously processing messages by using Azure Queue Storage Part 2 – Install Git, pull a repository and connect to a storage queue using C#

Head over to GIT, download and install.

Open VSCode, press ctrl+shift p and type to clone a git and the link to the git.

Next, create the project, install and build it. Please visit the github site here to see all the commands.

Now open the Project.cs file and update the code with the code from the github and edit the code with the connection string you collected when you create the storage account.

Next update the main to connect and create the queue.

Next, save and run! In the next post we’ll add messages to the queue.

Asynchronously processing messages by using Azure Queue Storage Part 1 – Create a storage account

Microsoft provides many different sources for working with Azure. Let’s run through Microsoft Learning Github and Module 11 of AZ-204: Developing solutions for Microsoft Azure here.

Let’s create a storage account using CLI.

First create the resource group.

az group create -n lab11-rg -l westeurope

Now let’s create a storage in that resource group.

az storage account create -n lab11stgacc -g lab11-rg -l westeurope --sku Standard_LRS

Now finally let’s get and record our connection string storage key using CLI.

az storage account show-connection-string --name lab11stgacc

Great! Make a note of this connection string as we’ll need it later.

In the next post we’ll install git and pull the lab into our Visual Studio Code!

Create an Azure Function using Visual Studio Code Part 6 – Swap deployment slots

Okey, now with our new update added to another slot let’s finally swap this to our production.

In Azure, select your function app and deployment slots, press Swap and verify the source to destination.

Done and done! Now head over to your root function app url and verify that your deployed Azure function have swapped places.

Create an Azure Function using Visual Studio Code Part 5 – Using deployment slots

So now with the Azure Function in Azure we better update our code so it doesn’t say in our local environment.

Create a deployment slot in the Azure portal and give it a name.

Now head over to Visual Studio Code and inside the local project folder change the .cs code to read IN AZURE and save the file.

Right click and deploy to the new slot!

Jump back into Azure and select the deployment slot and fetch the url and append the text and Voila!

You’ve just pushed an new Azure Function app into a dev slot! Remove the -slot1 and you’ll see your old values.

In the final blog post we’ll swap this slot1 to the production slot.

Create an Azure Function using Visual Studio Code Part 4 – Deploy function to Azure

Now let’s upload this function to Azure to use online!

Go into the Azure extension and press on sign in to Azure.

After you have logged in press on the Deploy to function app.

Select create a new function app in Azure, create a global unique name and select a region.

Once done check if it’s complete by pressing the bell button.

Next jump into Azure and get the function URL and check out your function app in Azure!

But wait a minute, now our code is wrong! It’s in Azure right? Let’s push an update in the next blog post!

Create an Azure Function using Visual Studio Code Part 3 – Edit the code and pass a query string

Last time we had our Azure Function with C# and deployed and tested it. Let’s go into the function code and make a change and pass a query string and watch our function reply.

Go into the project folder and change the text after hello to say

"on my local environment!"

Launch the debugging again and append below to your string.

?name=DonaldDuck

There you go! Now in the next post we will deploy to Azure!