$result = Start-AzureRmNetworkWatcherResourceTroubleshooting -NetworkWatcher $networkWatcher -TargetResourceId $connection.Id -StorageId $sa.Id -StoragePath $storagePath $storagePath = "$($sa.PrimaryEndpoints.Blob)$($storageAccountContainer)" $sa = Get-AzureRmStorageAccount -Name $storageAccountName -ResourceGroupName $storageAccountResourceGroup $connection = Get-AzureRmVirtualNetworkGatewa圜onnection -Name $vpnConnectionName -ResourceGroupName $vpnConnectionResourceGroup $networkWatcher = Get-AzureRmNetworkWatcher -Name $nw.Name -ResourceGroupName $nw.ResourceGroupName Set-AzureRmContext -SubscriptionId $subscriptionId "Setting context to a specific subscription" CertificateThumbprint $servicePrincipalConnection.CertificateThumbprint ApplicationId $servicePrincipalConnection.ApplicationId ` TenantId $servicePrincipalConnection.TenantId ` $servicePrincipalConnection=Get-AutomationConnection -Name $runAsConnectionName # Get the connection "AzureRunAsConnection " $cred = Get-AutomationPSCredential -Name $automationCredential ![]() # Get credentials for work or school account Use the following code as click Save # Set these variables to the proper values for your environment The items in the code that contain need to be replaced with the values from your subscription. In this step the runbook is created, the following code example provides all the code needed for the example. ![]() The runbook type for this example is PowerShell, the other options are Graphical, PowerShell workflow, and Graphical PowerShell workflow. It is important to give the runbook a descriptive name, and recommended giving it a name that follows standard PowerShell naming standards. In this step, we give the runbook a name, in the example it is called Get-VPNGatewayStatus. Under Quick Create, click Create a new runbook to create the runbook. Navigate to Azure Automation in the Azure portal and click RunbooksĬlick Add a runbook to start the creation process of the runbook. To learn about run-as accounts, visit Authenticate Runbooks with Azure Run As account Step 1 The first step to configuring the example is to create the runbook. The infrastructure depicted in the preceding image is for illustration purposes and are not created with the steps contained in this article.
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |