Virtual Machine
- When you deploy a virtual machine, things which get deployed automatically are Virtual Network, NSG, The Disks, The VM, Network interface, Private IP address, Public IP Address
- RDP : 3389
- Inbound port rules: Go to the networking section on left blade. IIS lives on port 80 and protocol TCP
- Port: 8171 as inbound port rule need to allow if you want to publish code on VM using visual studio
- PuTTy: Using this tool we can connect to our Linux based Virtual machine. Use port 22 and SSH key with public IP address.
- ngInx: Linux based webserver like we have IIS on windows machine.
- Generalization of Virtual Machine: Creating your own private image of virtual machine. Once you create a image out of VM that VM can not be further used although the image created out of VM can be used. You need to run sysprep on VM to make ready for image preparation. Now you can create image of VM using the Capture button. This image file(not backup file) will be in Azure blob storage.
- Recovery Services Vault: It must be in same region as your VM. It creates a back of your VM.
- Containers:
- They are consist of OS itself, any important library required to run the application and application code.
- Multiple containers can run on a single VM.
- Size of OS in containers is far less than the size of actual OS which is part of VM. eg. if VM OS size is 1GB than container OS would be around 150MB.
- Containers can be easily moved from one VM to another.
- Docker:
- Its a most common tool set for managing Containers
- It is used to create, deploy and run application on containers.
- You can create a common images like images of common libraries and used it in your containers.
- Azure Container Registry: you can push your application container images to Azure container Registry and re use them later. The docker push command can be used to send images onto the Azure container registry.
- Azure Container Instances:
- This is a service that allows you to deploy container in isolation.
- It means if you have image of your application as a container, Azure container instance can simply run your image in matter of minutes.
- You can persist the data using azure file share.
ARM Templates
- They contain data in JSON format.
- Various sections of ARM templates-
- Resource : used to specify the resource we want to deploy
- Variables : Values that can be used within template.
- Parameters: provide values during deployment phase.
- Output: return values from deployed resources.
--------------------------------------------------------------------------------------------------------------------------
Docker Steps
- The first statement in the Dockefile must be the FROM statement to specify the image to use as the base image.
- Then specify the Image working directory
- Then copy all of the application contents using the COPY command
- then use the CMD command to run the PowerShell command
- and the ENTRYPOINT statement to run the dotnet application.
FROM mcr.microsoft.com/dotnet/core/sdk:3.1
WORKDIR /apps/demoapp
COPY ./.
CMD powershell ./setup.ps1
ENTRYPOINT [“dotnet”,” demoapp.dll”]
--------------------------------------------------------------------------------------------------------------------------
Generalization of Virtual machine (Deep understanding)
Once you run the Sysprep tool to generalize the VM, you can issue the following steps to generalize the VM
// Stop the Virtual Machine
Stop-AzVM -ResourceGroupName $rgName -Name $vmName -Force
// Get a handle to the virtual machine
$vm = Get-AzVM -Name $vmName -ResourceGroupName $rgName
// Create an image configuration
$image = New-AzImageConfig -Location $location -SourceVirtualMachineId $vm.Id
// Create the custom image
New-AzImage -Image $image -ImageName $imageName -ResourceGroupName $rgName

No comments:
Post a Comment