Azure: Difference between revisions

From Piszczynski
piszczynski>Aleks
No edit summary
 
(3 intermediate revisions by the same user not shown)
Line 20: Line 20:


Get Policy info
Get Policy info
*Get-AzPolicyDefinition | where {$_.Properties.DisplayName -eq "<policyname>"}
*<syntaxhighlight lang="powershell">
Get-AzPolicyDefinition | where {$_.Properties.DisplayName -eq "<policyname>"}
</syntaxhighlight>
Assign to pass to commands
Assign to pass to commands
*$definition = Get-AzPolicyDefinition | where {$_.Properties.DisplayName -eq "<policyname>"}
*<syntaxhighlight lang="powershell">
$definition = Get-AzPolicyDefinition | where {$_.Properties.DisplayName -eq "<policyname>"}
</syntaxhighlight>




Get Resource group info - Best to Create object of group for use in commands
Get Resource group info - Best to Create object of group for use in commands


*Get-AzResourceGroup <name of group>
*<syntaxhighlight lang="powershell">
 
Get-AzResourceGroup <name of group>
*$rg = Get-AzResourceGroup <Name of group>
</syntaxhighlight><syntaxhighlight lang="powershell">
$rg = Get-AzResourceGroup <Name of group>
</syntaxhighlight>






Assign Policy
Assign Policy
*New-AzPolicyAssignment -Name "NameofPolicy" -DisplayName "Displaynamofpolicy" -scope $rg.ResourceId -PolicyDefinition <AZpolicy definition>
*<syntaxhighlight lang="powershell">
New-AzPolicyAssignment -Name "NameofPolicy" -DisplayName "Displaynamofpolicy" -scope $rg.ResourceId -PolicyDefinition <AZpolicy definition>
</syntaxhighlight>




== Azure User Accounts ==
== Azure User Accounts ==
Create new user accounts:
Create new user accounts:
*New-AzureADUser
*<syntaxhighlight lang="powershell">
New-AzureADUser
</syntaxhighlight>


== Azure updates ==
== Azure updates ==
See the following article on service tags to enable azure services / updates [https://learn.microsoft.com/en-us/azure/virtual-network/service-tags-overview MS KB]
See the following article on service tags to enable azure services / updates [https://learn.microsoft.com/en-us/azure/virtual-network/service-tags-overview MS KB]
== Azure Machine Sizing ==
Azure machine sizing list of benchmark scores:
[https://learn.microsoft.com/en-gb/azure/virtual-machines/linux/compute-benchmark-scores Benchmark Scores]
== Azure Handy Resources ==
Financial planning:
* [https://azure.microsoft.com/pricing/tco/calculator/ Total cost of ownership (TCO) calculator]
* [https://azure.microsoft.com/pricing/calculator/ Azure pricing calculator]
* [https://azure.microsoft.com/services/cost-management/ Microsoft Cost Management]
* [https://learn.microsoft.com/en-us/azure/cloud-adoption-framework/strategy/financial-models Create a financial model for cloud transformation]
Cloud migration:
* [https://learn.microsoft.com/en-us/azure/cloud-adoption-framework/migrate/ Migration in documentation]
* [https://learn.microsoft.com/en-us/azure/cloud-adoption-framework/migrate/migration-considerations/ Migration considerations]
* [https://learn.microsoft.com/en-us/azure/cloud-adoption-framework/decision-guides/migrate-decision-guide/ Migration tools decision guide]

Latest revision as of 18:24, 15 July 2024

Azure

Set Subsctiption in powershell session: Look at the subscriptions and select the id of the one you want:

  • Get-AzSubscription
  • $Context = Get-AzSubscription -SubscriptionID <subID>; Set-AzContext $Context


Azure CLI

Install Azure CLI:

  • winget install -e --id Microsoft.AzureCLI

Identify data locations in shell

  • df

Azure powershell

Get Policy info

  • Get-AzPolicyDefinition | where {$_.Properties.DisplayName -eq "<policyname>"}
    

Assign to pass to commands

  • $definition = Get-AzPolicyDefinition | where {$_.Properties.DisplayName -eq "<policyname>"}
    


Get Resource group info - Best to Create object of group for use in commands

  • Get-AzResourceGroup <name of group>
    
    $rg = Get-AzResourceGroup <Name of group>
    


Assign Policy

  • New-AzPolicyAssignment -Name "NameofPolicy" -DisplayName "Displaynamofpolicy" -scope $rg.ResourceId -PolicyDefinition <AZpolicy definition>
    


Azure User Accounts

Create new user accounts:

  • New-AzureADUser
    

Azure updates

See the following article on service tags to enable azure services / updates MS KB

Azure Machine Sizing

Azure machine sizing list of benchmark scores:

Benchmark Scores

Azure Handy Resources

Financial planning:

Cloud migration: