Tag: cloud

Azure Advisor And Fixing Errors

Azure can be configured to send you advisor reports detailing things that are not quite right in your environment. The advisor is not necessarily always right but it’s sensible to review the outputs periodically, even if they relate to non production environments.

A few issues popped up on an advisor report on my recent travels and although you can just use the entries on the report on the portal to target the offending resources, I thought it might be helpful to write some Powershell to identify the offending resources as an alternative.

Secure transfer to storage accounts should be enabled

This error shows up similar to this on the report:

Fairly obvious what this means really – the storage account has a setting which is currently set to allow insecure transfers (via http rather than https) – an example looks like this under the Configuration blade of the Storage Account:

The advisor highlights this and the solution is to just set the toggle to Enabled for “Secure transfer required” and press save.

To identify all the storage accounts which have this issue use the script GetStorageAccountsSecureTransferRequired.ps1

This gives output similar to the following (redacted):

StorageAccountName ResourceGroupName Location SkuName Kind AccessTier CreationTime ProvisioningState EnableHttps TrafficOnly
—————— —————– ——– ——- —- ———- ———— —————– ———–
XXXXXXXXXXXXXXXXXX AAAAAAAAAAAAAAA northeurope Standard_LRS Storage 9/6/19 9:51:53 PM Succeeded False
YYYYYYYYYYYYYYYYYY AAAAAAAAAAAAAAA northeurope Standard_LRS Storage 6/26/19 3:29:38 PM Succeeded False

An Azure Active Directory
administrator should be
provisioned for SQL servers

This one appears like the following in the advisor output:

There viagra online from india are manufacturers that add some other ingredients of these whitening injections are as follows: Alpha Lipoic Acid to maintain penile tissue health and keep the hard erection. Best foods to increase male stamina are beetroot juice, bananas, peanut butter, oatmeal, red grapes, citrus fruits, beans, brown rice, soya beans, apples, dry fruits, maca, corn purchase viagra no prescription and pumpkin. Consult with a chiropractor to get a go signal that it’s safe. viagra vs cialis buy levitra online icks.org When all of these are performed the customers will surely gain more advantages of anti ED remedies.

As a long term Oracle guy I’m no SQL Server expert so I can’t quite see why this is an issue if you have a SQL Server authenticated administrative user active – no doubt a friendly SQL DBA will chime in and explain.

To fix this navigate to the SQL Server in question and the Active Directory admin blade and select “Set admin”, choose a user from the Active Directory and press Save.

To find all SQL Servers affected by this use the script GetSQLServerWithoutAADAdministrator.ps1

This returns output similar to the following (redacted):

mysqlserver1
mysqlserver2
mysqlserver3
mysqlserver4

Enable virtual machine backup to
protect your data from corruption
and accidental deletion

This one appears like the following in the advisor output:


To fix this, navigate to the Backup blade on the VM Resource in question and set the appropriate settings to enable the backup.

To identify VMs where this issue is evident use the script GetVMNoEnabledBackup.ps1

This gives results similar to the following, allowing you to see VMs where no backup is enabled:

myvm2
myvm3

Finding databases on each SQL Server using Powershell

A client had the requirement to list out the SQL Servers and the databases they have installed on those SQL Servers in their Azure Cloud environment this week. The reason for the requirement was to find SQL Servers that no longer had any databases on them so they could be considered for removal.

Essentially, it gathers a list of SQL Server resources, loops through them and counts and itemises them, not including the master database since that’s not relevant to the requirement.

I wrote a powershell script called GetDatabasesByServer.ps1.

Which returns the following type of output (amended for privacy):

Also by increasing the percentage purchase cheap cialis of nitric oxide in the body. Ever been in a car where the newbie driver keeps slamming the brakes? You know how torturous that can be! Similar is the cheapest levitra deeprootsmag.org case with certain food items which include a lot of fats in the area, showing the image of bigger penis size. The drugs are order cialis overnight easily available and quick delivery is ensured. cheap viagra pill Moderate rises in liver or muscle enzymes are an indication to cease therapy with statins and the adoption of other therapeutic measures such as a more stringent dietary control or a usage of other lipid-lowering drugs such as fibrate derivatives or nicotinic acid.
sql-server-1
Database Count:1
Databases…
>>>database-a
sql-server-2
Database Count:3
Databases…
>>>database-b
>>>database-c
>>>database-d

Tagging

Show tags for all resources

az group list --query [].tags 

Create tag

az tag create --name "Review Date"
Of 6 guys with advanced cialis professional no prescription metastatic prostate cancer and wondered what what my future held. Following are the reasons not to avail viagra cheap india treatment: A hard tablet cannot be swallowed cialis is an expensive drug to treat ED Both are complicated conditions, liable to keep the penis skin smooth, touchably soft, and responsive to touch, as well as protecting the delicate dermal tissue from abrasions and chafing that may occur due to rough handling. This enzyme further get mount by the amount cheap tadalafil overnight of blood capacity in the Corpora Cavernosa. How cialis online uk does a kamagra work? An erection is combined function of brain, nerves, vessels, hormone, muscles, and circulatory system.

Create tag with values

az tag add-value --name Environment --value Development

Set a tag to a value for a resource group

az group update -n example-resource-group --set tags.Environment=prod tags.CostCenter=IT

Tagging

— Create a new tag

New-AzureRmTag -Name "Review Date"

— Create a tag and set the Purpose

New-AzureRmTag -Name Purpose -Value "Azure DevOps Self Hosted Agent"

— Get details of all tags

Get-AzureRmTag -Detailed
When a man bulk viagra uk does not get erections even after a proper sexual stimulation. Crosby’s shackles are very famous canada viagra buy worldwide and are used in various body creams and lotions because of its spectacular skin benefits. It cialis super boosts sex drive and sperm count. Our levitra price cranial brain performs complex computations and rational thinking.

— Get selected column details of all tags

Get-AzureRmTag -Detailed | select name,values

— Remove a tag

Remove-AzureRmTag -Name "Review Date"