exam questions

Exam AZ-300 All Questions

View all questions & answers for the AZ-300 exam

Exam AZ-300 topic 1 question 62 discussion

Actual exam question from Microsoft's AZ-300
Question #: 62
Topic #: 1
[All AZ-300 Questions]

SIMULATION -
Click to expand each objective. To connect to the Azure portal, type https://portal.azure.com in the browser address bar.






When you are finished performing all the tasks, click the "˜Next' button.
Note that you cannot return to the lab once you click the "˜Next' button. Scoring occur in the background while you complete the rest of the exam.

Overview -
The following section of the exam is a lab. In this section, you will perform a set of tasks in a live environment. While most functionality will be available to you as it would be in a live environment, some functionality (e.g., copy and paste, ability to navigate to external websites) will not be possible by design.
Scoring is based on the outcome of performing the tasks stated in the lab. In other words, it doesn't matter how you accomplish the task, if you successfully perform it, you will earn credit for that task.
Labs are not timed separately, and this exam may have more than one lab that you must complete. You can use as much time as you would like to complete each lab. But, you should manage your time appropriately to ensure that you are able to complete the lab(s) and all other sections of the exam in the time provided.
Please note that once you submit your work by clicking the Next button within a lab, you will NOT be able to return to the lab.

To start the lab -
You may start the lab by clicking the Next button.
You plan to deploy several Azure virtual machines and to connect them to a virtual network named VNET1007.
You need to ensure that future virtual machines on VNET1007 can register their name in an internal DNS zone named corp8548984.com. The zone must NOT be hosted on a virtual machine.
What should you do from Azure Cloud Shell?
To complete this task, start Azure Cloud Shell and select PowerShell (Linux), Click Show Advanced settings, and then enter corp8548984n1 in the
Storage account text box and File1 share text box. Click Create storage, and then complete the task.

Show Suggested Answer Hide Answer
Suggested Answer: See solution below.
Step 1: Launch Cloud Shell from the top navigation of the Azure portal.


Step 2: Select PowerShell -

When you start the Azure Cloud Shell for the first time, you will be prompted to create a storage account in order to associate a new Azure File Share to persist files across sessions.
Step 3: Click Show Advanced settings.

Step 4: Enter corp8548984n1 in the Storage account text box and File1 share text box. Click Create storage.

Step 5: Enter the following command at the powershell command prompt:
New-AzDnsZone -Name "corp8548984.com"
-ResourceGroupName "mycloudshell"
-ZoneType Private
-RegistrationVirtualNetworkId VNET1007
Note: A DNS zone is created by using the New-AzDnsZone cmdlet with a value of Private for the ZoneType parameter.
References:
https://docs.microsoft.com/en-us/azure/dns/private-dns-getstarted-powershell https://docs.microsoft.com/en-us/azure/cloud-shell/quickstart-powershell https://docs.microsoft.com/en-us/powershell/module/az.dns/new-azdnszone?view=azps-1.5.0

Comments

