Skip to main content

Posts

Showing posts from 2018

Enable Audit on Azure SQL Server (for all Databases)

To enable Azure SQL Server audit: - in Azure Portal Enable Audit for the SQL Server (and select the destination, e.g. Storage Account) - Start the shell from within the Portal - run this command (replace the names in yellow with your names): Set-AzureRmSqlServerAuditing -State Enabled -ResourceGroupName " rg-bdocloudops " -ServerName " bdocloudops " -AuditActionGroup APPLICATION_ROLE_CHANGE_PASSWORD_GROUP, DATABASE_OBJECT_CHANGE_GROUP, DATABASE_OBJECT_OWNERSHIP_CHANGE_GROUP, DATABASE_OBJECT_PERMISSION_CHANGE_GROUP, DATABASE_PERMISSION_CHANGE_GROUP, DATABASE_PRINCIPAL_CHANGE_GROUP, DATABASE_PRINCIPAL_IMPERSONATION_GROUP, DATABASE_ROLE_MEMBER_CHANGE_GROUP, FAILED_DATABASE_AUTHENTICATION_GROUP, SCHEMA_OBJECT_CHANGE_GROUP, SCHEMA_OBJECT_OWNERSHIP_CHANGE_GROUP, SCHEMA_OBJECT_PERMISSION_CHANGE_GROUP, USER_CHANGE_PASSWORD_GROUP, DATABASE_OPERATION_GROUP Check if the last group (DATABASE_OPERATION_GROUP) causes too many events and

Monitor Progress of Azure Database Operation

These database operations Create database Copy database. Database Copy creates a record in this view on both the source and target servers. Alter database Change the performance level of a service tier Change the service tier of a database, such as changing from Basic to Standard. Setting up a Geo-Replication relationship Terminating a Geo-Replication relationship Restore database Delete database can be monitored using the  sys.dm_operation_status in the master database

Azure - Set up internet connectivity for the guest virtual machine

Here is the link Here is the text Create a NAT virtual network switch New-VMSwitch -Name "InternalNATSwitch" -SwitchType Internal View the properties of the switch and note the ifIndex for the new adapter. Get-NetAdapter Create an IP address for the NAT Gateway. New-NetIPAddress -IPAddress 192.168.0.1 -PrefixLength 24 -InterfaceIndex 13 where  InterfaceIndex -  ifIndex  is the interface index of the virtual switch created in the previous step Create the NAT network New-NetNat -Name "InternalNat" -InternalIPInterfaceAddressPrefix 192.168.0.0/24 Create the guest virtual machine Configure the virtual machine to use the new Internal network you created.  Configure DHCP to dynamically assign an IP address to the guest virtual machine Install DCHP Server on the Azure VM Configure a new DHCP scope Define an IP Range for your DCHP Server (for example, 192.168.0.100 to 192.168.0.200) Click  Next  until th

Swap Disk for Azure VM

$resourceGroupName = 'rg-OMS' $location = 'eastus2' $vmName = 'x007' $snapshotName = 'snapX007disk'  $diskAccountType='Premium_LRS' $osDiskName = 'newX007fromSnapshot' $vm = get-azurermvm  -ResourceGroupName $resourceGroupName   -Name $vmName $snapshot =  New-AzureRmSnapshotConfig   -SourceUri $vm.StorageProfile.OsDisk.ManagedDisk.Id   -Location $location   -CreateOption copy -SkuName $diskAccountType # create a snapshot New-AzureRmSnapshot -Snapshot $snapshot -SnapshotName $snapshotName -ResourceGroupName $resourceGroupName $snapshot = Get-AzureRmSnapshot -ResourceGroupName $resourceGroupName -SnapshotName $snapshotName $diskConfig = New-AzureRmDiskConfig -Location $snapshot.Location -SourceResourceId $snapshot.Id -CreateOption Copy -SkuName $diskAccountType $disk = New-AzureRmDisk -Disk $diskConfig -ResourceGroupName $resourceGroupName -DiskName $osDiskName # list all disks Get-AzureRmDisk -ResourceGroupName $Re