There are a couple of ways to do this training exercise;
- Install the below frameworks and tools on your own machine. This gives you the most flexibility but requires some more work to get it all working together.
- Use a CodeSpace, which is some sort of a virtual machine in the cloud. The CodeSpace for this repository is configured to contain a storage emulator.
- Use CodeSpace combined with your local Visual Studio Code. If you like to use your own machine, but do not want to install all the tools, then this is a great fit.
In order to complete the the lessons on your own machine, you need to install the following:
Prerequisite | Description |
---|---|
.NET Core 6.0 | The .NET runtime and SDK. |
VSCode or VS2022 | VSCode is great for cross platform. VS2022 is best for Windows only. |
AZ CLI | The Azure CLI is a command-line tool that you can use to create and manage Azure resources. |
VSCode AzureFunctions extension | Extension for VSCode to easily develop and manage Azure Functions. |
Azure Functions Core Tools | Azure Functions runtime and CLI for local development. |
RESTClient for VSCode or Postman | An extension or application to make HTTP requests. |
Azure Storage Explorer | Application to manage Azure Storage resources (both in the cloud and local emulated). |
Azure Storage Emulator (Windows only) or Azurite | Emulator for using Azure Storage services if you want to develop locally without connecting to a Storage Account in the cloud. If you can't use an emulator you need an Azure Storage Account. |
Alternatively; you can use GitHub CodeSpaces, a feature from GitHub, which provides you with a cloud based development environment. This is a great way to get started with Azure Functions, without having to install anything on your local machine. You do need a GitHub account for this, but you can use a free account.
From within the repository, click on the Code
button and select Open with Codespaces
. This will spin up a new environment for you, and you can start working on the workshop when it has finished provisioning.
Be sure to stop (and delete) the Codespace when you are done, to avoid unnecessary costs.
Note: when you are using a codespace, Azurite is running along the dotnet image. You will need to use a different connection string in this case:
DefaultEndpointsProtocol=http;AccountName=devstoreaccount1;AccountKey=Eby8vdM02xNOcqFlqUwJPLlmEtlCDXJ1OUzFT50uSRZ6IFsuFq2UVErCz4I6tq/K1SZFPTOtr/KBHBeksoGMGw==;BlobEndpoint=http://azurite:10000/devstoreaccount1;QueueEndpoint=http://azurite:10001/devstoreaccount1;TableEndpoint=http://azurite:10002/devstoreaccount1;
Note: To invoke the command palette, you can use F1 as well.
Note: Remember that you are running inside VM, it will expose a port (
7071
) to the outside world, so you get a remote url you can use. So consider whatlocalhost
is relative to your own machine.
For the second part of the workshop, you will need an Azure subscription. If you don't have an Azure Subscription, install Azurite. Get your free Azure subscription here. You will need a credit card, but it won't be charged, provided you clean up all resources after completing this lab. If you have a MSDN account, you most likely have Azure Credits as well.
The files inside this repository contain everything you need to continue with the workshop at a later time. It also contains the completed solutions for each of the labs. You can use this to check how things could be at the end, or to take a peek when you are stuck and need a hint. The lab files should function, apart from some light tweaking of connection strings to actual Azure resources. For obvious reasons, these are not included in the code and configuration of this repository.
-
Open a terminal window or command prompt and change your working directory to your usual place where you clone Git repositories, e.g.
C:\Sources
on Windows or~/sources
on Linux.cd \Sources (Windows) cd ~/Sources (Linux)
-
Clone this Git repository:
git clone https://github.com/XpiritBV/AzureFunctionsWorkshop.git
We suggest you create a new folder dedicated to your own work, at a convenient location such as workshop
.
-
Inside your sources folder from the previous step, create a new folder to add your workshop files to:
mkdir workshop cd .\workshop
-
Turn the
workshop
folder into a git repository:git init
-
Add subfolders for the source code and test files:
mkdir src mkdir tst
You should be good to go now!