Chosen Answer:
This is a voting comment (?). It is better to Upvote an existing comment if you don't have anything to add.
Switch to a voting comment New
Mathew
Highly Voted 5 years, 5 months ago
As its mentioned VNET1007 can register their name in an internal DNS zone $vnet = Get-AzVirtualNetwork -Name "VNET1007" $zone = New-AzPrivateDnsZone -Name "corp8548984.com" -ResourceGroupName $vnet.ResourceGroupName $link = New-AzPrivateDnsVirtualNetworkLink -ZoneName corp8548984.com ` -ResourceGroupName $vnet.ResourceGroupName -Name "mylink" ` -VirtualNetworkId $vnet.id -EnableRegistration
upvoted 15 times
tundervirld
4 years, 11 months ago
I agree to Mathew, I test it in a lab and works: #Get Vnet VNET1007 $vnet = Get-AzVirtualNetwork -Name VNET1007 #Install Module Private DNS Install-Module -Name Az.PrivateDns -force #Create DNS Private Zone $privatednszone = New-AzPrivateDnsZone -Name my-dns-private-zone.int -ResourceGroupName rg-test-dns-private-westus2 #Create DNS Private Zone Link to Vnet $privatednszonelink = New-AzPrivateDnsVirtualNetworkLink ` -ZoneName $privatednszone.name ` -ResourceGroupName $vn.ResourceGroupName ` -Name $($privatednszone.name+"link") ` -VirtualNetworkId $vnet.id -EnableRegistration You can create 2 VM to test, this is the best link to read: https://docs.microsoft.com/en-us/azure/dns/private-dns-getstarted-powershell
upvoted 3 times
...
...
Ekramy_Elnaggar
Highly Voted 5 years, 6 months ago
Commands were changed, correct answer should be: 1- Get-AzVirtualNetwork -Name "VNET1007" >> and Copy the VNET ID 2- New-AzDnsZone -Name "corp8548984.com" -ResourceGroupName "mycloudshell" -ZoneType Private -RegistrationVirtualNetworkId "/subscriptions/fbdcff9e-af3d-43e8-b691-41d0ba60b51d/resourceGroups/mycloudshell/providers/Microsoft.Network/virtualNetworks/vnet1007"
upvoted 11 times
Ekramy_Elnaggar
5 years, 6 months ago
or easier to do it like this : $vnet = Get-AzVirtualNetwork -Name "VNET1007" New-AzDnsZone -Name "corp8548984.com" -ResourceGroupName "myCloudShell" -ZoneType Private -RegistrationVirtualNetworkId $vnet.Id
upvoted 31 times
...
...
Himanshu27
Most Recent 4 years, 9 months ago
New-AzPrivateDnsZone -Name corp854898427.com -ResourceGroupName myshellrg New-AzPrivateDnsVirtualNetworkLink -ZoneName corp854898427.com -ResourceGroupName myshellrg -Name "mylink" -VirtualNetworkId "/subscriptions/cda5ed3e-8a23-4c11-998f-ed489e0ba982/resourceGroups/myshellrg/providers/Microsoft.Network/virtualNetworks/VNET1007" -EnableRegistration
upvoted 2 times
...
koumelas
4 years, 10 months ago
This one was ok with me: 1. New-AzPrivateDnsZone -name corp8548984.com -ResourceGroupName myresourcegroup 2. New-AzPrivateDnsVirtualNetworkLink -ZoneName corp8548984.com -Name mylink -ResourceGroupName myresourcegroup -VirtualNetworkId /subscriptions/xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx/resourceGroups/myresourcegroup/providers/Microsoft.Network/virtualNetworks/vnet1007
upvoted 1 times
...
prabhjot
4 years, 11 months ago
agree with NithinRao all you need is one change $vnet = and not $vnet -
upvoted 1 times
...
NithinRao
4 years, 11 months ago
$vnet - Get-AzVirtualNetwork -Name VNet007 $zone = New-AzPrivateDnsZone -Name private.contoso.com -ResourceGroupName MyAzureResourceGroup $link = New-AzPrivateDnsVirtualNetworkLink -ZoneName private.contoso.com ` -ResourceGroupName MyAzureResourceGroup -Name "mylink" ` -VirtualNetworkId $vnet.id -EnableRegistration
upvoted 2 times
...
jmprbridge
4 years, 11 months ago
Well . . . I follow your recomendations and doesn't work. Below you will find the steps that I did on real Lab and work fine: 1-. Create a Resource Group (Delete-RG). 2-. Create 2 VNETs (vnet01 and vnet02), with two subnets. 3 -. From Cloud Shell: #Create DNS Private Zone: a-. New-AzPrivateDnsZone -Name "myCloudDomain.com" -ResourceGroupName "Delete-RG" #Save in a variable vnet02 information: b-. $vnet = New-AzVirtualNetwork -Name "vnet02" #Configure Private DNS Zone as question requirements: c-. New-AzPrivateDnsVirtualNetworkLink -ZoneName "myCloudDomain.com" -ResourceGroupName "Delete-RG" -Name "myCloudLink" -VirtualNetworkId $vnet.Id -EnableRegistration After that, I created a VM at vnet02, and it was registered at myCloudDomain.com Private DNS Zone with no problem.
upvoted 2 times
...
Shunya
4 years, 12 months ago
First Create a Virtual Network VNET1007 using Azure portal. You can create the Private DNS and Linking in Azure portal without going to PowerShell. Simply follow the steps in this link: https://docs.microsoft.com/en-us/azure/dns/private-dns-getstarted-portal If you want to do it through PowerShell goto PS using your portal, then execute below commands 1. $vnet = Get-AzVirtualNetwork -Name "VNET1007" (this step is to get your Virtual Network Details) 2. New-AzPrivateDnsZone -Name "corp8548984.com" -ResourceGroupName "putYourResourceGroupNameHere" (this is where you created a new Private DNS) 3. New-AzPrivateDnsVirtualNetworkLink -ZoneName "corp8548984.com" ` -ResourceGroupName "putYourResourceGroupNameHere" -Name "putNameOfYourChoice" ` -VirtualNetworkId $vnet.id -EnableRegistration (this is how you linked the Virtual Network and Private DNS) (Reference:https://docs.microsoft.com/en-us/azure/dns/private-dns-getstarted-powershell)
upvoted 1 times
...
zell
5 years ago
Hi all, This is what i have during my labbing: 1) Create the new DNS zone using the following command: new-azprivatednszone -resourcegroupname "RESOURCE-GROUP-NAME-HERE" -name "FQDN-PRIVATE-DNS-ZONE-HERE.com" 2) use a variable to get the existing VNET ID: $vnet = get-azvirtualnetwork -name "VNET-NAME-HERE" 3) Create a virtual network link to the private DNS zone and enable auto registraiton of resources within that vnet to automatically register to that private dns zone: new-azprivatednsvirtualnetworklink -resourcegroupname "RESOURCE-GROUP-NAME-HERE" -zonename "FQDN PRIVATE ZONE HERE.com" -enableregistration -virtualnetworkid $vnet.id
upvoted 4 times
denkes
5 years ago
@zell: Thank you very much! When executing step 3) a name needs to be speficied. the 3rd command: "new-azprivatednsvirtualnetworklink -resourcegroupname ....." should also include "-name mydnslinkhere".
upvoted 1 times
...
...
quokka
5 years ago
Didn't seem like I need to force install a module, but simply: New-AzPrivateDnsZone -ResourceGroupName "mycloudshell" -Name "corp8548984.com" Sweet!
upvoted 1 times
...
gbryant1
5 years, 1 month ago
You have to install the Module first. New-AzDnsZone: Creation of private DNS zones using this API is no longer allowed. Please use privatednszones resource instead of dnszones resource. Refer to https://aka.ms/privatednsmigration for details. Install-Module -Name Az.PrivateDns -force New-AzPrivateDnsZone -Name corp8548984.com -ResourceGroupName mycloudshell Keep it simple
upvoted 2 times
...
mohamadakl
5 years, 1 month ago
New-AzDnsZone New-AzDnsZone: Creation of private DNS zones using this API is no longer allowed. Please use privatednszones resource instead of dnszones resource. Refer to https://aka.ms/privatednsmigration for details. the new command step1 : $vnet = Get-AzVirtualNetwork -ResourceGroupName "learn" -Name "vnet1" step2: New-AzPrivateDnsZone -Name "corp.com" -ResourceGroupName "learn" step3: New-AzPrivateDnsVirtualNetworkLink -ResourceGroupName "learn" -ZoneName "corp.com" -Name "dplii" -VirtualNetworkId $vnet.Id -EnableRegistration
upvoted 1 times
...
keithtemplin
5 years, 1 month ago
Here is what I just did in my lab using the new commands: Install-Module -Name Az.PrivateDns -force $vnet = Get-AzVirtualNetwork -Name VNET1007 $zone = New-AzPrivateDnsZone -Name az30062.int -ResourceGroupName az-300-62 $link = New-AzPrivateDnsVirtualNetworkLink -ZoneName az30062.int ` -ResourceGroupName az-300-62 -Name "az30062.int-link" ` -VirtualNetworkId $vnet.id -EnableRegistration Install-Module -Name Az.PrivateDns -force $vnet = Get-AzVirtualNetwork -Name VNET1007 $zone = New-AzPrivateDnsZone -Name az20062.int -ResourceGroupName az-300-62 $link = New-AzPrivateDnsVirtualNetworkLink -ZoneName az30062.int ` -ResourceGroupName az-300-62 -Name "az20062.int-link" ` -VirtualNetworkId $vnet.id -EnableRegistration
upvoted 1 times
keithtemplin
5 years, 1 month ago
Sorry Double Pasted, Here arethe commands: Install-Module -Name Az.PrivateDns -force $vnet = Get-AzVirtualNetwork -Name VNET1007 $zone = New-AzPrivateDnsZone -Name az30062.int -ResourceGroupName az-300-62 $link = New-AzPrivateDnsVirtualNetworkLink -ZoneName az30062.int ` -ResourceGroupName az-300-62 -Name "az30062.int-link" ` -VirtualNetworkId $vnet.id -EnableRegistration
upvoted 1 times
...
...
Gjferweb
5 years, 1 month ago
Solution commands being deprecated: New-AzDnsZone: Creation of private DNS zones using this API is no longer allowed. Please use privatednszones resource instead of dnszones resource. Refer to https://aka.ms/privatednsmigration for details.
upvoted 1 times
...
kumar123
5 years, 1 month ago
New-AzPrivateDnsZone -Name "corp8548984.com" -ResourceGroupName "RG1" - This will do.
upvoted 1 times
...
milind8451
5 years, 1 month ago
If anyone wondering how to remember these commands, just learn to use --help command in Azure shell. You will get all commands and examples listed.
upvoted 5 times
NKnab
5 years ago
Thanks for the clue. Was really puzzled on how to remember
upvoted 1 times
...
...
SilNilanjan
5 years, 3 months ago
$ResVirtualNetwork = Get-AzVirtualNetwork -Name "VNET1005a" -ResourceGroupName "user-hjqgbfnkfrfa" New-AzDnsZone -Name "corp8548984.com" -ResourceGroupName "user-hjqgbfnkfrfa" -ZoneType Private -RegistrationVirtualNetworkId $ResVirtualNetwork.id
upvoted 3 times
...
Community vote distribution
A (35%)
C (25%)
B (20%)
Other
Most Voted
A voting comment increases the vote count for the chosen answer by one.

Upvoting a comment with a selected answer will also increase the vote count towards that answer by one. So if you see a comment that you already agree with, you can upvote it instead of posting a new comment.

SaveCancel
Loading ...