Azure Powershell: Manage SQL Azure dbs

Single Db->Elastic Pool:

New-AzureRmSqlDatabaseCopy -ResourceGroupName “SourceResourceGroupName” -ServerName “SourceServerName” -DatabaseName “SourceDBName” -CopyResourceGroupName “TargetResourceGroupName” -CopyServerName “TargetServerName” -ElasticPoolName “TargetElasticPool” -CopyDatabaseName “NewDatabaseName”

Remove-AzureRmSqlDatabase -ResourceGroupName “RG_GSDb1” -ServerName “gsdbserverpool” -DatabaseName newdeltest2

Cmdlet Description
New-AzureRmSqlElasticPool Creates an elastic database pool on a logical SQL server.
Get-AzureRmSqlElasticPool Gets elastic pools and their property values on a logical SQL server.
Set-AzureRmSqlElasticPool Modifies properties of an elastic database pool on a logical SQL server. For example, use the StorageMB property to modify the max storage of an elastic pool.
Remove-AzureRmSqlElasticPool Deletes an elastic database pool on a logical SQL server.
Get-AzureRmSqlElasticPoolActivity Gets the status of operations on an elastic pool on a logical SQL server.
New-AzureRmSqlDatabase Creates a new database in an existing pool or as a single database.
Get-AzureRmSqlDatabase Gets one or more databases.
Set-AzureRmSqlDatabase Sets properties for a database, or moves an existing database into, out of, or between elastic pools.
Remove-AzureRmSqlDatabase Removes a database.

https://docs.microsoft.com/en-us/azure/sql-database/sql-database-elastic-pool

Azure Powershell: Basic CmdLets

Get-AzureSubscription  -Current   # List current subscription
Get-AzureSubscription  # List all subscriptions

——————————————————————————————————————————–LOGIN

– Either: Login-AzureRmAccount
Select-AzureRmSubscription -SubscriptionName GS-DevOps
Set-AzureRmContext -SubscriptionName GS-DevOps

– or: Add-AzureAccount (You can add as many accounts to Azure PowerShell)

– or: Get-AzurePublishSettingsFile

Import-AzurePublishSettingsFile C:\Users\GS\Downloads\mysubs.publishsettings

——-

Just to make sure that everything has gone right run the following cmdlet:
Get-AzureAccount / Get-AzureSubscription  -Current / Get-AzureSubscription

————————————————————————

# Select Subscription
Set-AzureRmContext -SubscriptionId 38d8d050-5c50-4eba-b06b-16124ec3b55c
Select-AzureSubscription -SubscriptionName GS-Devops
Select-AzureSubscription -Current -SubscriptionName GS-Devops

———————————————————————-

To get a list of resource groups in your subscription, use Get-AzureRmResourceGroup.

 

 

Why migrate to Cloud?

Benefits, Risks

Cloud Service Models:
• IaaS
• PaaS
• SaaS

Cloud Type:
• Public
• Private
• Hybrid

Assessing Applications for a Cloud Migration
• Application design complexity
• Integration complexity
• The host operating system
• The application database
• Network

Cost Comparison
• Pricing Estimation

Proof of Concept
• Performance comparisons with your existing application
• Complexity levels involved in migrating the application
• Network challenges that need to be worked out
• Reliability
• Cloud provider support evaluation

https://cloudacademy.com/blog/cloud-migration-benefits-risks/