# Die Microsoft Azure Cloud im Informatikunterricht ## Azure-Organisation * Verwendung des Schul-AAD oder eigenes AAD? * Bereitstellen von Azure-Resourcen oder Verwendung der Student Benefits? * Zentrale Dienste * [Azure Container Registry](https://learn.microsoft.com/en-us/azure/container-registry/container-registry-intro) * [Azure SQL](https://learn.microsoft.com/en-us/azure/azure-sql/azure-sql-iaas-vs-paas-what-is-overview) * [Azure Cosmos DB](https://learn.microsoft.com/en-us/azure/cosmos-db/introduction) * Kostengünstige Alternative: Serverless ## Begleitende Themen * CI/CD * Empfehlung: [GitHub Actions](https://github.com/features/actions) * Infrastructure-as-Code * Container, Docker * Datensicherheit, Datenschutz, DSGVO * Passwordless (**Tipp:** [Azure Managed Identity](https://learn.microsoft.com/en-us/azure/active-directory/managed-identities-azure-resources/overview)) * IaaS, PaaS, Serverless * IT-Kosten * Green IT ## Diskussionen * Portal, CLI, PowerShell, Bicep * Visual Studio, Visual Studio Code * Passwordless vs. Secrets & Connection Strings ## Unterrichtsmaterial ### Schulungen * [Get free Azure student benefits](https://azure.microsoft.com/en-us/free/students/) * [Azure Global Infrastructure](https://infrastructuremap.microsoft.com/) * AZ-900 Certification * [Core Azure concepts](https://learn.microsoft.com/en-us/training/paths/az-900-describe-cloud-concepts/) * [Azure architecture and services](https://learn.microsoft.com/en-us/training/paths/azure-fundamentals-describe-azure-architecture-services/) * [Azure management and governance](https://learn.microsoft.com/en-us/training/paths/describe-azure-management-governance/) * [Azure architecture and services](https://learn.microsoft.com/en-us/training/paths/azure-fundamentals-describe-azure-architecture-services/) * [Azure management and governance](https://learn.microsoft.com/en-us/training/paths/describe-azure-management-governance/) * [Azure management and governance](https://learn.microsoft.com/en-us/training/paths/describe-azure-management-governance/) * [Learn Live: Use Bicep to deploy your Azure infrastructure as code](https://learn.microsoft.com/en-us/events/learn-events/learnlive-iac-and-bicep/) * [Azure Learning Paths](https://learn.microsoft.com/en-us/training/browse/?products=azure) * [Einstiegspunkt für alle Azure-Produkte auf learn.microsoft.com](https://learn.microsoft.com/en-us/azure/) * Für jedes Produkt gibt es konzeptionelle Dokumentation, *How To*-Artikel und Tutorials * [PowerPoint Slides von Rainer bzgl. Cloud-Grundlagen](https://softwarearchitects1com-my.sharepoint.com/:p:/g/personal/rainer_software-architects_at/EZJldK-XIkVMkdX0gU-al5AByTB7uXrgOnMQ-ViwLdy95A?e=sXr8bA) ## Tools * [Automatisiertes Anlegen von .NET Entwicklungsumgebungen für SchülerInnen](https://github.com/rstropek/Samples/tree/master/Bicep/0400-aci) * [Azure Data Studio](https://learn.microsoft.com/en-us/sql/azure-data-studio/download-azure-data-studio) ## Übungen > Diskussion: Portal, CLI, PowerShell? Visual Studio, Visual Studio Code? * Grundlagen * [Manage resource groups](https://learn.microsoft.com/en-us/azure/azure-resource-manager/management/manage-resource-groups-portal) * [Work with Blob Storage](https://learn.microsoft.com/en-us/azure/storage/blobs/storage-quickstart-blobs-portal) * [Storage Explorer](https://learn.microsoft.com/en-us/azure/storage/blobs/quickstart-storage-explorer) * [Work with blobs from .NET](https://learn.microsoft.com/en-us/azure/storage/blobs/storage-quickstart-blobs-dotnet?tabs=net-cli) (other programming languages available, too) * [Host a static website](https://learn.microsoft.com/en-us/azure/storage/blobs/storage-blob-static-website-host) * [Azure SQL](https://learn.microsoft.com/en-us/azure/azure-sql/azure-sql-iaas-vs-paas-what-is-overview) * [Create a single database](https://learn.microsoft.com/en-us/azure/azure-sql/database/single-database-create-quickstart) * [Create a server-level firewall rule in Azure portal](https://learn.microsoft.com/en-us/azure/azure-sql/database/firewall-create-server-level-portal-quickstart) * [Design a relational database in Azure SQL Database C# and ADO.NET](https://learn.microsoft.com/en-us/azure/azure-sql/database/design-first-database-csharp-tutorial) (no EFCore) * [Azure Cosmos DB](https://learn.microsoft.com/en-us/azure/cosmos-db/introduction) * [Create an Azure Cosmos DB account, database, container, and items from the Azure portal](https://learn.microsoft.com/en-us/azure/cosmos-db/nosql/quickstart-portal) * [Azure Cosmos DB for NoSQL client library for .NET](https://learn.microsoft.com/en-us/azure/cosmos-db/nosql/quickstart-dotnet) (other programming languages available, too) * [Build web applications with Cosmos DB and .NET](https://learn.microsoft.com/en-us/azure/cosmos-db/nosql/tutorial-dotnet-web-app) (other programming languages available, too) * [Azure App Service](https://learn.microsoft.com/en-us/azure/app-service/overview) * [Deploy an ASP.NET web app](https://learn.microsoft.com/en-us/azure/app-service/quickstart-dotnetcore) (other programming languages available, too) * [Deploy an ASP.NET Core and Azure SQL Database app to Azure App Service](https://learn.microsoft.com/en-us/azure/app-service/tutorial-dotnetcore-sqldb-app) (other programming languages available, too) * [Run a custom container](https://learn.microsoft.com/en-us/azure/app-service/quickstart-custom-container) (Linux recommended) * [Send Email using Azure Logic Apps](https://learn.microsoft.com/en-us/azure/app-service/tutorial-send-email) * [Deploy a .NET Web Application to an Azure App Service by the command line](https://dev.to/kasuken/deploy-a-net-6-web-application-to-an-azure-app-service-by-the-command-line-533j) * [Configure an ASP.NET Core app for Azure App Service](https://learn.microsoft.com/en-us/azure/app-service/configure-language-dotnetcore) (other programming languages available, too) * [Azure Container Apps](https://learn.microsoft.com/en-us/azure/container-apps/overview) * **Tipp:** [Announcing built-in container support for the .NET SDK](https://devblogs.microsoft.com/dotnet/announcing-builtin-container-support-for-the-dotnet-sdk/) * [Deploy Azure Container Apps with the az containerapp up command](https://learn.microsoft.com/en-us/azure/container-apps/containerapp-up) * [Azure Functions](https://learn.microsoft.com/en-us/azure/azure-functions/functions-overview) * [Create a C# function in Azure using Visual Studio Code](https://learn.microsoft.com/en-us/azure/azure-functions/create-first-function-vs-code-csharp) (other programming languages available, too) * [Azure Managed Identity](https://learn.microsoft.com/en-us/azure/active-directory/managed-identities-azure-resources/overview) * [Connect to SQL Database from .NET App Service without secrets using a managed identity](https://learn.microsoft.com/en-us/azure/app-service/tutorial-connect-msi-sql-database) (other programming languages available, too) * [Azure Bicep](https://learn.microsoft.com/en-us/azure/azure-resource-manager/bicep/overview) * [Build your first Bicep template](https://learn.microsoft.com/en-us/training/modules/build-first-bicep-template/) ## Live Coding ### GitHub, Azure Workload Identity Federation Stichwort: Passwordless CI/CD [Beschreibung](https://blog.identitydigest.com/azuread-federate-github-actions/) ### Zugriff auf Azure SQL mit Managed Identity ```csharp using Azure.Identity; using Microsoft.Data.SqlClient; var builder = WebApplication.CreateBuilder(args); builder.Services.AddEndpointsApiExplorer(); builder.Services.AddSwaggerGen(); var app = builder.Build(); app.UseSwagger(); app.UseSwaggerUI(); app.MapGet("/ping", () => "pong"); app.MapGet("/db", async () => { // Create connection to Azure SQL Database with managed identity var connectionString = "server=tcp:rainersazuresql.database.windows.net;database=halloazuresql"; using var connection = new SqlConnection(connectionString); var credential = new DefaultAzureCredential(); var token = credential.GetToken(new Azure.Core.TokenRequestContext(new[] { "https://database.windows.net/.default" })); connection.AccessToken = token.Token; await connection.OpenAsync(); // Execute the query "SELECT TOP 10 Name FROM [SalesLT].[Product]" using var command = new SqlCommand("SELECT TOP 10 Name FROM [SalesLT].[Product]", connection); using var reader = await command.ExecuteReaderAsync(); var result = new List<string>(); while (await reader.ReadAsync()) { result.Add(reader.GetString(0)); } return Results.Ok(result); }); app.Run(); ```