SlideShare a Scribd company logo
1 of 37
Download to read offline
.NET Conference 2024
Optimizing .NET 8 Applications
with Docker and Azure:
A Comprehensive Guide
Hamida Rebaï - Cloud Solutions Architect – Microsoft MVP
Agenda
• Overview of .NET 8
• Introduction to Docker Containers
• Integrating .NET 8 with Docker
• Deploying .NET 8 Applications to Azure
Overview of .NET 8
Hamida Rebai
.NET 8 New Features
• Performance Improvements: Over 1,250 performance
improvements, particularly in JSON API scenarios and realistic
workloads with database access.
• ASP.NET Core Enhancements: ASP.NET Core in .NET 8 offers
extended capabilities for modern web application development,
with enhanced tools for server-side rendering and client-side
interactivity.
• Blazor and WebAssembly: Blazor in .NET 8 includes improved
server-side rendering and increased interactivity with
WebAssembly. Components render 20% faster, and new web
packaging features are introduced.
• C# 12 New Features: Features such as primary constructors and
collection expressions are added, improving code readability and
simplicity.
• Development Tools: New tools in Visual Studio and Visual Studio
Code are introduced to enhance the development experience,
including improvements for routing, debugging, and API testing.
• Reference Architecture eShop: A comprehensive reference
application, eShop, is showcased, utilizing a cloud-native
microservices architecture and highlighting the new capabilities of
.NET 8.
• Full-Stack Application Development: .NET 8 emphasizes ease of
development for full-stack web applications, with improvements for
both backend and frontend developers.
• Security and Performance Enhancements: ASP.NET Core is
designed with a focus on security and optimized for performance,
enabling efficient handling of various scenarios.
• Cloud-Native and Mobile Development: .NET 8 continues to
evolve as a preferred platform for cloud-native and mobile
development.
• Community and Contribution: .NET 8 has benefited from strong
community contribution, reflecting its growing adoption and
impact in the world of software development.
Introduction to Docker
Containers
Hamida Rebai
What is Containerization?
• Containerization streamlines software development by packaging
applications, dependencies, and configurations into a single
container image.
• The containerized application can be tested and deployed as a
unified unit to the host operating system (OS).
• Analogous to shipping containers, which standardize cargo
transportation, software containers offer a consistent deployment
unit for diverse code and dependencies.
• Containerization facilitates seamless deployment across various
environments with minimal adjustments.
• Containers provide application isolation within a shared OS
environment.
• Containerized applications operate atop a container host,
enhancing efficiency and resource utilization.
• Compared to virtual machines (VMs), containers offer a significantly
reduced footprint, optimizing resource allocation.
Docker architecture
App App
Docker Engine
App
Host OS
Server
Docker Images
● Snapshot in other types of VM
environments.
● Record of a Docker container at a
specific point in time.
● Image can’t be changed, it can be
duplicated, shared, or deleted.
Docker Container
● Virtualized runtime environment used
in application development.
● Can use just one machine, share its
kernel and virtualize the OS to run
more isolated processes.
● Docker containers are lightweight
Image Source and Credits: http://blog.bigstep.com/developers-love-docker/
Run a container from an image
• Develop your application.
• Package the application and its dependencies into an image.
• Optionally, store the image in a registry.
• Execute the application by running it as a container.
App
Develop Build
Image
Ship
Registry Container
Run
Dockerfile Docker Image
Build Run
Docker Container
Dockerfile
FROM mcr.microsoft.com/dotnet/sdk:8.0 AS build
WORKDIR /src
1
COPY ["mysolution.csproj", « mysolution/"]
RUN dotnet restore « mysolution.csproj" 2
COPY . .
WORKDIR "/src/mysolution"
RUN dotnet build “mysolution.csproj" -c Release -o /app/build
3
Specify
image
Copy project file
Copy and Build
Build runtime image
FROM mcr.microsoft.com/dotnet/aspnet:8.0 AS base
WORKDIR /app
COPY --from=build /app/publish .
4
Dockerfile
Starting the app
5
ENTRYPOINT ["dotnet", « yousolution.dll"]
Build our image & start container
docker build -t yoursolutionimage:1.0 .
Create and run our container
docker run –d -p 8080:80 -ti –name myapp --rm yousolutionimage:1.0
Containers Deployment
DEMO
Prerequisites
• Install Docker Desktop it is free, it is available for Mac and Windows.
• Docker Hub account, it is free.
• Install Visual Studio 2019 or 2022 or Visual Studio Code.
• Azure account where we are able to create an azure container registry
• PowerShell in Windows or Azure Cloud Shell.
• If you are using Visual Studio Code, Microsoft C# for Visual Studio Code,
Docker and Azure App Service extensions must be installed.
Demonstration flow
Tag the image
locally
Using Visual Studio or Docker
command line
Azure Container registry is a private registry
Docker Hub to host public images
Building a Docker Image Tagging Images Build and Store Images in the
Cloud
Build and Store Images in
Azure Container services
Hamida Rebai
Build and store images by using Azure
Container Registry
• What is Container Registry?
• Azure service that you can use to create your own
private Docker registries.
• Similar to Docker Hub but offers a few unique
benefits: Container Registry runs in Azure, Container
Registry is highly scalable, providing enhanced
throughput for Docker pulls that can span many
nodes concurrently.
• Use Container Registry
• Create a registry by using either the Azure portal or
the Azure CLI.
• Store and host images, and build images.
DEMO
Container and orchestrator
Storage
• Azure Container Instance
• Azure App Service as a
Container
• Azure Container Registry
More than one container
One container
• Azure Kubernetes Service
• Azure Container App
Azure Container
Registry
Hamida Rebai
Demo: Build and Store Images by Using Azure
Container Registry (ACR)
Using Azure Portal
● Create Azure Container Registry from
the Portal or from Visual Studio 2022
● Push the image from Visual Studio 2022
Demo: Build and Store Images by Using Azure
Container Registry (ACR)
Using Azure CLI
● Create Azure Container Registry using
Azure CLI
● Push the image from Visual Studio
Code
az acr create --resource-group dockersamplerg --name acrdemoapp --sku Basic --admin-enabled true
Azure Kubernetes
Services
Hamida Rebai
Azure Kubernetes Services
• Azure Kubernetes Service (AKS) is a managed
Kubernetes service that lets you quickly deploy
and manage clusters.
>_
Create AKS cluster using Azure CLI
az aks create --resource-group aksgr --name
myAKSCluster --node-count 1 -- generate-ssh-keys --
attach-acr aksprojectcontainer
Deploy an Azure Kubernetes Service cluster and
run an application using the Azure CLI
1- Open CloudShell My Dashboard — Microsoft Azure and connect to your
cluster as bellow:
az account set — subscription yoursubscription
az aks get-credentials — resource-group aksgr — name myAKSCluster
You can find these commands when you open Azure Portal and your cluster:
Deploy an Azure Kubernetes Service cluster
and run an application using the Azure CLI
• 2- Create an empty file called: azure-demo-deployment.yaml
• 3- Copy this content to the empty file created, we will describe it after.
Deploy an Azure Kubernetes Service cluster
and run an application using the Azure CLI
apiVersion: apps/v1
kind: Deployment
metadata:
name: demo-kubernetes-deployment
spec:
selector:
matchLabels:
app: demo-kubernetes-pod
replicas: 1
template:
metadata:
labels:
app: demo-kubernetes-pod
spec:
containers:
-- name: aksprojectcontainer
image:
aksprojectcontainer.azurecr.io/aksp
roject:latest
ports:
-- containerPort: 80
Deploy an Azure Kubernetes Service cluster
and run an application using the Azure CLI
4- Run the application and deploy it in the cluster using the kubectl apply
command and specify the name of your YAML manifest.
kubectl apply -f azure-demo-deployment.yaml
We will use kubectl get deployments to verify if the deployment was
created or not.
When the application runs, a Kubernetes service exposes the application
front end to the internet. This process can take a few minutes to complete.
5- we will use kubectl get service command with the --watch argument.
kubectl get service demo-kubernetes-deployment — watch
Azure Container Apps
Azure Container App
Azure Container Apps is a fully managed environment that enables
you to run microservices and containerized applications on a
serverless platform.
• Provide a serverless hosting service that sits on top of an AKS
Service
• Deploy multiple containers
• Azure Container app do not even expose Kubernetes APIs to the
users.
Questions?
.NET Conference 2024
Grazie

More Related Content

Similar to Rome .NET Conference 2024 - Remote Conference

Rails Applications with Docker
Rails Applications with DockerRails Applications with Docker
Rails Applications with DockerLaura Frank Tacho
 
IBM Container Service Overview
IBM Container Service OverviewIBM Container Service Overview
IBM Container Service OverviewKyle Brown
 
Docker dev ops for cd meetup 12-14
Docker dev ops for cd meetup 12-14Docker dev ops for cd meetup 12-14
Docker dev ops for cd meetup 12-14Simon Storm
 
Dockerization of Azure Platform
Dockerization of Azure PlatformDockerization of Azure Platform
Dockerization of Azure Platformnirajrules
 
IBM Cloud UCC Talk, 22nd November 2017
IBM Cloud UCC Talk, 22nd November 2017IBM Cloud UCC Talk, 22nd November 2017
IBM Cloud UCC Talk, 22nd November 2017Michael O'Sullivan
 
Docker and Microsoft - Windows Server 2016 Technical Deep Dive
Docker and Microsoft - Windows Server 2016 Technical Deep DiveDocker and Microsoft - Windows Server 2016 Technical Deep Dive
Docker and Microsoft - Windows Server 2016 Technical Deep DiveDocker, Inc.
 
Introduction to Docker - VIT Campus
Introduction to Docker - VIT CampusIntroduction to Docker - VIT Campus
Introduction to Docker - VIT CampusAjeet Singh Raina
 
Introduction to Docker - Vellore Institute of Technology
Introduction to Docker - Vellore Institute of TechnologyIntroduction to Docker - Vellore Institute of Technology
Introduction to Docker - Vellore Institute of TechnologyAjeet Singh Raina
 
K8sfor dev parisoss-summit-microsoft-5-decembre-short
K8sfor dev parisoss-summit-microsoft-5-decembre-shortK8sfor dev parisoss-summit-microsoft-5-decembre-short
K8sfor dev parisoss-summit-microsoft-5-decembre-shortGabriel Bechara
 
HPC Cloud Burst Using Docker
HPC Cloud Burst Using DockerHPC Cloud Burst Using Docker
HPC Cloud Burst Using DockerIRJET Journal
 
Container orchestration k8s azure kubernetes services
Container orchestration  k8s azure kubernetes servicesContainer orchestration  k8s azure kubernetes services
Container orchestration k8s azure kubernetes servicesRajesh Kolla
 
.docker : How to deploy Digital Experience in a container, drinking a cup of ...
.docker : How to deploy Digital Experience in a container, drinking a cup of ....docker : How to deploy Digital Experience in a container, drinking a cup of ...
.docker : How to deploy Digital Experience in a container, drinking a cup of ...ICON UK EVENTS Limited
 
A curtain-raiser to the container world Docker & Kubernetes
A curtain-raiser to the container world Docker & KubernetesA curtain-raiser to the container world Docker & Kubernetes
A curtain-raiser to the container world Docker & KuberneteszekeLabs Technologies
 
C219 - Docker and PureApplication Patterns: Better Together
C219 - Docker and PureApplication Patterns: Better TogetherC219 - Docker and PureApplication Patterns: Better Together
C219 - Docker and PureApplication Patterns: Better TogetherHendrik van Run
 

Similar to Rome .NET Conference 2024 - Remote Conference (20)

Rails Applications with Docker
Rails Applications with DockerRails Applications with Docker
Rails Applications with Docker
 
IBM Container Service Overview
IBM Container Service OverviewIBM Container Service Overview
IBM Container Service Overview
 
Microservices in Java
Microservices in JavaMicroservices in Java
Microservices in Java
 
Docker dev ops for cd meetup 12-14
Docker dev ops for cd meetup 12-14Docker dev ops for cd meetup 12-14
Docker dev ops for cd meetup 12-14
 
Dockerization of Azure Platform
Dockerization of Azure PlatformDockerization of Azure Platform
Dockerization of Azure Platform
 
IBM Cloud UCC Talk, 22nd November 2017
IBM Cloud UCC Talk, 22nd November 2017IBM Cloud UCC Talk, 22nd November 2017
IBM Cloud UCC Talk, 22nd November 2017
 
Docker and Microsoft - Windows Server 2016 Technical Deep Dive
Docker and Microsoft - Windows Server 2016 Technical Deep DiveDocker and Microsoft - Windows Server 2016 Technical Deep Dive
Docker and Microsoft - Windows Server 2016 Technical Deep Dive
 
Introduction to Docker - VIT Campus
Introduction to Docker - VIT CampusIntroduction to Docker - VIT Campus
Introduction to Docker - VIT Campus
 
Introduction to Docker - Vellore Institute of Technology
Introduction to Docker - Vellore Institute of TechnologyIntroduction to Docker - Vellore Institute of Technology
Introduction to Docker - Vellore Institute of Technology
 
K8sfor dev parisoss-summit-microsoft-5-decembre-short
K8sfor dev parisoss-summit-microsoft-5-decembre-shortK8sfor dev parisoss-summit-microsoft-5-decembre-short
K8sfor dev parisoss-summit-microsoft-5-decembre-short
 
HPC Cloud Burst Using Docker
HPC Cloud Burst Using DockerHPC Cloud Burst Using Docker
HPC Cloud Burst Using Docker
 
Container orchestration k8s azure kubernetes services
Container orchestration  k8s azure kubernetes servicesContainer orchestration  k8s azure kubernetes services
Container orchestration k8s azure kubernetes services
 
.docker : How to deploy Digital Experience in a container, drinking a cup of ...
.docker : How to deploy Digital Experience in a container, drinking a cup of ....docker : How to deploy Digital Experience in a container, drinking a cup of ...
.docker : How to deploy Digital Experience in a container, drinking a cup of ...
 
Overview of Docker
Overview of DockerOverview of Docker
Overview of Docker
 
Docker for Developers
Docker for DevelopersDocker for Developers
Docker for Developers
 
Demystifying Docker101
Demystifying Docker101Demystifying Docker101
Demystifying Docker101
 
Demystifying Docker
Demystifying DockerDemystifying Docker
Demystifying Docker
 
A curtain-raiser to the container world Docker & Kubernetes
A curtain-raiser to the container world Docker & KubernetesA curtain-raiser to the container world Docker & Kubernetes
A curtain-raiser to the container world Docker & Kubernetes
 
Docker
DockerDocker
Docker
 
C219 - Docker and PureApplication Patterns: Better Together
C219 - Docker and PureApplication Patterns: Better TogetherC219 - Docker and PureApplication Patterns: Better Together
C219 - Docker and PureApplication Patterns: Better Together
 

More from Hamida Rebai Trabelsi

APIs In Action -Harnessing the Power of Azure API Management: Building Robust...
APIs In Action -Harnessing the Power of Azure API Management: Building Robust...APIs In Action -Harnessing the Power of Azure API Management: Building Robust...
APIs In Action -Harnessing the Power of Azure API Management: Building Robust...Hamida Rebai Trabelsi
 
Azure Spring Clean 2024 event - Azure API Management: Architecting for Perfor...
Azure Spring Clean 2024 event - Azure API Management: Architecting for Perfor...Azure Spring Clean 2024 event - Azure API Management: Architecting for Perfor...
Azure Spring Clean 2024 event - Azure API Management: Architecting for Perfor...Hamida Rebai Trabelsi
 
Streamlining Workflows: Unleashing Automation with Azure and Power Automate
Streamlining Workflows: Unleashing Automation with Azure and Power AutomateStreamlining Workflows: Unleashing Automation with Azure and Power Automate
Streamlining Workflows: Unleashing Automation with Azure and Power AutomateHamida Rebai Trabelsi
 
Configurer GitHub Actions avec Docker et DotNET 8.pdf
Configurer GitHub Actions avec Docker et DotNET 8.pdfConfigurer GitHub Actions avec Docker et DotNET 8.pdf
Configurer GitHub Actions avec Docker et DotNET 8.pdfHamida Rebai Trabelsi
 
Conteneuriser une application .NET 8 en utilisant Docker et Azure.pdf
Conteneuriser une application .NET 8 en utilisant Docker et Azure.pdfConteneuriser une application .NET 8 en utilisant Docker et Azure.pdf
Conteneuriser une application .NET 8 en utilisant Docker et Azure.pdfHamida Rebai Trabelsi
 
Les nouveautés de Xamarin et Visual Studio App Center
Les nouveautés de Xamarin et Visual Studio App CenterLes nouveautés de Xamarin et Visual Studio App Center
Les nouveautés de Xamarin et Visual Studio App CenterHamida Rebai Trabelsi
 
White Paper : ASP.NET Core AngularJs 2 and Prime
White Paper : ASP.NET Core AngularJs 2 and PrimeWhite Paper : ASP.NET Core AngularJs 2 and Prime
White Paper : ASP.NET Core AngularJs 2 and PrimeHamida Rebai Trabelsi
 
C# Fundamentals for Absolute Beginners
C# Fundamentals for Absolute BeginnersC# Fundamentals for Absolute Beginners
C# Fundamentals for Absolute BeginnersHamida Rebai Trabelsi
 
Preparing for Exam MTA 98-375 HTML5 App Development
Preparing for Exam MTA 98-375 HTML5 App DevelopmentPreparing for Exam MTA 98-375 HTML5 App Development
Preparing for Exam MTA 98-375 HTML5 App DevelopmentHamida Rebai Trabelsi
 
Microsoft Azure Fundamentals Websites
Microsoft Azure Fundamentals WebsitesMicrosoft Azure Fundamentals Websites
Microsoft Azure Fundamentals WebsitesHamida Rebai Trabelsi
 

More from Hamida Rebai Trabelsi (20)

APIs In Action -Harnessing the Power of Azure API Management: Building Robust...
APIs In Action -Harnessing the Power of Azure API Management: Building Robust...APIs In Action -Harnessing the Power of Azure API Management: Building Robust...
APIs In Action -Harnessing the Power of Azure API Management: Building Robust...
 
Azure Spring Clean 2024 event - Azure API Management: Architecting for Perfor...
Azure Spring Clean 2024 event - Azure API Management: Architecting for Perfor...Azure Spring Clean 2024 event - Azure API Management: Architecting for Perfor...
Azure Spring Clean 2024 event - Azure API Management: Architecting for Perfor...
 
Streamlining Workflows: Unleashing Automation with Azure and Power Automate
Streamlining Workflows: Unleashing Automation with Azure and Power AutomateStreamlining Workflows: Unleashing Automation with Azure and Power Automate
Streamlining Workflows: Unleashing Automation with Azure and Power Automate
 
Configurer GitHub Actions avec Docker et DotNET 8.pdf
Configurer GitHub Actions avec Docker et DotNET 8.pdfConfigurer GitHub Actions avec Docker et DotNET 8.pdf
Configurer GitHub Actions avec Docker et DotNET 8.pdf
 
Conteneuriser une application .NET 8 en utilisant Docker et Azure.pdf
Conteneuriser une application .NET 8 en utilisant Docker et Azure.pdfConteneuriser une application .NET 8 en utilisant Docker et Azure.pdf
Conteneuriser une application .NET 8 en utilisant Docker et Azure.pdf
 
TechDayConf Edition 1 - 2020
TechDayConf Edition 1 -  2020TechDayConf Edition 1 -  2020
TechDayConf Edition 1 - 2020
 
Les nouveautés de Xamarin et Visual Studio App Center
Les nouveautés de Xamarin et Visual Studio App CenterLes nouveautés de Xamarin et Visual Studio App Center
Les nouveautés de Xamarin et Visual Studio App Center
 
Xamarin notes- en français
Xamarin notes- en françaisXamarin notes- en français
Xamarin notes- en français
 
Advices before starting a project
Advices before starting a projectAdvices before starting a project
Advices before starting a project
 
White Paper : ASP.NET Core AngularJs 2 and Prime
White Paper : ASP.NET Core AngularJs 2 and PrimeWhite Paper : ASP.NET Core AngularJs 2 and Prime
White Paper : ASP.NET Core AngularJs 2 and Prime
 
Certification Digital Active
Certification Digital ActiveCertification Digital Active
Certification Digital Active
 
Resume-REBAI.json
Resume-REBAI.jsonResume-REBAI.json
Resume-REBAI.json
 
Présentation- Communauté
Présentation- CommunautéPrésentation- Communauté
Présentation- Communauté
 
Detailed-Resume-Rebai-Hamida
Detailed-Resume-Rebai-HamidaDetailed-Resume-Rebai-Hamida
Detailed-Resume-Rebai-Hamida
 
CV REBAI Hamida
CV REBAI HamidaCV REBAI Hamida
CV REBAI Hamida
 
TechWadi-MENA-Guide-to-GES-2016-vf
TechWadi-MENA-Guide-to-GES-2016-vfTechWadi-MENA-Guide-to-GES-2016-vf
TechWadi-MENA-Guide-to-GES-2016-vf
 
C# Fundamentals for Absolute Beginners
C# Fundamentals for Absolute BeginnersC# Fundamentals for Absolute Beginners
C# Fundamentals for Absolute Beginners
 
Preparing for Exam MTA 98-375 HTML5 App Development
Preparing for Exam MTA 98-375 HTML5 App DevelopmentPreparing for Exam MTA 98-375 HTML5 App Development
Preparing for Exam MTA 98-375 HTML5 App Development
 
Microsoft Azure Fundamentals
Microsoft Azure FundamentalsMicrosoft Azure Fundamentals
Microsoft Azure Fundamentals
 
Microsoft Azure Fundamentals Websites
Microsoft Azure Fundamentals WebsitesMicrosoft Azure Fundamentals Websites
Microsoft Azure Fundamentals Websites
 

Recently uploaded

Are Multi-Cloud and Serverless Good or Bad?
Are Multi-Cloud and Serverless Good or Bad?Are Multi-Cloud and Serverless Good or Bad?
Are Multi-Cloud and Serverless Good or Bad?Mattias Andersson
 
Anypoint Exchange: It’s Not Just a Repo!
Anypoint Exchange: It’s Not Just a Repo!Anypoint Exchange: It’s Not Just a Repo!
Anypoint Exchange: It’s Not Just a Repo!Manik S Magar
 
Story boards and shot lists for my a level piece
Story boards and shot lists for my a level pieceStory boards and shot lists for my a level piece
Story boards and shot lists for my a level piececharlottematthew16
 
My INSURER PTE LTD - Insurtech Innovation Award 2024
My INSURER PTE LTD - Insurtech Innovation Award 2024My INSURER PTE LTD - Insurtech Innovation Award 2024
My INSURER PTE LTD - Insurtech Innovation Award 2024The Digital Insurer
 
Gen AI in Business - Global Trends Report 2024.pdf
Gen AI in Business - Global Trends Report 2024.pdfGen AI in Business - Global Trends Report 2024.pdf
Gen AI in Business - Global Trends Report 2024.pdfAddepto
 
DevoxxFR 2024 Reproducible Builds with Apache Maven
DevoxxFR 2024 Reproducible Builds with Apache MavenDevoxxFR 2024 Reproducible Builds with Apache Maven
DevoxxFR 2024 Reproducible Builds with Apache MavenHervé Boutemy
 
Training state-of-the-art general text embedding
Training state-of-the-art general text embeddingTraining state-of-the-art general text embedding
Training state-of-the-art general text embeddingZilliz
 
"LLMs for Python Engineers: Advanced Data Analysis and Semantic Kernel",Oleks...
"LLMs for Python Engineers: Advanced Data Analysis and Semantic Kernel",Oleks..."LLMs for Python Engineers: Advanced Data Analysis and Semantic Kernel",Oleks...
"LLMs for Python Engineers: Advanced Data Analysis and Semantic Kernel",Oleks...Fwdays
 
"Subclassing and Composition – A Pythonic Tour of Trade-Offs", Hynek Schlawack
"Subclassing and Composition – A Pythonic Tour of Trade-Offs", Hynek Schlawack"Subclassing and Composition – A Pythonic Tour of Trade-Offs", Hynek Schlawack
"Subclassing and Composition – A Pythonic Tour of Trade-Offs", Hynek SchlawackFwdays
 
AI as an Interface for Commercial Buildings
AI as an Interface for Commercial BuildingsAI as an Interface for Commercial Buildings
AI as an Interface for Commercial BuildingsMemoori
 
Commit 2024 - Secret Management made easy
Commit 2024 - Secret Management made easyCommit 2024 - Secret Management made easy
Commit 2024 - Secret Management made easyAlfredo García Lavilla
 
Tampa BSides - Chef's Tour of Microsoft Security Adoption Framework (SAF)
Tampa BSides - Chef's Tour of Microsoft Security Adoption Framework (SAF)Tampa BSides - Chef's Tour of Microsoft Security Adoption Framework (SAF)
Tampa BSides - Chef's Tour of Microsoft Security Adoption Framework (SAF)Mark Simos
 
"Debugging python applications inside k8s environment", Andrii Soldatenko
"Debugging python applications inside k8s environment", Andrii Soldatenko"Debugging python applications inside k8s environment", Andrii Soldatenko
"Debugging python applications inside k8s environment", Andrii SoldatenkoFwdays
 
WordPress Websites for Engineers: Elevate Your Brand
WordPress Websites for Engineers: Elevate Your BrandWordPress Websites for Engineers: Elevate Your Brand
WordPress Websites for Engineers: Elevate Your Brandgvaughan
 
Search Engine Optimization SEO PDF for 2024.pdf
Search Engine Optimization SEO PDF for 2024.pdfSearch Engine Optimization SEO PDF for 2024.pdf
Search Engine Optimization SEO PDF for 2024.pdfRankYa
 
New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024
New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024
New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024BookNet Canada
 
Artificial intelligence in cctv survelliance.pptx
Artificial intelligence in cctv survelliance.pptxArtificial intelligence in cctv survelliance.pptx
Artificial intelligence in cctv survelliance.pptxhariprasad279825
 
Transcript: New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024
Transcript: New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024Transcript: New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024
Transcript: New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024BookNet Canada
 

Recently uploaded (20)

Are Multi-Cloud and Serverless Good or Bad?
Are Multi-Cloud and Serverless Good or Bad?Are Multi-Cloud and Serverless Good or Bad?
Are Multi-Cloud and Serverless Good or Bad?
 
Anypoint Exchange: It’s Not Just a Repo!
Anypoint Exchange: It’s Not Just a Repo!Anypoint Exchange: It’s Not Just a Repo!
Anypoint Exchange: It’s Not Just a Repo!
 
Story boards and shot lists for my a level piece
Story boards and shot lists for my a level pieceStory boards and shot lists for my a level piece
Story boards and shot lists for my a level piece
 
My INSURER PTE LTD - Insurtech Innovation Award 2024
My INSURER PTE LTD - Insurtech Innovation Award 2024My INSURER PTE LTD - Insurtech Innovation Award 2024
My INSURER PTE LTD - Insurtech Innovation Award 2024
 
Gen AI in Business - Global Trends Report 2024.pdf
Gen AI in Business - Global Trends Report 2024.pdfGen AI in Business - Global Trends Report 2024.pdf
Gen AI in Business - Global Trends Report 2024.pdf
 
DevoxxFR 2024 Reproducible Builds with Apache Maven
DevoxxFR 2024 Reproducible Builds with Apache MavenDevoxxFR 2024 Reproducible Builds with Apache Maven
DevoxxFR 2024 Reproducible Builds with Apache Maven
 
Training state-of-the-art general text embedding
Training state-of-the-art general text embeddingTraining state-of-the-art general text embedding
Training state-of-the-art general text embedding
 
"LLMs for Python Engineers: Advanced Data Analysis and Semantic Kernel",Oleks...
"LLMs for Python Engineers: Advanced Data Analysis and Semantic Kernel",Oleks..."LLMs for Python Engineers: Advanced Data Analysis and Semantic Kernel",Oleks...
"LLMs for Python Engineers: Advanced Data Analysis and Semantic Kernel",Oleks...
 
"Subclassing and Composition – A Pythonic Tour of Trade-Offs", Hynek Schlawack
"Subclassing and Composition – A Pythonic Tour of Trade-Offs", Hynek Schlawack"Subclassing and Composition – A Pythonic Tour of Trade-Offs", Hynek Schlawack
"Subclassing and Composition – A Pythonic Tour of Trade-Offs", Hynek Schlawack
 
AI as an Interface for Commercial Buildings
AI as an Interface for Commercial BuildingsAI as an Interface for Commercial Buildings
AI as an Interface for Commercial Buildings
 
Commit 2024 - Secret Management made easy
Commit 2024 - Secret Management made easyCommit 2024 - Secret Management made easy
Commit 2024 - Secret Management made easy
 
Tampa BSides - Chef's Tour of Microsoft Security Adoption Framework (SAF)
Tampa BSides - Chef's Tour of Microsoft Security Adoption Framework (SAF)Tampa BSides - Chef's Tour of Microsoft Security Adoption Framework (SAF)
Tampa BSides - Chef's Tour of Microsoft Security Adoption Framework (SAF)
 
"Debugging python applications inside k8s environment", Andrii Soldatenko
"Debugging python applications inside k8s environment", Andrii Soldatenko"Debugging python applications inside k8s environment", Andrii Soldatenko
"Debugging python applications inside k8s environment", Andrii Soldatenko
 
WordPress Websites for Engineers: Elevate Your Brand
WordPress Websites for Engineers: Elevate Your BrandWordPress Websites for Engineers: Elevate Your Brand
WordPress Websites for Engineers: Elevate Your Brand
 
Search Engine Optimization SEO PDF for 2024.pdf
Search Engine Optimization SEO PDF for 2024.pdfSearch Engine Optimization SEO PDF for 2024.pdf
Search Engine Optimization SEO PDF for 2024.pdf
 
New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024
New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024
New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024
 
Artificial intelligence in cctv survelliance.pptx
Artificial intelligence in cctv survelliance.pptxArtificial intelligence in cctv survelliance.pptx
Artificial intelligence in cctv survelliance.pptx
 
E-Vehicle_Hacking_by_Parul Sharma_null_owasp.pptx
E-Vehicle_Hacking_by_Parul Sharma_null_owasp.pptxE-Vehicle_Hacking_by_Parul Sharma_null_owasp.pptx
E-Vehicle_Hacking_by_Parul Sharma_null_owasp.pptx
 
DMCC Future of Trade Web3 - Special Edition
DMCC Future of Trade Web3 - Special EditionDMCC Future of Trade Web3 - Special Edition
DMCC Future of Trade Web3 - Special Edition
 
Transcript: New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024
Transcript: New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024Transcript: New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024
Transcript: New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024
 

Rome .NET Conference 2024 - Remote Conference

  • 2. Optimizing .NET 8 Applications with Docker and Azure: A Comprehensive Guide Hamida Rebaï - Cloud Solutions Architect – Microsoft MVP
  • 3. Agenda • Overview of .NET 8 • Introduction to Docker Containers • Integrating .NET 8 with Docker • Deploying .NET 8 Applications to Azure
  • 4. Overview of .NET 8 Hamida Rebai
  • 5. .NET 8 New Features • Performance Improvements: Over 1,250 performance improvements, particularly in JSON API scenarios and realistic workloads with database access. • ASP.NET Core Enhancements: ASP.NET Core in .NET 8 offers extended capabilities for modern web application development, with enhanced tools for server-side rendering and client-side interactivity. • Blazor and WebAssembly: Blazor in .NET 8 includes improved server-side rendering and increased interactivity with WebAssembly. Components render 20% faster, and new web packaging features are introduced. • C# 12 New Features: Features such as primary constructors and collection expressions are added, improving code readability and simplicity. • Development Tools: New tools in Visual Studio and Visual Studio Code are introduced to enhance the development experience, including improvements for routing, debugging, and API testing.
  • 6. • Reference Architecture eShop: A comprehensive reference application, eShop, is showcased, utilizing a cloud-native microservices architecture and highlighting the new capabilities of .NET 8. • Full-Stack Application Development: .NET 8 emphasizes ease of development for full-stack web applications, with improvements for both backend and frontend developers. • Security and Performance Enhancements: ASP.NET Core is designed with a focus on security and optimized for performance, enabling efficient handling of various scenarios. • Cloud-Native and Mobile Development: .NET 8 continues to evolve as a preferred platform for cloud-native and mobile development. • Community and Contribution: .NET 8 has benefited from strong community contribution, reflecting its growing adoption and impact in the world of software development.
  • 8. What is Containerization? • Containerization streamlines software development by packaging applications, dependencies, and configurations into a single container image. • The containerized application can be tested and deployed as a unified unit to the host operating system (OS). • Analogous to shipping containers, which standardize cargo transportation, software containers offer a consistent deployment unit for diverse code and dependencies. • Containerization facilitates seamless deployment across various environments with minimal adjustments. • Containers provide application isolation within a shared OS environment. • Containerized applications operate atop a container host, enhancing efficiency and resource utilization. • Compared to virtual machines (VMs), containers offer a significantly reduced footprint, optimizing resource allocation.
  • 9. Docker architecture App App Docker Engine App Host OS Server
  • 10. Docker Images ● Snapshot in other types of VM environments. ● Record of a Docker container at a specific point in time. ● Image can’t be changed, it can be duplicated, shared, or deleted. Docker Container ● Virtualized runtime environment used in application development. ● Can use just one machine, share its kernel and virtualize the OS to run more isolated processes. ● Docker containers are lightweight Image Source and Credits: http://blog.bigstep.com/developers-love-docker/
  • 11. Run a container from an image • Develop your application. • Package the application and its dependencies into an image. • Optionally, store the image in a registry. • Execute the application by running it as a container. App Develop Build Image Ship Registry Container Run
  • 12. Dockerfile Docker Image Build Run Docker Container
  • 13. Dockerfile FROM mcr.microsoft.com/dotnet/sdk:8.0 AS build WORKDIR /src 1 COPY ["mysolution.csproj", « mysolution/"] RUN dotnet restore « mysolution.csproj" 2 COPY . . WORKDIR "/src/mysolution" RUN dotnet build “mysolution.csproj" -c Release -o /app/build 3 Specify image Copy project file Copy and Build Build runtime image FROM mcr.microsoft.com/dotnet/aspnet:8.0 AS base WORKDIR /app COPY --from=build /app/publish . 4
  • 14. Dockerfile Starting the app 5 ENTRYPOINT ["dotnet", « yousolution.dll"] Build our image & start container docker build -t yoursolutionimage:1.0 . Create and run our container docker run –d -p 8080:80 -ti –name myapp --rm yousolutionimage:1.0
  • 16. DEMO
  • 17. Prerequisites • Install Docker Desktop it is free, it is available for Mac and Windows. • Docker Hub account, it is free. • Install Visual Studio 2019 or 2022 or Visual Studio Code. • Azure account where we are able to create an azure container registry • PowerShell in Windows or Azure Cloud Shell. • If you are using Visual Studio Code, Microsoft C# for Visual Studio Code, Docker and Azure App Service extensions must be installed.
  • 18. Demonstration flow Tag the image locally Using Visual Studio or Docker command line Azure Container registry is a private registry Docker Hub to host public images Building a Docker Image Tagging Images Build and Store Images in the Cloud
  • 19.
  • 20. Build and Store Images in Azure Container services Hamida Rebai
  • 21. Build and store images by using Azure Container Registry • What is Container Registry? • Azure service that you can use to create your own private Docker registries. • Similar to Docker Hub but offers a few unique benefits: Container Registry runs in Azure, Container Registry is highly scalable, providing enhanced throughput for Docker pulls that can span many nodes concurrently. • Use Container Registry • Create a registry by using either the Azure portal or the Azure CLI. • Store and host images, and build images.
  • 22. DEMO
  • 23. Container and orchestrator Storage • Azure Container Instance • Azure App Service as a Container • Azure Container Registry More than one container One container • Azure Kubernetes Service • Azure Container App
  • 25. Demo: Build and Store Images by Using Azure Container Registry (ACR) Using Azure Portal ● Create Azure Container Registry from the Portal or from Visual Studio 2022 ● Push the image from Visual Studio 2022
  • 26. Demo: Build and Store Images by Using Azure Container Registry (ACR) Using Azure CLI ● Create Azure Container Registry using Azure CLI ● Push the image from Visual Studio Code az acr create --resource-group dockersamplerg --name acrdemoapp --sku Basic --admin-enabled true
  • 28. Azure Kubernetes Services • Azure Kubernetes Service (AKS) is a managed Kubernetes service that lets you quickly deploy and manage clusters.
  • 29. >_ Create AKS cluster using Azure CLI az aks create --resource-group aksgr --name myAKSCluster --node-count 1 -- generate-ssh-keys -- attach-acr aksprojectcontainer
  • 30. Deploy an Azure Kubernetes Service cluster and run an application using the Azure CLI 1- Open CloudShell My Dashboard — Microsoft Azure and connect to your cluster as bellow: az account set — subscription yoursubscription az aks get-credentials — resource-group aksgr — name myAKSCluster You can find these commands when you open Azure Portal and your cluster:
  • 31. Deploy an Azure Kubernetes Service cluster and run an application using the Azure CLI • 2- Create an empty file called: azure-demo-deployment.yaml • 3- Copy this content to the empty file created, we will describe it after.
  • 32. Deploy an Azure Kubernetes Service cluster and run an application using the Azure CLI apiVersion: apps/v1 kind: Deployment metadata: name: demo-kubernetes-deployment spec: selector: matchLabels: app: demo-kubernetes-pod replicas: 1 template: metadata: labels: app: demo-kubernetes-pod spec: containers: -- name: aksprojectcontainer image: aksprojectcontainer.azurecr.io/aksp roject:latest ports: -- containerPort: 80
  • 33. Deploy an Azure Kubernetes Service cluster and run an application using the Azure CLI 4- Run the application and deploy it in the cluster using the kubectl apply command and specify the name of your YAML manifest. kubectl apply -f azure-demo-deployment.yaml We will use kubectl get deployments to verify if the deployment was created or not. When the application runs, a Kubernetes service exposes the application front end to the internet. This process can take a few minutes to complete. 5- we will use kubectl get service command with the --watch argument. kubectl get service demo-kubernetes-deployment — watch
  • 35. Azure Container App Azure Container Apps is a fully managed environment that enables you to run microservices and containerized applications on a serverless platform. • Provide a serverless hosting service that sits on top of an AKS Service • Deploy multiple containers • Azure Container app do not even expose Kubernetes APIs to the users.