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.
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!
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.
There you go! You just connected to your very own debian vm in Azure!
In the next post we’ll create a docker container.
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
Let’s write some code to add messages to the queue.
The final main will look like this. After you’re done, save
Let’s build using donet build to check for any errors.
Once built and ok we can move on. In the next post we’ll download storage explorer and add some messages.
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.
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!
Open the program.cs file to add code to your application.
Edit the code to ourput the current datetime. Then save the file.
static void Main(string args)
Console.WriteLine("The current time is " + DateTime.Now);
Time to run your application once again!
Great work! Now go and build some .NET apps!
Now let’s create the console application.
dotnet new console -o myApp
Great! Now make your way to the folder and let’s run the application!
Great work! In the next post we’ll edit some code.