สำหรับอันนี้จะเน้น Recap AZ-900 การใช้ Tools ต่างๆ ได้แก่ Azure portal / Azure Cloud Shell / Azure PowerShell และ Azure CLI
Configure Azure resources with tools
- Azure portal / Azure Cloud Shell / Azure PowerShell (cmdlet verb-Resource เช้่น New-AzVM) / Azure CLI (az command)
- Knowledge check - Training | Microsoft Learn
Use Azure Resource Manager
- resource / resource group / resource provider (มัน namespace {resource-provider}/{resource-type} ex. Microsoft.KeyVault/vaults.) / template + declarative syntax >> ARM Template Lock types
- Read-Only locks, which prevent any changes to the resource.
- Delete locks, which prevent deletion. Reorganize Azure resources >> Move RG / Move Subscription / Move Region 2 อันหลังมีข้อจำกัดแต่ละ Resource / ห้ามมี Dependency disk + VM และระหว่างย้าย RG Lock Remove resources and resource groups
- Remove-AzResourceGroup -Name "ContosoRG01" resource limits ดูจากตรง Usage + Quota
- Knowledge check - Training | Microsoft Learn
Configure resources with Azure Resource Manager templates
- ARM template (JSON) - improve consistency / express complex deployments to correct order / reuse + linkable (แยก Common ARM ให้คนอื่น Ref ไปใช้) / simplify orchestration.
- Schema: Explore the Azure Resource Manager template schema - Training | Microsoft Learn
- 256 parameters in a template
- BICEP เป็นภาษารูปแบบ DSL มันแปลงเป็น ARM Template ได้นะโดยมีจุดที่ดีกว่า Simpler syntax / Modules / Automatic dependency management / Type validation and IntelliSense (VSCode Bicep extension)
- น่าจะเป็นสอบ Lab ได้ Interactive lab simulation - templates - Training | Microsoft Learn
- Configure resources with Azure Resource Manager templates: Knowledge Check
Automate Azure tasks using scripts with PowerShell
- How to Choose an administrative tool >> Automation ? / Learning curve ? / Team skillset ?
- ถ้าใช้ Azure Powershell Required 1.PowerShell 2.Azure Az PowerShell module
- Sample Create Resource with PowerShell
Connect-AzAccount Set-AzContext -Subscription '00000000-0000-0000-0000-000000000000' Get-AzResourceGroup | Format-Table New-AzResourceGroup -Name <name> -Location <location> Get-AzResource #Get-AzResource | Format-Table #Get-AzResource -ResourceGroupName <<YOUR RESOURCE NAME>> #Create VM New-AzVm -ResourceGroupName <resource group name> -Name <machine name> -Credential <credentials object> -Location <location> -Image <image name> #Getting information for a VM $vm = Get-AzVM -Name MyVM -ResourceGroupName ExerciseResources #Update VM Setting $ResourceGroupName = "<<YOUR RESOURCE NAME>> $vm = Get-AzVM -Name MyVM -ResourceGroupName $ResourceGroupName $vm.HardwareProfile.vmSize = "Standard_DS3_v2" Update-AzVM -ResourceGroupName $ResourceGroupName -VM $vm Get-AzPublicIpAddress -ResourceGroupName learn-4875047c-7ef2-49ce-9ccf-1570bee6ee79 -Name "testvm-01" #Delete a VM Stop-AzVM -Name $vm.Name -ResourceGroupName $vm.ResourceGroupName Remove-AzVM -Name $vm.Name -ResourceGroupName $vm.ResourceGroupName #Remove-AzVM command just deletes the VM. It doesn't clean up any of the other resources #ถ้าพลาดไปแล้วลบตามลำดับ ดังนี้ $vm | Remove-AzNetworkInterface –Force Get-AzDisk -ResourceGroupName $vm.ResourceGroupName -DiskName $vm.StorageProfile.OSDisk.Name | Remove-AzDisk -Force Get-AzVirtualNetwork -ResourceGroupName $vm.ResourceGroupName | Remove-AzVirtualNetwork -Force Get-AzNetworkSecurityGroup -ResourceGroupName $vm.ResourceGroupName | Remove-AzNetworkSecurityGroup -Force Get-AzPublicIpAddress -ResourceGroupName $vm.ResourceGroupName | Remove-AzPublicIpAddress -Force
- Automate Azure tasks using scripts with PowerShell: Knowledge Check
Control Azure services with the CLI
Deploy Azure infrastructure by using JSON ARM templates
Discover more from naiwaen@DebuggingSoft
Subscribe to get the latest posts sent to your email.