From cee673c84d1c4ba8d7d3383de804243aec1d8239 Mon Sep 17 00:00:00 2001 From: "Mike F. Robbins" <6719572+mikefrobbins@users.noreply.github.com> Date: Thu, 26 Jun 2025 11:59:36 -0500 Subject: [PATCH] Remove and redirect deprecated tutorial (#3656) --- .openpublishing.redirection.json | 9 +- .../azps-0.10.0/azureps-vm-tutorial.yml | 331 ----------------- .../azps-0.10.0/get-started-azureps.md | 8 +- docs-conceptual/azps-0.10.0/index.yml | 4 - docs-conceptual/azps-0.10.0/toc.yml | 4 - .../azps-12.5.0/azureps-vm-tutorial.yml | 336 ------------------ .../azps-12.5.0/get-started-azureps.md | 2 - docs-conceptual/azps-12.5.0/index.yml | 4 - docs-conceptual/azps-12.5.0/toc.yml | 2 - .../azps-14.0.0/azureps-vm-tutorial.yml | 336 ------------------ .../azps-14.0.0/get-started-azureps.md | 2 - docs-conceptual/azps-14.0.0/index.yml | 4 - docs-conceptual/azps-14.0.0/toc.yml | 2 - .../azps-14.1.0/azureps-vm-tutorial.yml | 336 ------------------ .../azps-14.1.0/get-started-azureps.md | 2 - docs-conceptual/azps-14.1.0/index.yml | 4 - docs-conceptual/azps-14.1.0/toc.yml | 2 - 17 files changed, 8 insertions(+), 1380 deletions(-) delete mode 100644 docs-conceptual/azps-0.10.0/azureps-vm-tutorial.yml delete mode 100644 docs-conceptual/azps-12.5.0/azureps-vm-tutorial.yml delete mode 100644 docs-conceptual/azps-14.0.0/azureps-vm-tutorial.yml delete mode 100644 docs-conceptual/azps-14.1.0/azureps-vm-tutorial.yml diff --git a/.openpublishing.redirection.json b/.openpublishing.redirection.json index 038bb2c11e..65b3827f9a 100644 --- a/.openpublishing.redirection.json +++ b/.openpublishing.redirection.json @@ -1,6 +1,6 @@ { "redirections": [ - { + { "redirect_document_id": false, "redirect_url": "/powershell/azure/", "source_path": "docs-conceptual/azps-14.1.0/overview.md" @@ -74,6 +74,11 @@ "redirect_document_id": false, "redirect_url": "/powershell/azure/overview", "source_path": "docs-conceptual/azuresmps-4.0.0/index.md" + }, + { + "redirect_document_id": false, + "redirect_url": "/training/modules/automate-azure-tasks-with-powershell/", + "source_path": "docs-conceptual/azps-14.1.0/azureps-vm-tutorial.yml" } ] -} \ No newline at end of file +} diff --git a/docs-conceptual/azps-0.10.0/azureps-vm-tutorial.yml b/docs-conceptual/azps-0.10.0/azureps-vm-tutorial.yml deleted file mode 100644 index fc3f3baf83..0000000000 --- a/docs-conceptual/azps-0.10.0/azureps-vm-tutorial.yml +++ /dev/null @@ -1,331 +0,0 @@ -### YamlMime:Tutorial -title: Create virtual machines with the Azure PowerShell -metadata: - title: Create virtual machines with the Azure PowerShell - description: Get started with Azure PowerShell by creating virtual machines. - audience: Developer - level: Beginner - displayType: two-column - interactive: azurepowershell - ms.devlang: powershell - ms.custom: devx-track-azurepowershell - ms.service: azure-powershell - ms.topic: tutorial - clicktale: true -items: - - durationInMinutes: 1 - content: |- - In this tutorial, you learn all of the steps involved in setting up a virtual machine with - Azure PowerShell. The tutorial also covers output queries, Azure resource reuse, and - resource cleanup. - - This tutorial can be completed with the interactive experience offered through Azure Cloud - Shell, or you may [install Azure PowerShell](install-az-ps.md) locally. - - Use **ctrl-shift-v** (**cmd-shift-v** on macOS) to paste tutorial text into Azure Cloud - Shell. - - - durationInMinutes: 1 - title: Sign in - content: |- - If you're using a local install of the Azure PowerShell, you need to sign in before - performing any other steps. - - ```azurepowershell-interactive - Connect-AzAccount - ``` - - Complete the sign in process by following the steps displayed in your terminal. - - - durationInMinutes: 1 - title: Create a resource group - content: |- - In Azure, all resources are allocated in a resource management group. Resource groups - provide logical groupings of resources that make them easier to work with as a collection. - For this tutorial, all of the created resources go into a single group named - `TutorialResources`. - - ```azurepowershell-interactive - New-AzResourceGroup -Name TutorialResources -Location eastus - ``` - - ```Output - ResourceGroupName : TutorialResources - Location : eastus - ProvisioningState : Succeeded - Tags : - ResourceId : /subscriptions/XXXXXXXX-XXXX-XXXX-XXXX-XXXXXXXXXXXX/resourceGroups/TutorialResources - ``` - - - durationInMinutes: 1 - title: Create admin credentials for the VM - content: |- - Before you can create a new virtual machine, you must create a credential object containing - the username and password for the administrator account of the Windows VM. - - ```azurepowershell-interactive - $cred = Get-Credential -Message "Enter a username and password for the virtual machine." - ``` - - Enter the username and password when prompted. The resulting credential object is passed as - a parameter in the next step. - - ```Output - Windows PowerShell credential request. - Enter a username and password for the virtual machine. - User: tutorAdmin - Password for user tutorAdmin: ********* - ``` - - - durationInMinutes: 4 - title: Create a virtual machine - content: |- - Virtual machines in Azure have a large number of dependencies. The Azure PowerShell creates - these resources for you based on the command-line arguments you specify. For readability, we - are using [PowerShell splatting](/powershell/module/microsoft.powershell.core/about/about_splatting) - to pass parameters to the Azure PowerShell cmdlets. - - Create a new virtual machine running Windows. - - ```azurepowershell-interactive - $vmParams = @{ - ResourceGroupName = 'TutorialResources' - Name = 'TutorialVM1' - Location = 'eastus' - ImageName = 'Win2016Datacenter' - PublicIpAddressName = 'tutorialPublicIp' - Credential = $cred - OpenPorts = 3389 - } - $newVM1 = New-AzVM @vmParams - ``` - As the VM is created, you see the parameter values used and Azure resources being created. - PowerShell will displace a progress bar as shown below. - - ```Output - Creating Azure resources - 39% \ - [ooooooooooooooooooooooooooooooooooo ] - - Creating TutorialVM1 virtual machine. - ``` - - Once the VM is ready, we can view the results in the Azure Portal or by inspecting the - \$newVM1 variable. - - ```azurepowershell-interactive - $newVM1 - ``` - - ```Output - ResourceGroupName : TutorialResources - Id : /subscriptions/XXXXXXXX-XXXX-XXXX-XXXX-XXXXXXXXXXXX/resourceGroups/TutorialResources/providers/Microsoft.Compute/virtualMachines/TutorialVM1 - VmId : 12345678-9abc-def0-1234-56789abcedf0 - Name : TutorialVM1 - Type : Microsoft.Compute/virtualMachines - Location : eastus - Tags : {} - HardwareProfile : {VmSize} - NetworkProfile : {NetworkInterfaces} - OSProfile : {ComputerName, AdminUsername, WindowsConfiguration, Secrets} - ProvisioningState : Succeeded - StorageProfile : {ImageReference, OsDisk, DataDisks} - ``` - - Property values listed inside of braces are nested objects. In the next step we will show you - how to view specific values in these nested objects. - - - durationInMinutes: 5 - title: Get VM information with queries - content: |- - Let's get some more detailed information from the VM we just created. In this example, we verify - the Name of the VM and the admin account we created. - - ```azurepowershell-interactive - $newVM1.OSProfile | Select-Object ComputerName,AdminUserName - ``` - - ```Output - ComputerName AdminUsername - ------------ ------------- - TutorialVM1 tutorialAdmin - ``` - - We can use other Azure PowerShell commands to get specific information about the network - configuration. - - ```azurepowershell-interactive - $newVM1 | Get-AzNetworkInterface | - Select-Object -ExpandProperty IpConfigurations | - Select-Object Name,PrivateIpAddress - ``` - - In this example we are using the PowerShell pipeline to send the \$newVM1 object to the - `Get-AzNetworkInterface` cmdlet. From the resulting network interface object we are - selecting the nested IpConfigurations object. From the IpConfigurations object we are - selecting the Name and PrivateIpAddress properties. - - ```Output - Name PrivateIpAddress - ---- ---------------- - TutorialVM1 192.168.1.4 - ``` - - To confirm that the VM is running, we need to connect via Remote Desktop. For that, we need - to know the Public IP address. - - ```azurepowershell-interactive - $publicIp = Get-AzPublicIpAddress -Name tutorialPublicIp -ResourceGroupName TutorialResources - - $publicIp | Select-Object Name,IpAddress,@{label='FQDN';expression={$_.DnsSettings.Fqdn}} - ``` - - In this example, we use the `Get-AzPublicIpAddress` and store the results in the - \$publicIp variable. From this variable we are selecting properties and using an expression - to retrieve the nested Fqdn property. - - ```Output - Name IpAddress FQDN - ---- --------- ---- - tutorialPublicIp tutorialvm1-8a0999.eastus.cloudapp.azure.com - ``` - - From your local machine you can run the following command to connect to the VM over Remote - Desktop. - - ```powershell-interactive - mstsc.exe /v - ``` - - For more information about querying for object properties, see - [Querying for Azure resources](./queries-azureps.md). - - - durationInMinutes: 4 - title: Creating a new VM on the existing subnet - content: |- - The second VM uses the existing subnet. - - ```azurepowershell-interactive - $vm2Params = @{ - ResourceGroupName = 'TutorialResources' - Name = 'TutorialVM2' - ImageName = 'Win2016Datacenter' - VirtualNetworkName = 'TutorialVM1' - SubnetName = 'TutorialVM1' - PublicIpAddressName = 'tutorialPublicIp2' - Credential = $cred - OpenPorts = 3389 - } - $newVM2 = New-AzVM @vm2Params - - $newVM2 - ``` - - ```Output - ResourceGroupName : TutorialResources - Id : /subscriptions/XXXXXXXX-XXXX-XXXX-XXXX-XXXXXXXXXXXX/resourceGroups/TutorialResources/providers/Microsoft.Compute/virtualMachines/TutorialVM2 - VmId : 12345678-9abc-def0-1234-56789abcedf1 - Name : TutorialVM2 - Type : Microsoft.Compute/virtualMachines - Location : eastus - Tags : {} - HardwareProfile : {VmSize} - NetworkProfile : {NetworkInterfaces} - OSProfile : {ComputerName, AdminUsername, WindowsConfiguration, Secrets} - ProvisioningState : Succeeded - StorageProfile : {ImageReference, OsDisk, DataDisks} - FullyQualifiedDomainName : tutorialvm2-dfa5af.eastus.cloudapp.azure.com - ``` - - You can skip a few steps to get the public IP address of the new VM since it's returned in - the FullyQualifiedDomainName property of the \$newVM2 object. Use the following command to - connect using Remote Desktop. - - ```powershell-interactive - mstsc.exe /v $newVM2.FullyQualifiedDomainName - ``` - - - durationInMinutes: 4 - title: Cleanup - content: |- - Now that the tutorial is complete, it's time to clean up the created resources. You can - delete individual resources with the `Remove-AzResource` command, but the safest way - to remove all resources in a resource group is delete the group using the - `Remove-AzResourceGroup` command. - - ```azurepowershell-interactive - $job = Remove-AzResourceGroup -Name TutorialResources -Force -AsJob - - $job - ``` - - ```Output - Id Name PSJobTypeName State HasMoreData Location Command - -- ---- ------------- ----- ----------- -------- ------- - 1 Long Running... AzureLongRun... Running True localhost Remove-AzResource... - ``` - - This command deletes the resources created during the tutorial, and is guaranteed to deallocate - them in the correct order. The `-AsJob` parameter keeps PowerShell from blocking while the - deletion takes place. To wait until the deletion is complete, use the following command: - - ```powershell-interactive - Wait-Job -Id $job.Id - ``` - - With cleanup completed, the tutorial is finished. Continue on for a summary of everything - you learned and links to resources that will help you with your next steps. - - - durationInMinutes: 1 - title: Summary - content: |- - - Congratulations! You learned how to create VMs with new or existing resources, used - expressions and other Azure PowerShell commands to capture data to be stored in shell - variables, and looked at some of the resources that get created for Azure VMs. - - Where you go from here depends on how you plan to use Azure PowerShell. There are a variety - of materials that go further in depth on the features covered in this tutorial. - - ### In-depth Azure PowerShell documentation - - You might want to take time to explore the complete - [Azure PowerShell documentation](/powershell/azure/new-azureps-module-az?view=azps-0.10.0) set. - - For more information about the commands used in this tutorial, see the following articles. - - - [New-AzResourceGroup](/powershell/module/Az.resources/new-Azresourcegroup) - - [Get-Credential](/powershell/module/microsoft.powershell.security/get-credential) - - [New-AzVM](/powershell/module/Az.compute/new-Azvm) - - [Select-Object](/powershell/module/microsoft.powershell.utility/select-object) - - [Get-AzPublicIpAddress](/powershell/module/Az.network/get-AzPublicIpAddress) - - [Remove-AzResourceGroup](/powershell/module/Az.resources/Remove-AzResourceGroup) - - [Wait-Job](/powershell/module/microsoft.powershell.core/wait-job) - - There are also articles that go deeper into the features that were shown in the tutorial. - - - [PowerShell splatting](/powershell/module/microsoft.powershell.core/about/about_splatting) - - [Queries](queries-azureps.md) - - [Formatting](formatting-output.md) - - [Using PowerShell jobs](using-psjobs.md) - - ### Sample scripts - - If you want to get started right away with specific tasks, look at some sample scripts. - - - [Linux Virtual Machines](/azure/virtual-machines/linux/powershell-samples?toc=%2fpowershell%2fmodule%2ftoc.json) - - [Windows Virtual Machines](/azure/virtual-machines/windows/powershell-samples?toc=%2fpowershell%2fmodule%2ftoc.json) - - [Web Apps](/azure/app-service-web/app-service-powershell-samples?toc=%2fpowershell%2fmodule%2ftoc.json) - - [SQL Databases](/azure/sql-database/sql-database-powershell-samples?toc=%2fpowershell%2fmodule%2ftoc.json) - - [Cosmos DB](/azure/cosmos-db/powershell-samples?toc=%2fpowershell%2fmodules%2ftoc.json) - - ### Feedback - - If you'd like to give feedback, suggestions, or ask questions, there are a number of ways - for you to get in touch. - - * `Send-Feedback` is a built-in command for Azure PowerShell that allows you to provide free-form feedback to the team. - * File a feature request or a bug report in the [Azure PowerShell repository](https://github.com/Azure/azure-powershell/issues). - * Ask a question or get clarification by filing an issue in the [Azure PowerShell documentation repository](https://github.com/MicrosoftDocs/azure-docs-powershell/issues). - - We hope that you enjoy using the Azure PowerShell! diff --git a/docs-conceptual/azps-0.10.0/get-started-azureps.md b/docs-conceptual/azps-0.10.0/get-started-azureps.md index 03a42a7b35..9691528d17 100644 --- a/docs-conceptual/azps-0.10.0/get-started-azureps.md +++ b/docs-conceptual/azps-0.10.0/get-started-azureps.md @@ -77,13 +77,7 @@ For a full list of the modules in Azure PowerShell, see the [Azure PowerShell mo ## Learn Azure PowerShell basics with quickstarts and tutorials -To get started with Azure PowerShell, try an in-depth tutorial for setting up virtual machines and -learning how to query them. - -> [!div class="nextstepaction"] -> [Create virtual machines with Azure PowerShell](azureps-vm-tutorial.yml) - -There are also Azure PowerShell quickstarts for other popular Azure services: +There are Azure PowerShell quickstarts for other popular Azure services: * [Create a storage account](/azure/storage/common/storage-quickstart-create-account?tabs=azure-powershell) * [Transfer objects to/from Azure Blob storage](/azure/storage/blobs/storage-quickstart-blobs-powershell) diff --git a/docs-conceptual/azps-0.10.0/index.yml b/docs-conceptual/azps-0.10.0/index.yml index e77eaff6ca..04f283ae58 100644 --- a/docs-conceptual/azps-0.10.0/index.yml +++ b/docs-conceptual/azps-0.10.0/index.yml @@ -51,10 +51,6 @@ landingContent: url: /azure/app-service-web/app-service-powershell-samples?toc=/powershell/azure/toc.json - text: Sample scripts for SQL databases url: /azure/sql-database/sql-database-powershell-samples?toc=/powershell/azure/toc.json - - linkListType: tutorial - links: - - text: Create virtual machines on the same subnet - url: azureps-vm-tutorial.yml - linkListType: learn links: - text: Automate Azure tasks from PowerShell diff --git a/docs-conceptual/azps-0.10.0/toc.yml b/docs-conceptual/azps-0.10.0/toc.yml index 42d75df62d..e0ac5a112c 100644 --- a/docs-conceptual/azps-0.10.0/toc.yml +++ b/docs-conceptual/azps-0.10.0/toc.yml @@ -63,10 +63,6 @@ - name: PowerShell jobs href: using-psjobs.md displayName: background, task, scripting, automation, context, process -- name: Tutorials - items: - - name: Create Virtual Machines - href: azureps-vm-tutorial.yml - name: Sample Scripts items: - name: Linux Virtual Machines diff --git a/docs-conceptual/azps-12.5.0/azureps-vm-tutorial.yml b/docs-conceptual/azps-12.5.0/azureps-vm-tutorial.yml deleted file mode 100644 index 1577e90b2e..0000000000 --- a/docs-conceptual/azps-12.5.0/azureps-vm-tutorial.yml +++ /dev/null @@ -1,336 +0,0 @@ -### YamlMime:Tutorial -title: Create virtual machines with the Azure PowerShell -metadata: - title: Create virtual machines with the Azure PowerShell - description: Get started with Azure PowerShell by creating virtual machines. - audience: Developer - level: Beginner - displayType: two-column - interactive: azurepowershell - ms.devlang: powershell - ms.custom: devx-track-azurepowershell - ms.service: azure-powershell - ms.topic: tutorial - clicktale: true -items: - - durationInMinutes: 1 - content: |- - In this tutorial, you learn all of the steps involved in setting up a virtual machine with - Azure PowerShell. The tutorial also covers output queries, Azure resource reuse, and - resource cleanup. - - This tutorial can be completed with the interactive experience offered through Azure Cloud - Shell, or you may [install Azure PowerShell](install-azure-powershell.md) locally. - - Use **ctrl-shift-v** (**cmd-shift-v** on macOS) to paste tutorial text into Azure Cloud - Shell. - - - durationInMinutes: 1 - title: Sign in - content: |- - If you're using a local install of the Azure PowerShell, you need to sign in before - performing any other steps. - - ```azurepowershell - Connect-AzAccount - ``` - - Complete the sign in process by following the steps displayed in your terminal. - - - durationInMinutes: 1 - title: Create a resource group - content: |- - In Azure, all resources are allocated in a resource management group. Resource groups - provide logical groupings of resources that make them easier to work with as a collection. - For this tutorial, all of the created resources go into a single group named - `TutorialResources`. - - ```azurepowershell-interactive - New-AzResourceGroup -Name TutorialResources -Location eastus - ``` - - ```Output - ResourceGroupName : TutorialResources - Location : eastus - ProvisioningState : Succeeded - Tags : - ResourceId : /subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/TutorialResources - ``` - - - durationInMinutes: 1 - title: Create admin credentials for the VM - content: |- - Before you can create a new virtual machine, you must create a credential object containing - the username and password for the administrator account of the Windows VM. - - ```powershell-interactive - $cred = Get-Credential -Message "Enter a username and password for the virtual machine." - ``` - - Enter the username and password when prompted. The resulting credential object is passed as - a parameter in the next step. - - ```Output - Windows PowerShell credential request. - Enter a username and password for the virtual machine. - User: tutorAdmin - Password for user tutorAdmin: ********* - ``` - - - durationInMinutes: 4 - title: Create a virtual machine - content: |- - Virtual machines in Azure have a large number of dependencies. The Azure PowerShell creates - these resources for you based on the command-line arguments you specify. For readability, we - are using [PowerShell splatting](/powershell/module/microsoft.powershell.core/about/about_splatting) - to pass parameters to the Azure PowerShell cmdlets. - - Create a new virtual machine running Windows. - - ```azurepowershell-interactive - $vmParams = @{ - ResourceGroupName = 'TutorialResources' - Name = 'TutorialVM1' - Location = 'eastus' - ImageName = 'Win2016Datacenter' - PublicIpAddressName = 'tutorialPublicIp' - Credential = $cred - OpenPorts = 3389 - Size = 'Standard_D2s_v3' - } - $newVM1 = New-AzVM @vmParams - ``` - As the VM is created, you see the parameter values used and Azure resources being created. - PowerShell will display a progress bar as shown below. - - ```Output - Creating Azure resources - 39% \ - [ooooooooooooooooooooooooooooooooooo ] - - Creating TutorialVM1 virtual machine. - ``` - - Once the VM is ready, we can view the results in the Azure Portal or by inspecting the - `$newVM1` variable. - - ```azurepowershell-interactive - $newVM1 - ``` - - ```Output - ResourceGroupName : TutorialResources - Id : /subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/TutorialResources/providers/Microsoft.Compute/virtualMachines/TutorialVM1 - VmId : 00000000-0000-0000-0000-000000000000 - Name : TutorialVM1 - Type : Microsoft.Compute/virtualMachines - Location : eastus - Tags : {} - HardwareProfile : {VmSize} - NetworkProfile : {NetworkInterfaces} - OSProfile : {ComputerName, AdminUsername, WindowsConfiguration, Secrets} - ProvisioningState : Succeeded - StorageProfile : {ImageReference, OsDisk, DataDisks} - ``` - - Property values listed inside of braces are nested objects. In the next step we will show you - how to view specific values in these nested objects. - - - durationInMinutes: 5 - title: Get VM information with queries - content: |- - Let's get some more detailed information from the VM we just created. In this example, we verify - the Name of the VM and the admin account we created. - - ```azurepowershell-interactive - $newVM1.OSProfile | Select-Object -Property ComputerName, AdminUserName - ``` - - ```Output - ComputerName AdminUsername - ------------ ------------- - TutorialVM1 tutorialAdmin - ``` - - We can use other Azure PowerShell commands to get specific information about the network - configuration. - - ```azurepowershell-interactive - $newVM1 | Get-AzNetworkInterface | - Select-Object -ExpandProperty IpConfigurations | - Select-Object -Property Name, PrivateIpAddress - ``` - - In this example we are using the PowerShell pipeline to send the \$newVM1 object to the - `Get-AzNetworkInterface` cmdlet. From the resulting network interface object we are - selecting the nested IpConfigurations object. From the IpConfigurations object we are - selecting the Name and PrivateIpAddress properties. - - ```Output - Name PrivateIpAddress - ---- ---------------- - TutorialVM1 192.168.1.4 - ``` - - To confirm that the VM is running, we need to connect via Remote Desktop. For that, we need - to know the Public IP address. - - ```azurepowershell-interactive - $publicIp = Get-AzPublicIpAddress -Name tutorialPublicIp -ResourceGroupName TutorialResources - - $publicIp | - Select-Object -Property Name, IpAddress, @{label='FQDN';expression={$_.DnsSettings.Fqdn}} - ``` - - In this example, we use the `Get-AzPublicIpAddress` and store the results in the `$publicIp` - variable. From this variable we are selecting properties and using an expression to retrieve - the nested Fqdn property. - - ```Output - Name IpAddress FQDN - ---- --------- ---- - tutorialPublicIp tutorialvm1-8a0999.eastus.cloudapp.azure.com - ``` - - From your local machine you can run the following command to connect to the VM over Remote - Desktop. - - ```powershell-interactive - mstsc.exe /v $publicIp.IpAddress - ``` - - For more information about querying for object properties, see - [Querying for Azure resources](./queries-azureps.md). - - - durationInMinutes: 4 - title: Creating a new VM on the existing subnet - content: |- - The second VM uses the existing subnet. - - ```azurepowershell-interactive - $vm2Params = @{ - ResourceGroupName = 'TutorialResources' - Name = 'TutorialVM2' - ImageName = 'Win2016Datacenter' - VirtualNetworkName = 'TutorialVM1' - SubnetName = 'TutorialVM1' - PublicIpAddressName = 'tutorialPublicIp2' - Credential = $cred - OpenPorts = 3389 - } - $newVM2 = New-AzVM @vm2Params - - $newVM2 - ``` - - ```Output - ResourceGroupName : TutorialResources - Id : /subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/TutorialResources/providers/Microsoft.Compute/virtualMachines/TutorialVM2 - VmId : 00000000-0000-0000-0000-000000000000 - Name : TutorialVM2 - Type : Microsoft.Compute/virtualMachines - Location : eastus - Tags : {} - HardwareProfile : {VmSize} - NetworkProfile : {NetworkInterfaces} - OSProfile : {ComputerName, AdminUsername, WindowsConfiguration, Secrets} - ProvisioningState : Succeeded - StorageProfile : {ImageReference, OsDisk, DataDisks} - FullyQualifiedDomainName : tutorialvm2-dfa5af.eastus.cloudapp.azure.com - ``` - - You can skip a few steps to get the public IP address of the new VM since it's returned in - the FullyQualifiedDomainName property of the `$newVM2` object. Use the following command to - connect using Remote Desktop. - - ```powershell-interactive - mstsc.exe /v $newVM2.FullyQualifiedDomainName - ``` - - - durationInMinutes: 4 - title: Cleanup - content: |- - Now that the tutorial is complete, it's time to clean up the created resources. You can - delete individual resources with the `Remove-AzResource` command, but the safest way - to remove all resources in a resource group is delete the group using the - `Remove-AzResourceGroup` command. - - ```azurepowershell-interactive - $job = Remove-AzResourceGroup -Name TutorialResources -Force -AsJob - - $job - ``` - - ```Output - Id Name PSJobTypeName State HasMoreData Location Command - -- ---- ------------- ----- ----------- -------- ------- - 1 Long Running... AzureLongRun... Running True localhost Remove-AzResource... - ``` - - This command deletes the resources created during the tutorial, and is guaranteed to - deallocate them in the correct order. The `AsJob` parameter keeps PowerShell from blocking - while the deletion takes place. To wait until the deletion is complete, use the following - command: - - ```powershell-interactive - Wait-Job -Id $job.Id - ``` - - With cleanup completed, the tutorial is finished. Continue on for a summary of everything - you learned and links to resources that will help you with your next steps. - - - durationInMinutes: 1 - title: Summary - content: |- - - Congratulations! You learned how to create VMs with new or existing resources, used - expressions and other Azure PowerShell commands to capture data to be stored in shell - variables, and looked at some of the resources that get created for Azure VMs. - - Where you go from here depends on how you plan to use Azure PowerShell. There are a variety - of materials that go further in depth on the features covered in this tutorial. - - ### In-depth Azure PowerShell documentation - - You might want to take time to explore the complete - [Azure PowerShell documentation](/powershell/azure/) set. - - For more information about the commands used in this tutorial, see the following articles. - - - [New-AzResourceGroup](/powershell/module/Az.resources/new-Azresourcegroup) - - [Get-Credential](/powershell/module/microsoft.powershell.security/get-credential) - - [New-AzVM](/powershell/module/Az.compute/new-Azvm) - - [Select-Object](/powershell/module/microsoft.powershell.utility/select-object) - - [Get-AzPublicIpAddress](/powershell/module/Az.network/get-AzPublicIpAddress) - - [Remove-AzResourceGroup](/powershell/module/Az.resources/Remove-AzResourceGroup) - - [Wait-Job](/powershell/module/microsoft.powershell.core/wait-job) - - There are also articles that go deeper into the features that were shown in the tutorial. - - - [PowerShell splatting](/powershell/module/microsoft.powershell.core/about/about_splatting) - - [Queries](queries-azureps.md) - - [Formatting](formatting-output.md) - - [Using PowerShell jobs](using-psjobs.md) - - ### Sample scripts - - If you want to get started right away with specific tasks, look at some sample scripts. - - - [Azure App Service](/azure/app-service-web/app-service-powershell-samples?toc=/powershell/azure/toc.json) - - [SQL Databases](/azure/sql-database/sql-database-powershell-samples?toc=/powershell/azure/toc.json) - - [Cosmos DB](/azure/cosmos-db/sql/powershell-samples?toc=/powershell/azure/toc.json) - - [Samples repo](https://github.com/Azure/azure-docs-powershell-samples) - - ### Feedback - - If you'd like to give feedback, suggestions, or ask questions, there are a number of ways - for you to get in touch. - - - `Send-Feedback` is a built-in command for Azure PowerShell that allows you to provide - free-form feedback to the team. - - File a feature request or a bug report in the - [Azure PowerShell repository](https://github.com/Azure/azure-powershell/issues). - - Ask a question or get clarification by filing an issue in the - [Azure PowerShell documentation repository](https://github.com/MicrosoftDocs/azure-docs-powershell/issues). - - We hope that you enjoy using Azure PowerShell! diff --git a/docs-conceptual/azps-12.5.0/get-started-azureps.md b/docs-conceptual/azps-12.5.0/get-started-azureps.md index 30f9cf4e03..58c60d541b 100644 --- a/docs-conceptual/azps-12.5.0/get-started-azureps.md +++ b/docs-conceptual/azps-12.5.0/get-started-azureps.md @@ -92,7 +92,6 @@ patterns and issues. No private or personal data is collected. However, you can Get hands-on with Azure PowerShell through our guided tutorials: -- [Create virtual machines with Azure PowerShell][create-vms] - [Create a storage account][create-storageaccount] - [Transfer objects to/from Azure Blob storage][transfer-objects] - [Create and retrieve secrets from Azure Key Vault][keyvault] @@ -133,7 +132,6 @@ For additional help, connect with the community: [azps-modules]: https://github.com/Azure/azure-powershell/blob/master/documentation/azure-powershell-modules.md [disable-azdatacollection]: /powershell/module/az.accounts/disable-azdatacollection [privacy-statement]: https://privacy.microsoft.com/privacystatement -[create-vms]: azureps-vm-tutorial.yml [create-storageaccount]: /azure/storage/common/storage-quickstart-create-account?tabs=azure-powershell [transfer-objects]: /azure/storage/blobs/storage-quickstart-blobs-powershell [keyvault]: /azure/key-vault/quick-create-powershell diff --git a/docs-conceptual/azps-12.5.0/index.yml b/docs-conceptual/azps-12.5.0/index.yml index f039daada5..49ab866ead 100644 --- a/docs-conceptual/azps-12.5.0/index.yml +++ b/docs-conceptual/azps-12.5.0/index.yml @@ -88,10 +88,6 @@ landingContent: url: formatting-output.md - text: PowerShell jobs url: using-psjobs.md - - linkListType: tutorial - links: - - text: Create virtual machines - url: azureps-vm-tutorial.yml - title: Configuration linkLists: - linkListType: how-to-guide diff --git a/docs-conceptual/azps-12.5.0/toc.yml b/docs-conceptual/azps-12.5.0/toc.yml index 9d55629ea8..433f893dfc 100644 --- a/docs-conceptual/azps-12.5.0/toc.yml +++ b/docs-conceptual/azps-12.5.0/toc.yml @@ -98,8 +98,6 @@ href: /azure/azure-resource-manager/templates/secure-template-with-sas-token?toc=/powershell/azure/toc.json - name: Tutorials items: - - name: Create Virtual Machines - href: azureps-vm-tutorial.yml - name: Create a virtual network href: /azure/virtual-network/quick-create-powershell?toc=/powershell/azure/toc.json - name: Create a storage account diff --git a/docs-conceptual/azps-14.0.0/azureps-vm-tutorial.yml b/docs-conceptual/azps-14.0.0/azureps-vm-tutorial.yml deleted file mode 100644 index 1577e90b2e..0000000000 --- a/docs-conceptual/azps-14.0.0/azureps-vm-tutorial.yml +++ /dev/null @@ -1,336 +0,0 @@ -### YamlMime:Tutorial -title: Create virtual machines with the Azure PowerShell -metadata: - title: Create virtual machines with the Azure PowerShell - description: Get started with Azure PowerShell by creating virtual machines. - audience: Developer - level: Beginner - displayType: two-column - interactive: azurepowershell - ms.devlang: powershell - ms.custom: devx-track-azurepowershell - ms.service: azure-powershell - ms.topic: tutorial - clicktale: true -items: - - durationInMinutes: 1 - content: |- - In this tutorial, you learn all of the steps involved in setting up a virtual machine with - Azure PowerShell. The tutorial also covers output queries, Azure resource reuse, and - resource cleanup. - - This tutorial can be completed with the interactive experience offered through Azure Cloud - Shell, or you may [install Azure PowerShell](install-azure-powershell.md) locally. - - Use **ctrl-shift-v** (**cmd-shift-v** on macOS) to paste tutorial text into Azure Cloud - Shell. - - - durationInMinutes: 1 - title: Sign in - content: |- - If you're using a local install of the Azure PowerShell, you need to sign in before - performing any other steps. - - ```azurepowershell - Connect-AzAccount - ``` - - Complete the sign in process by following the steps displayed in your terminal. - - - durationInMinutes: 1 - title: Create a resource group - content: |- - In Azure, all resources are allocated in a resource management group. Resource groups - provide logical groupings of resources that make them easier to work with as a collection. - For this tutorial, all of the created resources go into a single group named - `TutorialResources`. - - ```azurepowershell-interactive - New-AzResourceGroup -Name TutorialResources -Location eastus - ``` - - ```Output - ResourceGroupName : TutorialResources - Location : eastus - ProvisioningState : Succeeded - Tags : - ResourceId : /subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/TutorialResources - ``` - - - durationInMinutes: 1 - title: Create admin credentials for the VM - content: |- - Before you can create a new virtual machine, you must create a credential object containing - the username and password for the administrator account of the Windows VM. - - ```powershell-interactive - $cred = Get-Credential -Message "Enter a username and password for the virtual machine." - ``` - - Enter the username and password when prompted. The resulting credential object is passed as - a parameter in the next step. - - ```Output - Windows PowerShell credential request. - Enter a username and password for the virtual machine. - User: tutorAdmin - Password for user tutorAdmin: ********* - ``` - - - durationInMinutes: 4 - title: Create a virtual machine - content: |- - Virtual machines in Azure have a large number of dependencies. The Azure PowerShell creates - these resources for you based on the command-line arguments you specify. For readability, we - are using [PowerShell splatting](/powershell/module/microsoft.powershell.core/about/about_splatting) - to pass parameters to the Azure PowerShell cmdlets. - - Create a new virtual machine running Windows. - - ```azurepowershell-interactive - $vmParams = @{ - ResourceGroupName = 'TutorialResources' - Name = 'TutorialVM1' - Location = 'eastus' - ImageName = 'Win2016Datacenter' - PublicIpAddressName = 'tutorialPublicIp' - Credential = $cred - OpenPorts = 3389 - Size = 'Standard_D2s_v3' - } - $newVM1 = New-AzVM @vmParams - ``` - As the VM is created, you see the parameter values used and Azure resources being created. - PowerShell will display a progress bar as shown below. - - ```Output - Creating Azure resources - 39% \ - [ooooooooooooooooooooooooooooooooooo ] - - Creating TutorialVM1 virtual machine. - ``` - - Once the VM is ready, we can view the results in the Azure Portal or by inspecting the - `$newVM1` variable. - - ```azurepowershell-interactive - $newVM1 - ``` - - ```Output - ResourceGroupName : TutorialResources - Id : /subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/TutorialResources/providers/Microsoft.Compute/virtualMachines/TutorialVM1 - VmId : 00000000-0000-0000-0000-000000000000 - Name : TutorialVM1 - Type : Microsoft.Compute/virtualMachines - Location : eastus - Tags : {} - HardwareProfile : {VmSize} - NetworkProfile : {NetworkInterfaces} - OSProfile : {ComputerName, AdminUsername, WindowsConfiguration, Secrets} - ProvisioningState : Succeeded - StorageProfile : {ImageReference, OsDisk, DataDisks} - ``` - - Property values listed inside of braces are nested objects. In the next step we will show you - how to view specific values in these nested objects. - - - durationInMinutes: 5 - title: Get VM information with queries - content: |- - Let's get some more detailed information from the VM we just created. In this example, we verify - the Name of the VM and the admin account we created. - - ```azurepowershell-interactive - $newVM1.OSProfile | Select-Object -Property ComputerName, AdminUserName - ``` - - ```Output - ComputerName AdminUsername - ------------ ------------- - TutorialVM1 tutorialAdmin - ``` - - We can use other Azure PowerShell commands to get specific information about the network - configuration. - - ```azurepowershell-interactive - $newVM1 | Get-AzNetworkInterface | - Select-Object -ExpandProperty IpConfigurations | - Select-Object -Property Name, PrivateIpAddress - ``` - - In this example we are using the PowerShell pipeline to send the \$newVM1 object to the - `Get-AzNetworkInterface` cmdlet. From the resulting network interface object we are - selecting the nested IpConfigurations object. From the IpConfigurations object we are - selecting the Name and PrivateIpAddress properties. - - ```Output - Name PrivateIpAddress - ---- ---------------- - TutorialVM1 192.168.1.4 - ``` - - To confirm that the VM is running, we need to connect via Remote Desktop. For that, we need - to know the Public IP address. - - ```azurepowershell-interactive - $publicIp = Get-AzPublicIpAddress -Name tutorialPublicIp -ResourceGroupName TutorialResources - - $publicIp | - Select-Object -Property Name, IpAddress, @{label='FQDN';expression={$_.DnsSettings.Fqdn}} - ``` - - In this example, we use the `Get-AzPublicIpAddress` and store the results in the `$publicIp` - variable. From this variable we are selecting properties and using an expression to retrieve - the nested Fqdn property. - - ```Output - Name IpAddress FQDN - ---- --------- ---- - tutorialPublicIp tutorialvm1-8a0999.eastus.cloudapp.azure.com - ``` - - From your local machine you can run the following command to connect to the VM over Remote - Desktop. - - ```powershell-interactive - mstsc.exe /v $publicIp.IpAddress - ``` - - For more information about querying for object properties, see - [Querying for Azure resources](./queries-azureps.md). - - - durationInMinutes: 4 - title: Creating a new VM on the existing subnet - content: |- - The second VM uses the existing subnet. - - ```azurepowershell-interactive - $vm2Params = @{ - ResourceGroupName = 'TutorialResources' - Name = 'TutorialVM2' - ImageName = 'Win2016Datacenter' - VirtualNetworkName = 'TutorialVM1' - SubnetName = 'TutorialVM1' - PublicIpAddressName = 'tutorialPublicIp2' - Credential = $cred - OpenPorts = 3389 - } - $newVM2 = New-AzVM @vm2Params - - $newVM2 - ``` - - ```Output - ResourceGroupName : TutorialResources - Id : /subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/TutorialResources/providers/Microsoft.Compute/virtualMachines/TutorialVM2 - VmId : 00000000-0000-0000-0000-000000000000 - Name : TutorialVM2 - Type : Microsoft.Compute/virtualMachines - Location : eastus - Tags : {} - HardwareProfile : {VmSize} - NetworkProfile : {NetworkInterfaces} - OSProfile : {ComputerName, AdminUsername, WindowsConfiguration, Secrets} - ProvisioningState : Succeeded - StorageProfile : {ImageReference, OsDisk, DataDisks} - FullyQualifiedDomainName : tutorialvm2-dfa5af.eastus.cloudapp.azure.com - ``` - - You can skip a few steps to get the public IP address of the new VM since it's returned in - the FullyQualifiedDomainName property of the `$newVM2` object. Use the following command to - connect using Remote Desktop. - - ```powershell-interactive - mstsc.exe /v $newVM2.FullyQualifiedDomainName - ``` - - - durationInMinutes: 4 - title: Cleanup - content: |- - Now that the tutorial is complete, it's time to clean up the created resources. You can - delete individual resources with the `Remove-AzResource` command, but the safest way - to remove all resources in a resource group is delete the group using the - `Remove-AzResourceGroup` command. - - ```azurepowershell-interactive - $job = Remove-AzResourceGroup -Name TutorialResources -Force -AsJob - - $job - ``` - - ```Output - Id Name PSJobTypeName State HasMoreData Location Command - -- ---- ------------- ----- ----------- -------- ------- - 1 Long Running... AzureLongRun... Running True localhost Remove-AzResource... - ``` - - This command deletes the resources created during the tutorial, and is guaranteed to - deallocate them in the correct order. The `AsJob` parameter keeps PowerShell from blocking - while the deletion takes place. To wait until the deletion is complete, use the following - command: - - ```powershell-interactive - Wait-Job -Id $job.Id - ``` - - With cleanup completed, the tutorial is finished. Continue on for a summary of everything - you learned and links to resources that will help you with your next steps. - - - durationInMinutes: 1 - title: Summary - content: |- - - Congratulations! You learned how to create VMs with new or existing resources, used - expressions and other Azure PowerShell commands to capture data to be stored in shell - variables, and looked at some of the resources that get created for Azure VMs. - - Where you go from here depends on how you plan to use Azure PowerShell. There are a variety - of materials that go further in depth on the features covered in this tutorial. - - ### In-depth Azure PowerShell documentation - - You might want to take time to explore the complete - [Azure PowerShell documentation](/powershell/azure/) set. - - For more information about the commands used in this tutorial, see the following articles. - - - [New-AzResourceGroup](/powershell/module/Az.resources/new-Azresourcegroup) - - [Get-Credential](/powershell/module/microsoft.powershell.security/get-credential) - - [New-AzVM](/powershell/module/Az.compute/new-Azvm) - - [Select-Object](/powershell/module/microsoft.powershell.utility/select-object) - - [Get-AzPublicIpAddress](/powershell/module/Az.network/get-AzPublicIpAddress) - - [Remove-AzResourceGroup](/powershell/module/Az.resources/Remove-AzResourceGroup) - - [Wait-Job](/powershell/module/microsoft.powershell.core/wait-job) - - There are also articles that go deeper into the features that were shown in the tutorial. - - - [PowerShell splatting](/powershell/module/microsoft.powershell.core/about/about_splatting) - - [Queries](queries-azureps.md) - - [Formatting](formatting-output.md) - - [Using PowerShell jobs](using-psjobs.md) - - ### Sample scripts - - If you want to get started right away with specific tasks, look at some sample scripts. - - - [Azure App Service](/azure/app-service-web/app-service-powershell-samples?toc=/powershell/azure/toc.json) - - [SQL Databases](/azure/sql-database/sql-database-powershell-samples?toc=/powershell/azure/toc.json) - - [Cosmos DB](/azure/cosmos-db/sql/powershell-samples?toc=/powershell/azure/toc.json) - - [Samples repo](https://github.com/Azure/azure-docs-powershell-samples) - - ### Feedback - - If you'd like to give feedback, suggestions, or ask questions, there are a number of ways - for you to get in touch. - - - `Send-Feedback` is a built-in command for Azure PowerShell that allows you to provide - free-form feedback to the team. - - File a feature request or a bug report in the - [Azure PowerShell repository](https://github.com/Azure/azure-powershell/issues). - - Ask a question or get clarification by filing an issue in the - [Azure PowerShell documentation repository](https://github.com/MicrosoftDocs/azure-docs-powershell/issues). - - We hope that you enjoy using Azure PowerShell! diff --git a/docs-conceptual/azps-14.0.0/get-started-azureps.md b/docs-conceptual/azps-14.0.0/get-started-azureps.md index c1e78b9cf4..a37e87778b 100644 --- a/docs-conceptual/azps-14.0.0/get-started-azureps.md +++ b/docs-conceptual/azps-14.0.0/get-started-azureps.md @@ -93,7 +93,6 @@ patterns and issues. No private or personal data is collected. However, you can Get hands-on with Azure PowerShell through our guided tutorials: -- [Create virtual machines with Azure PowerShell][create-vms] - [Create a storage account][create-storageaccount] - [Transfer objects to/from Azure Blob storage][transfer-objects] - [Create and retrieve secrets from Azure Key Vault][keyvault] @@ -136,7 +135,6 @@ For more help, connect with the community: [azps-modules]: https://github.com/Azure/azure-powershell/blob/master/documentation/azure-powershell-modules.md [disable-azdatacollection]: /powershell/module/az.accounts/disable-azdatacollection [privacy-statement]: https://privacy.microsoft.com/privacystatement -[create-vms]: azureps-vm-tutorial.yml [create-storageaccount]: /azure/storage/common/storage-quickstart-create-account?tabs=azure-powershell [transfer-objects]: /azure/storage/blobs/storage-quickstart-blobs-powershell [keyvault]: /azure/key-vault/quick-create-powershell diff --git a/docs-conceptual/azps-14.0.0/index.yml b/docs-conceptual/azps-14.0.0/index.yml index fe32045614..009050772f 100644 --- a/docs-conceptual/azps-14.0.0/index.yml +++ b/docs-conceptual/azps-14.0.0/index.yml @@ -88,10 +88,6 @@ landingContent: url: formatting-output.md - text: PowerShell jobs url: using-psjobs.md - - linkListType: tutorial - links: - - text: Create virtual machines - url: azureps-vm-tutorial.yml - title: Configuration linkLists: - linkListType: how-to-guide diff --git a/docs-conceptual/azps-14.0.0/toc.yml b/docs-conceptual/azps-14.0.0/toc.yml index 83a0b3304d..1cb32e2eed 100644 --- a/docs-conceptual/azps-14.0.0/toc.yml +++ b/docs-conceptual/azps-14.0.0/toc.yml @@ -105,8 +105,6 @@ items: href: /azure/azure-resource-manager/templates/secure-template-with-sas-token?toc=/powershell/azure/toc.json - name: Tutorials items: - - name: Create Virtual Machines - href: azureps-vm-tutorial.yml - name: Create a virtual network href: /azure/virtual-network/quick-create-powershell?toc=/powershell/azure/toc.json - name: Create a storage account diff --git a/docs-conceptual/azps-14.1.0/azureps-vm-tutorial.yml b/docs-conceptual/azps-14.1.0/azureps-vm-tutorial.yml deleted file mode 100644 index 1577e90b2e..0000000000 --- a/docs-conceptual/azps-14.1.0/azureps-vm-tutorial.yml +++ /dev/null @@ -1,336 +0,0 @@ -### YamlMime:Tutorial -title: Create virtual machines with the Azure PowerShell -metadata: - title: Create virtual machines with the Azure PowerShell - description: Get started with Azure PowerShell by creating virtual machines. - audience: Developer - level: Beginner - displayType: two-column - interactive: azurepowershell - ms.devlang: powershell - ms.custom: devx-track-azurepowershell - ms.service: azure-powershell - ms.topic: tutorial - clicktale: true -items: - - durationInMinutes: 1 - content: |- - In this tutorial, you learn all of the steps involved in setting up a virtual machine with - Azure PowerShell. The tutorial also covers output queries, Azure resource reuse, and - resource cleanup. - - This tutorial can be completed with the interactive experience offered through Azure Cloud - Shell, or you may [install Azure PowerShell](install-azure-powershell.md) locally. - - Use **ctrl-shift-v** (**cmd-shift-v** on macOS) to paste tutorial text into Azure Cloud - Shell. - - - durationInMinutes: 1 - title: Sign in - content: |- - If you're using a local install of the Azure PowerShell, you need to sign in before - performing any other steps. - - ```azurepowershell - Connect-AzAccount - ``` - - Complete the sign in process by following the steps displayed in your terminal. - - - durationInMinutes: 1 - title: Create a resource group - content: |- - In Azure, all resources are allocated in a resource management group. Resource groups - provide logical groupings of resources that make them easier to work with as a collection. - For this tutorial, all of the created resources go into a single group named - `TutorialResources`. - - ```azurepowershell-interactive - New-AzResourceGroup -Name TutorialResources -Location eastus - ``` - - ```Output - ResourceGroupName : TutorialResources - Location : eastus - ProvisioningState : Succeeded - Tags : - ResourceId : /subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/TutorialResources - ``` - - - durationInMinutes: 1 - title: Create admin credentials for the VM - content: |- - Before you can create a new virtual machine, you must create a credential object containing - the username and password for the administrator account of the Windows VM. - - ```powershell-interactive - $cred = Get-Credential -Message "Enter a username and password for the virtual machine." - ``` - - Enter the username and password when prompted. The resulting credential object is passed as - a parameter in the next step. - - ```Output - Windows PowerShell credential request. - Enter a username and password for the virtual machine. - User: tutorAdmin - Password for user tutorAdmin: ********* - ``` - - - durationInMinutes: 4 - title: Create a virtual machine - content: |- - Virtual machines in Azure have a large number of dependencies. The Azure PowerShell creates - these resources for you based on the command-line arguments you specify. For readability, we - are using [PowerShell splatting](/powershell/module/microsoft.powershell.core/about/about_splatting) - to pass parameters to the Azure PowerShell cmdlets. - - Create a new virtual machine running Windows. - - ```azurepowershell-interactive - $vmParams = @{ - ResourceGroupName = 'TutorialResources' - Name = 'TutorialVM1' - Location = 'eastus' - ImageName = 'Win2016Datacenter' - PublicIpAddressName = 'tutorialPublicIp' - Credential = $cred - OpenPorts = 3389 - Size = 'Standard_D2s_v3' - } - $newVM1 = New-AzVM @vmParams - ``` - As the VM is created, you see the parameter values used and Azure resources being created. - PowerShell will display a progress bar as shown below. - - ```Output - Creating Azure resources - 39% \ - [ooooooooooooooooooooooooooooooooooo ] - - Creating TutorialVM1 virtual machine. - ``` - - Once the VM is ready, we can view the results in the Azure Portal or by inspecting the - `$newVM1` variable. - - ```azurepowershell-interactive - $newVM1 - ``` - - ```Output - ResourceGroupName : TutorialResources - Id : /subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/TutorialResources/providers/Microsoft.Compute/virtualMachines/TutorialVM1 - VmId : 00000000-0000-0000-0000-000000000000 - Name : TutorialVM1 - Type : Microsoft.Compute/virtualMachines - Location : eastus - Tags : {} - HardwareProfile : {VmSize} - NetworkProfile : {NetworkInterfaces} - OSProfile : {ComputerName, AdminUsername, WindowsConfiguration, Secrets} - ProvisioningState : Succeeded - StorageProfile : {ImageReference, OsDisk, DataDisks} - ``` - - Property values listed inside of braces are nested objects. In the next step we will show you - how to view specific values in these nested objects. - - - durationInMinutes: 5 - title: Get VM information with queries - content: |- - Let's get some more detailed information from the VM we just created. In this example, we verify - the Name of the VM and the admin account we created. - - ```azurepowershell-interactive - $newVM1.OSProfile | Select-Object -Property ComputerName, AdminUserName - ``` - - ```Output - ComputerName AdminUsername - ------------ ------------- - TutorialVM1 tutorialAdmin - ``` - - We can use other Azure PowerShell commands to get specific information about the network - configuration. - - ```azurepowershell-interactive - $newVM1 | Get-AzNetworkInterface | - Select-Object -ExpandProperty IpConfigurations | - Select-Object -Property Name, PrivateIpAddress - ``` - - In this example we are using the PowerShell pipeline to send the \$newVM1 object to the - `Get-AzNetworkInterface` cmdlet. From the resulting network interface object we are - selecting the nested IpConfigurations object. From the IpConfigurations object we are - selecting the Name and PrivateIpAddress properties. - - ```Output - Name PrivateIpAddress - ---- ---------------- - TutorialVM1 192.168.1.4 - ``` - - To confirm that the VM is running, we need to connect via Remote Desktop. For that, we need - to know the Public IP address. - - ```azurepowershell-interactive - $publicIp = Get-AzPublicIpAddress -Name tutorialPublicIp -ResourceGroupName TutorialResources - - $publicIp | - Select-Object -Property Name, IpAddress, @{label='FQDN';expression={$_.DnsSettings.Fqdn}} - ``` - - In this example, we use the `Get-AzPublicIpAddress` and store the results in the `$publicIp` - variable. From this variable we are selecting properties and using an expression to retrieve - the nested Fqdn property. - - ```Output - Name IpAddress FQDN - ---- --------- ---- - tutorialPublicIp tutorialvm1-8a0999.eastus.cloudapp.azure.com - ``` - - From your local machine you can run the following command to connect to the VM over Remote - Desktop. - - ```powershell-interactive - mstsc.exe /v $publicIp.IpAddress - ``` - - For more information about querying for object properties, see - [Querying for Azure resources](./queries-azureps.md). - - - durationInMinutes: 4 - title: Creating a new VM on the existing subnet - content: |- - The second VM uses the existing subnet. - - ```azurepowershell-interactive - $vm2Params = @{ - ResourceGroupName = 'TutorialResources' - Name = 'TutorialVM2' - ImageName = 'Win2016Datacenter' - VirtualNetworkName = 'TutorialVM1' - SubnetName = 'TutorialVM1' - PublicIpAddressName = 'tutorialPublicIp2' - Credential = $cred - OpenPorts = 3389 - } - $newVM2 = New-AzVM @vm2Params - - $newVM2 - ``` - - ```Output - ResourceGroupName : TutorialResources - Id : /subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/TutorialResources/providers/Microsoft.Compute/virtualMachines/TutorialVM2 - VmId : 00000000-0000-0000-0000-000000000000 - Name : TutorialVM2 - Type : Microsoft.Compute/virtualMachines - Location : eastus - Tags : {} - HardwareProfile : {VmSize} - NetworkProfile : {NetworkInterfaces} - OSProfile : {ComputerName, AdminUsername, WindowsConfiguration, Secrets} - ProvisioningState : Succeeded - StorageProfile : {ImageReference, OsDisk, DataDisks} - FullyQualifiedDomainName : tutorialvm2-dfa5af.eastus.cloudapp.azure.com - ``` - - You can skip a few steps to get the public IP address of the new VM since it's returned in - the FullyQualifiedDomainName property of the `$newVM2` object. Use the following command to - connect using Remote Desktop. - - ```powershell-interactive - mstsc.exe /v $newVM2.FullyQualifiedDomainName - ``` - - - durationInMinutes: 4 - title: Cleanup - content: |- - Now that the tutorial is complete, it's time to clean up the created resources. You can - delete individual resources with the `Remove-AzResource` command, but the safest way - to remove all resources in a resource group is delete the group using the - `Remove-AzResourceGroup` command. - - ```azurepowershell-interactive - $job = Remove-AzResourceGroup -Name TutorialResources -Force -AsJob - - $job - ``` - - ```Output - Id Name PSJobTypeName State HasMoreData Location Command - -- ---- ------------- ----- ----------- -------- ------- - 1 Long Running... AzureLongRun... Running True localhost Remove-AzResource... - ``` - - This command deletes the resources created during the tutorial, and is guaranteed to - deallocate them in the correct order. The `AsJob` parameter keeps PowerShell from blocking - while the deletion takes place. To wait until the deletion is complete, use the following - command: - - ```powershell-interactive - Wait-Job -Id $job.Id - ``` - - With cleanup completed, the tutorial is finished. Continue on for a summary of everything - you learned and links to resources that will help you with your next steps. - - - durationInMinutes: 1 - title: Summary - content: |- - - Congratulations! You learned how to create VMs with new or existing resources, used - expressions and other Azure PowerShell commands to capture data to be stored in shell - variables, and looked at some of the resources that get created for Azure VMs. - - Where you go from here depends on how you plan to use Azure PowerShell. There are a variety - of materials that go further in depth on the features covered in this tutorial. - - ### In-depth Azure PowerShell documentation - - You might want to take time to explore the complete - [Azure PowerShell documentation](/powershell/azure/) set. - - For more information about the commands used in this tutorial, see the following articles. - - - [New-AzResourceGroup](/powershell/module/Az.resources/new-Azresourcegroup) - - [Get-Credential](/powershell/module/microsoft.powershell.security/get-credential) - - [New-AzVM](/powershell/module/Az.compute/new-Azvm) - - [Select-Object](/powershell/module/microsoft.powershell.utility/select-object) - - [Get-AzPublicIpAddress](/powershell/module/Az.network/get-AzPublicIpAddress) - - [Remove-AzResourceGroup](/powershell/module/Az.resources/Remove-AzResourceGroup) - - [Wait-Job](/powershell/module/microsoft.powershell.core/wait-job) - - There are also articles that go deeper into the features that were shown in the tutorial. - - - [PowerShell splatting](/powershell/module/microsoft.powershell.core/about/about_splatting) - - [Queries](queries-azureps.md) - - [Formatting](formatting-output.md) - - [Using PowerShell jobs](using-psjobs.md) - - ### Sample scripts - - If you want to get started right away with specific tasks, look at some sample scripts. - - - [Azure App Service](/azure/app-service-web/app-service-powershell-samples?toc=/powershell/azure/toc.json) - - [SQL Databases](/azure/sql-database/sql-database-powershell-samples?toc=/powershell/azure/toc.json) - - [Cosmos DB](/azure/cosmos-db/sql/powershell-samples?toc=/powershell/azure/toc.json) - - [Samples repo](https://github.com/Azure/azure-docs-powershell-samples) - - ### Feedback - - If you'd like to give feedback, suggestions, or ask questions, there are a number of ways - for you to get in touch. - - - `Send-Feedback` is a built-in command for Azure PowerShell that allows you to provide - free-form feedback to the team. - - File a feature request or a bug report in the - [Azure PowerShell repository](https://github.com/Azure/azure-powershell/issues). - - Ask a question or get clarification by filing an issue in the - [Azure PowerShell documentation repository](https://github.com/MicrosoftDocs/azure-docs-powershell/issues). - - We hope that you enjoy using Azure PowerShell! diff --git a/docs-conceptual/azps-14.1.0/get-started-azureps.md b/docs-conceptual/azps-14.1.0/get-started-azureps.md index c1e78b9cf4..a37e87778b 100644 --- a/docs-conceptual/azps-14.1.0/get-started-azureps.md +++ b/docs-conceptual/azps-14.1.0/get-started-azureps.md @@ -93,7 +93,6 @@ patterns and issues. No private or personal data is collected. However, you can Get hands-on with Azure PowerShell through our guided tutorials: -- [Create virtual machines with Azure PowerShell][create-vms] - [Create a storage account][create-storageaccount] - [Transfer objects to/from Azure Blob storage][transfer-objects] - [Create and retrieve secrets from Azure Key Vault][keyvault] @@ -136,7 +135,6 @@ For more help, connect with the community: [azps-modules]: https://github.com/Azure/azure-powershell/blob/master/documentation/azure-powershell-modules.md [disable-azdatacollection]: /powershell/module/az.accounts/disable-azdatacollection [privacy-statement]: https://privacy.microsoft.com/privacystatement -[create-vms]: azureps-vm-tutorial.yml [create-storageaccount]: /azure/storage/common/storage-quickstart-create-account?tabs=azure-powershell [transfer-objects]: /azure/storage/blobs/storage-quickstart-blobs-powershell [keyvault]: /azure/key-vault/quick-create-powershell diff --git a/docs-conceptual/azps-14.1.0/index.yml b/docs-conceptual/azps-14.1.0/index.yml index 30e1d65664..f24155e75e 100644 --- a/docs-conceptual/azps-14.1.0/index.yml +++ b/docs-conceptual/azps-14.1.0/index.yml @@ -88,10 +88,6 @@ landingContent: url: formatting-output.md - text: PowerShell jobs url: using-psjobs.md - - linkListType: tutorial - links: - - text: Create virtual machines - url: azureps-vm-tutorial.yml - title: Configuration linkLists: - linkListType: how-to-guide diff --git a/docs-conceptual/azps-14.1.0/toc.yml b/docs-conceptual/azps-14.1.0/toc.yml index 83a0b3304d..1cb32e2eed 100644 --- a/docs-conceptual/azps-14.1.0/toc.yml +++ b/docs-conceptual/azps-14.1.0/toc.yml @@ -105,8 +105,6 @@ items: href: /azure/azure-resource-manager/templates/secure-template-with-sas-token?toc=/powershell/azure/toc.json - name: Tutorials items: - - name: Create Virtual Machines - href: azureps-vm-tutorial.yml - name: Create a virtual network href: /azure/virtual-network/quick-create-powershell?toc=/powershell/azure/toc.json - name: Create a storage account