Submit Search
Upload
Azure Powershell Tips
â˘
Download as PPT, PDF
â˘
1 like
â˘
485 views
T
Thangamani Durairaj
Follow
Quick references to work around in Azure
Read less
Read more
Technology
Report
Share
Report
Share
1 of 10
Download now
Recommended
best aws training in bangalore
best aws training in bangalore
rajkamal560066
Â
Parse: A Mobile Backend as a Service (MBaaS)
Parse: A Mobile Backend as a Service (MBaaS)
Ville Seppänen
Â
Node.js and Parse
Node.js and Parse
Nicholas McClay
Â
Parse cloud code
Parse cloud code
çśä˝ ĺ
Â
Building Android apps with Parse
Building Android apps with Parse
DroidConTLV
Â
Sherlock Homepage - A detective story about running large web services (VISUG...
Sherlock Homepage - A detective story about running large web services (VISUG...
Maarten Balliauw
Â
AWS October Webinar Series - Introducing Amazon Elasticsearch Service
AWS October Webinar Series - Introducing Amazon Elasticsearch Service
Amazon Web Services
Â
Alfresco devcon 2019: How to track user activities without using the audit fu...
Alfresco devcon 2019: How to track user activities without using the audit fu...
konok
Â
Recommended
best aws training in bangalore
best aws training in bangalore
rajkamal560066
Â
Parse: A Mobile Backend as a Service (MBaaS)
Parse: A Mobile Backend as a Service (MBaaS)
Ville Seppänen
Â
Node.js and Parse
Node.js and Parse
Nicholas McClay
Â
Parse cloud code
Parse cloud code
çśä˝ ĺ
Â
Building Android apps with Parse
Building Android apps with Parse
DroidConTLV
Â
Sherlock Homepage - A detective story about running large web services (VISUG...
Sherlock Homepage - A detective story about running large web services (VISUG...
Maarten Balliauw
Â
AWS October Webinar Series - Introducing Amazon Elasticsearch Service
AWS October Webinar Series - Introducing Amazon Elasticsearch Service
Amazon Web Services
Â
Alfresco devcon 2019: How to track user activities without using the audit fu...
Alfresco devcon 2019: How to track user activities without using the audit fu...
konok
Â
Azure Resource Manager (ARM) Template - Beginner's Guide
Azure Resource Manager (ARM) Template - Beginner's Guide
Juv Chan
Â
Parse Advanced
Parse Advanced
Tushar Acharya
Â
Inside Azure Resource Manager
Inside Azure Resource Manager
Michael Collier
Â
Developing cacheable backend applications - Appdevcon 2019
Developing cacheable backend applications - Appdevcon 2019
Thijs Feryn
Â
An Overview of Node.js
An Overview of Node.js
Ayush Mishra
Â
Full stack development with node and NoSQL - All Things Open - October 2017
Full stack development with node and NoSQL - All Things Open - October 2017
Matthew Groves
Â
Working with PowerVC via its REST APIs
Working with PowerVC via its REST APIs
Joe Cropper
Â
Servlets intro
Servlets intro
vantinhkhuc
Â
Lecture 10 Networking on Mobile Devices
Lecture 10 Networking on Mobile Devices
Maksym Davydov
Â
AWS May Webinar Series - Deep Dive: Infrastructure as Code
AWS May Webinar Series - Deep Dive: Infrastructure as Code
Amazon Web Services
Â
Top Ten Web Application Defenses v12
Top Ten Web Application Defenses v12
Jim Manico
Â
Hadoop security
Hadoop security
shrey mehrotra
Â
Stratalux Cloud Formation and Chef Integration Presentation
Stratalux Cloud Formation and Chef Integration Presentation
Jeremy Przygode
Â
Java Configuration Deep Dive with Spring
Java Configuration Deep Dive with Spring
Joshua Long
Â
Top Ten Java Defense for Web Applications v2
Top Ten Java Defense for Web Applications v2
Jim Manico
Â
ě¤íë§ ěí댏í°ëĄ ěěíë ěš ě´í댏ěźě´ě ëł´ě
ě¤íë§ ěí댏í°ëĄ ěěíë ěš ě´í댏ěźě´ě ëł´ě
HyungTae Lim
Â
W3 conf hill-html5-security-realities
W3 conf hill-html5-security-realities
Brad Hill
Â
Side by Side with Elasticsearch and Solr
Side by Side with Elasticsearch and Solr
Sematext Group, Inc.
Â
High availability solution database mirroring
High availability solution database mirroring
Mustafa EL-Masry
Â
Azure cosmosdb
Azure cosmosdb
Udaiappa Ramachandran
Â
Azure powershell management
Azure powershell management
Christian Toinard
Â
Azure ARM Templates 101
Azure ARM Templates 101
Aaron Saikovski
Â
More Related Content
What's hot
Azure Resource Manager (ARM) Template - Beginner's Guide
Azure Resource Manager (ARM) Template - Beginner's Guide
Juv Chan
Â
Parse Advanced
Parse Advanced
Tushar Acharya
Â
Inside Azure Resource Manager
Inside Azure Resource Manager
Michael Collier
Â
Developing cacheable backend applications - Appdevcon 2019
Developing cacheable backend applications - Appdevcon 2019
Thijs Feryn
Â
An Overview of Node.js
An Overview of Node.js
Ayush Mishra
Â
Full stack development with node and NoSQL - All Things Open - October 2017
Full stack development with node and NoSQL - All Things Open - October 2017
Matthew Groves
Â
Working with PowerVC via its REST APIs
Working with PowerVC via its REST APIs
Joe Cropper
Â
Servlets intro
Servlets intro
vantinhkhuc
Â
Lecture 10 Networking on Mobile Devices
Lecture 10 Networking on Mobile Devices
Maksym Davydov
Â
AWS May Webinar Series - Deep Dive: Infrastructure as Code
AWS May Webinar Series - Deep Dive: Infrastructure as Code
Amazon Web Services
Â
Top Ten Web Application Defenses v12
Top Ten Web Application Defenses v12
Jim Manico
Â
Hadoop security
Hadoop security
shrey mehrotra
Â
Stratalux Cloud Formation and Chef Integration Presentation
Stratalux Cloud Formation and Chef Integration Presentation
Jeremy Przygode
Â
Java Configuration Deep Dive with Spring
Java Configuration Deep Dive with Spring
Joshua Long
Â
Top Ten Java Defense for Web Applications v2
Top Ten Java Defense for Web Applications v2
Jim Manico
Â
ě¤íë§ ěí댏í°ëĄ ěěíë ěš ě´í댏ěźě´ě ëł´ě
ě¤íë§ ěí댏í°ëĄ ěěíë ěš ě´í댏ěźě´ě ëł´ě
HyungTae Lim
Â
W3 conf hill-html5-security-realities
W3 conf hill-html5-security-realities
Brad Hill
Â
Side by Side with Elasticsearch and Solr
Side by Side with Elasticsearch and Solr
Sematext Group, Inc.
Â
High availability solution database mirroring
High availability solution database mirroring
Mustafa EL-Masry
Â
Azure cosmosdb
Azure cosmosdb
Udaiappa Ramachandran
Â
What's hot
(20)
Azure Resource Manager (ARM) Template - Beginner's Guide
Azure Resource Manager (ARM) Template - Beginner's Guide
Â
Parse Advanced
Parse Advanced
Â
Inside Azure Resource Manager
Inside Azure Resource Manager
Â
Developing cacheable backend applications - Appdevcon 2019
Developing cacheable backend applications - Appdevcon 2019
Â
An Overview of Node.js
An Overview of Node.js
Â
Full stack development with node and NoSQL - All Things Open - October 2017
Full stack development with node and NoSQL - All Things Open - October 2017
Â
Working with PowerVC via its REST APIs
Working with PowerVC via its REST APIs
Â
Servlets intro
Servlets intro
Â
Lecture 10 Networking on Mobile Devices
Lecture 10 Networking on Mobile Devices
Â
AWS May Webinar Series - Deep Dive: Infrastructure as Code
AWS May Webinar Series - Deep Dive: Infrastructure as Code
Â
Top Ten Web Application Defenses v12
Top Ten Web Application Defenses v12
Â
Hadoop security
Hadoop security
Â
Stratalux Cloud Formation and Chef Integration Presentation
Stratalux Cloud Formation and Chef Integration Presentation
Â
Java Configuration Deep Dive with Spring
Java Configuration Deep Dive with Spring
Â
Top Ten Java Defense for Web Applications v2
Top Ten Java Defense for Web Applications v2
Â
ě¤íë§ ěí댏í°ëĄ ěěíë ěš ě´í댏ěźě´ě ëł´ě
ě¤íë§ ěí댏í°ëĄ ěěíë ěš ě´í댏ěźě´ě ëł´ě
Â
W3 conf hill-html5-security-realities
W3 conf hill-html5-security-realities
Â
Side by Side with Elasticsearch and Solr
Side by Side with Elasticsearch and Solr
Â
High availability solution database mirroring
High availability solution database mirroring
Â
Azure cosmosdb
Azure cosmosdb
Â
Similar to Azure Powershell Tips
Azure powershell management
Azure powershell management
Christian Toinard
Â
Azure ARM Templates 101
Azure ARM Templates 101
Aaron Saikovski
Â
Aprovisionamiento multi-proveedor con Terraform - Plain Concepts DevOps day
Aprovisionamiento multi-proveedor con Terraform - Plain Concepts DevOps day
Plain Concepts
Â
(SEC309) Amazon VPC Configuration: When Least Privilege Meets the Penetration...
(SEC309) Amazon VPC Configuration: When Least Privilege Meets the Penetration...
Amazon Web Services
Â
Deploying SharePoint @ Cloud
Deploying SharePoint @ Cloud
Juan AndrĂŠs Valenzuela
Â
2013 05-openstack-israel-heat
2013 05-openstack-israel-heat
Alex Heneveld
Â
ASP.NET Overview - Alvin Lau
ASP.NET Overview - Alvin Lau
Spiffy
Â
Provisioning in Microsoft Azure
Provisioning in Microsoft Azure
ilagin
Â
My First Big Data Application
My First Big Data Application
Amazon Web Services
Â
Scaling Drupal in AWS Using AutoScaling, Cloudformation, RDS and more
Scaling Drupal in AWS Using AutoScaling, Cloudformation, RDS and more
Dropsolid
Â
2013 05-fite-club-working-models-cloud-growing-up
2013 05-fite-club-working-models-cloud-growing-up
Alex Heneveld
Â
Charla - SharePoint en la Nube (17Jul2013)
Charla - SharePoint en la Nube (17Jul2013)
Juan AndrĂŠs Valenzuela
Â
Introducing Asp.Net Ajax 4.0 Preview
Introducing Asp.Net Ajax 4.0 Preview
Cat Chen
Â
Java clients for elasticsearch
Java clients for elasticsearch
Florian Hopf
Â
OData: Universal Data Solvent or Clunky Enterprise Goo? (GlueCon 2015)
OData: Universal Data Solvent or Clunky Enterprise Goo? (GlueCon 2015)
Pat Patterson
Â
(BAC404) Deploying High Availability and Disaster Recovery Architectures with...
(BAC404) Deploying High Availability and Disaster Recovery Architectures with...
Amazon Web Services
Â
Zero to Sixty: AWS CloudFormation (DMG201) | AWS re:Invent 2013
Zero to Sixty: AWS CloudFormation (DMG201) | AWS re:Invent 2013
Amazon Web Services
Â
Global Windows Azure Bootcamp : Cedric Derue playing with php on azure. (spon...
Global Windows Azure Bootcamp : Cedric Derue playing with php on azure. (spon...
MUG-Lyon Microsoft User Group
Â
Playing with php_on_azure
Playing with php_on_azure
CEDRIC DERUE
Â
Power Shell and Sharepoint 2013
Power Shell and Sharepoint 2013
Mohan Arumugam
Â
Similar to Azure Powershell Tips
(20)
Azure powershell management
Azure powershell management
Â
Azure ARM Templates 101
Azure ARM Templates 101
Â
Aprovisionamiento multi-proveedor con Terraform - Plain Concepts DevOps day
Aprovisionamiento multi-proveedor con Terraform - Plain Concepts DevOps day
Â
(SEC309) Amazon VPC Configuration: When Least Privilege Meets the Penetration...
(SEC309) Amazon VPC Configuration: When Least Privilege Meets the Penetration...
Â
Deploying SharePoint @ Cloud
Deploying SharePoint @ Cloud
Â
2013 05-openstack-israel-heat
2013 05-openstack-israel-heat
Â
ASP.NET Overview - Alvin Lau
ASP.NET Overview - Alvin Lau
Â
Provisioning in Microsoft Azure
Provisioning in Microsoft Azure
Â
My First Big Data Application
My First Big Data Application
Â
Scaling Drupal in AWS Using AutoScaling, Cloudformation, RDS and more
Scaling Drupal in AWS Using AutoScaling, Cloudformation, RDS and more
Â
2013 05-fite-club-working-models-cloud-growing-up
2013 05-fite-club-working-models-cloud-growing-up
Â
Charla - SharePoint en la Nube (17Jul2013)
Charla - SharePoint en la Nube (17Jul2013)
Â
Introducing Asp.Net Ajax 4.0 Preview
Introducing Asp.Net Ajax 4.0 Preview
Â
Java clients for elasticsearch
Java clients for elasticsearch
Â
OData: Universal Data Solvent or Clunky Enterprise Goo? (GlueCon 2015)
OData: Universal Data Solvent or Clunky Enterprise Goo? (GlueCon 2015)
Â
(BAC404) Deploying High Availability and Disaster Recovery Architectures with...
(BAC404) Deploying High Availability and Disaster Recovery Architectures with...
Â
Zero to Sixty: AWS CloudFormation (DMG201) | AWS re:Invent 2013
Zero to Sixty: AWS CloudFormation (DMG201) | AWS re:Invent 2013
Â
Global Windows Azure Bootcamp : Cedric Derue playing with php on azure. (spon...
Global Windows Azure Bootcamp : Cedric Derue playing with php on azure. (spon...
Â
Playing with php_on_azure
Playing with php_on_azure
Â
Power Shell and Sharepoint 2013
Power Shell and Sharepoint 2013
Â
Recently uploaded
Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...
Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...
apidays
Â
Finology Group â Insurtech Innovation Award 2024
Finology Group â Insurtech Innovation Award 2024
The Digital Insurer
Â
Automating Google Workspace (GWS) & more with Apps Script
Automating Google Workspace (GWS) & more with Apps Script
wesley chun
Â
Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...
Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...
Miguel AraĂşjo
Â
How to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected Worker
ThousandEyes
Â
đŹ The future of MySQL is Postgres đ
đŹ The future of MySQL is Postgres đ
RTylerCroy
Â
Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...
Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...
Drew Madelung
Â
Salesforce Community Group Quito, Salesforce 101
Salesforce Community Group Quito, Salesforce 101
Paola De la Torre
Â
A Domino Admins Adventures (Engage 2024)
A Domino Admins Adventures (Engage 2024)
Gabriella Davis
Â
EIS-Webinar-Prompt-Knowledge-Eng-2024-04-08.pptx
EIS-Webinar-Prompt-Knowledge-Eng-2024-04-08.pptx
Earley Information Science
Â
Breaking the Kubernetes Kill Chain: Host Path Mount
Breaking the Kubernetes Kill Chain: Host Path Mount
Puma Security, LLC
Â
Scaling API-first â The story of a global engineering organization
Scaling API-first â The story of a global engineering organization
Radu Cotescu
Â
IAC 2024 - IA Fast Track to Search Focused AI Solutions
IAC 2024 - IA Fast Track to Search Focused AI Solutions
Enterprise Knowledge
Â
CNv6 Instructor Chapter 6 Quality of Service
CNv6 Instructor Chapter 6 Quality of Service
giselly40
Â
Exploring the Future Potential of AI-Enabled Smartphone Processors
Exploring the Future Potential of AI-Enabled Smartphone Processors
debabhi2
Â
Handwritten Text Recognition for manuscripts and early printed texts
Handwritten Text Recognition for manuscripts and early printed texts
Maria Levchenko
Â
A Call to Action for Generative AI in 2024
A Call to Action for Generative AI in 2024
Results
Â
04-2024-HHUG-Sales-and-Marketing-Alignment.pptx
04-2024-HHUG-Sales-and-Marketing-Alignment.pptx
HampshireHUG
Â
Driving Behavioral Change for Information Management through Data-Driven Gree...
Driving Behavioral Change for Information Management through Data-Driven Gree...
Enterprise Knowledge
Â
GenCyber Cyber Security Day Presentation
GenCyber Cyber Security Day Presentation
Michael W. Hawkins
Â
Recently uploaded
(20)
Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...
Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...
Â
Finology Group â Insurtech Innovation Award 2024
Finology Group â Insurtech Innovation Award 2024
Â
Automating Google Workspace (GWS) & more with Apps Script
Automating Google Workspace (GWS) & more with Apps Script
Â
Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...
Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...
Â
How to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected Worker
Â
đŹ The future of MySQL is Postgres đ
đŹ The future of MySQL is Postgres đ
Â
Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...
Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...
Â
Salesforce Community Group Quito, Salesforce 101
Salesforce Community Group Quito, Salesforce 101
Â
A Domino Admins Adventures (Engage 2024)
A Domino Admins Adventures (Engage 2024)
Â
EIS-Webinar-Prompt-Knowledge-Eng-2024-04-08.pptx
EIS-Webinar-Prompt-Knowledge-Eng-2024-04-08.pptx
Â
Breaking the Kubernetes Kill Chain: Host Path Mount
Breaking the Kubernetes Kill Chain: Host Path Mount
Â
Scaling API-first â The story of a global engineering organization
Scaling API-first â The story of a global engineering organization
Â
IAC 2024 - IA Fast Track to Search Focused AI Solutions
IAC 2024 - IA Fast Track to Search Focused AI Solutions
Â
CNv6 Instructor Chapter 6 Quality of Service
CNv6 Instructor Chapter 6 Quality of Service
Â
Exploring the Future Potential of AI-Enabled Smartphone Processors
Exploring the Future Potential of AI-Enabled Smartphone Processors
Â
Handwritten Text Recognition for manuscripts and early printed texts
Handwritten Text Recognition for manuscripts and early printed texts
Â
A Call to Action for Generative AI in 2024
A Call to Action for Generative AI in 2024
Â
04-2024-HHUG-Sales-and-Marketing-Alignment.pptx
04-2024-HHUG-Sales-and-Marketing-Alignment.pptx
Â
Driving Behavioral Change for Information Management through Data-Driven Gree...
Driving Behavioral Change for Information Management through Data-Driven Gree...
Â
GenCyber Cyber Security Day Presentation
GenCyber Cyber Security Day Presentation
Â
Azure Powershell Tips
1.
Powershell, AzureRM, Subscribtion,
Connect, Login, Resource Group, Billings, Tag, Active Directory Active Directory, Role Based Access Control Storage, SQL Database, App Service, Content Delivery Network, Key Vault Redis Cache, Service Bus, Event Hub, Event Grid, Media Services, Logic Apps, Stream Analytics, IoT Hub Virtual Network, Subnet, Network Gateway, Express Route, Network Security Group, Virtual Machine, DiSK Virtual Machine Extension, Scale Set, VHD Load balancer, Monitor, Data Store, Lake, Analytics Traffic Manager Power BI, Automation
2.
Powershell, AzureRM, Subscribtion,
Connect, Login, Resource Group, Billings, Tag, Active Directory #Powershell Installation Get-Module -Name PowerShellGet -ListAvailable | Select-Object -Property Name,Version,Path Install-Module PowerShellGet âForce #Azure Resource Manager Installation Install-Module -Name AzureRM -AllowClobber Get-Module AzureRM -ListAvailable | Select-Object -Property Name,Version,Path #Subscribtion New-AzureRmSubscription -Name "My Subscription" -EnrollmentAccountObjectId (Get-AzureRmEnrollmentAccount)[0].ObjectId) -OfferType MS-AZR-0017P #Login Microsoft Account Connect-AzureRmAccount Disconnect-AzureRmAccount #Login AD Account Set-ExecutionPolicy -ExecutionPolicy RemoteSigned $accountName ="testuser@netsoftsol.onmicrosoft.com" $password = ConvertTo-SecureString "PassWord@2018" -AsPlainText -Force $cred = New-Object System.Management.Automation.PSCredential($accountName, $password) Login-AzureRmAccount -Credential $cred Get-History | Export-CSV C:UsersCommandHistory.CSV Get-History | Set-Content C:UsersCommandHistory.ps1 Get-Command Connect-AzureRmAccount Get-AzureRmContext #Resources New-AzureRmResourceGroup -Name $resourceGroup -Location $location #Billing Get-AzureRmBillingPeriod -Name 201704-1 Get-AzureRmBillingInvoice -Name 2017-02-18-432543543 Get-AzureRmBillingInvoice -Latest Get-AzureRmConsumptionBudget -ResourceGroupName RGBudgets -Name PSBudgetRG #Tag New-AzureRmTag -Name "Department" -Value "Finance" Get-AzureRmTag Get-AzureRmTag -Name "Department" Get-AzureRmTag -Detailed Remove-AzureRmTag -Name "Department" -Value "HumanResources" âPassThru #Active Directory - Create new AAD application, group, user New-AzureRmADApplication -DisplayName "NewApplication" -HomePage "http://www.microsoft.com" -IdentifierUris http://NewApplication New-AzureRmADGroup -DisplayName "MyGroupDisplayName" -MailNickname myemail@domain.com Add-AzureRmADGroupMember -MemberObjectId D9076BBC-D62C-4105-9C78-A7F5BC4A3405 -TargetGroupObjectId 85F89C90-780E-4AA6-9F4F-6F268D322EEE $SecureStringPassword = ConvertTo-SecureString -String "password" -AsPlainText -Force New-AzureRmADApplication -DisplayName "NewApplication" -HomePage "http://www.microsoft.com" -IdentifierUris "http://NewApplication" -Password $SecureStringPassword $SecureStringPassword = ConvertTo-SecureString -String "password" -AsPlainText -Force New-AzureRmADUser -DisplayName "MyDisplayName" -UserPrincipalName "myemail@domain.com" -Password $SecureStringPassword $SecureStringPassword = ConvertTo-SecureString -String "password" -AsPlainText -Force New-AzureRmADSpCredential -ObjectId 1f99cf81-0146-4f4e-beae-2007d0668476 -Password $SecureStringPassword
3.
Active Directory, Role
Based Access Control #Service Principal New-AzureRmADServicePrincipal -Role Reader New-AzureRmADServicePrincipal -Scope /subscriptions/zzzzzzzz-zzzz-zzzz-zzzz-zzzzzzzzzzzz/resourceGroups/myResourceGroup New-AzureRmADServicePrincipal -ApplicationId 34a28ad2-dec4-4a41-bc3b-d22ddf90000e $SecureStringPassword = ConvertTo-SecureString -String "password" -AsPlainText -Force New-AzureRmADServicePrincipal -DisplayName SPForNoApp -Password $SecureStringPassword Get-AzureRmADApplication -ObjectId 3ede3c26-b443-4e0b-9efc-b05e68338dc3 | New-AzureRmADServicePrincipal #Create Role $role = Get-AzureRmRoleDefinition "Virtual Machine Contributor" $role.Id = $null $role.Name = "Virtual Machine Operator" $role.Description = "Can monitor and restart virtual machines." $role.Actions.Clear() $role.Actions.Add("Microsoft.Storage/*/read") $role.Actions.Add("Microsoft.Network/*/read") $role.Actions.Add("Microsoft.Compute/*/read") $role.Actions.Add("Microsoft.Compute/virtualMachines/start/action") $role.Actions.Add("Microsoft.Compute/virtualMachines/restart/action") $role.Actions.Add("Microsoft.Authorization/*/read") $role.Actions.Add("Microsoft.Resources/subscriptions/resourceGroups/read") $role.Actions.Add("Microsoft.Insights/alertRules/*") $role.Actions.Add("Microsoft.Support/*") $role.AssignableScopes.Clear() $role.AssignableScopes.Add("/subscriptions/00000000-0000-0000-0000-000000000000") $role.AssignableScopes.Add("/subscriptions/11111111-1111-1111-1111-111111111111") New-AzureRmRoleDefinition -Role $role #Subscribtion #Create Role JSON { "Name": "Custom Role 1", "Id": null, "IsCustom": true, "Description": "Allows for read access to Azure storage and compute resources and access to support", "Actions": [ "Microsoft.Compute/*/read", "Microsoft.Storage/*/read", "Microsoft.Support/*" ], "NotActions": [ ], "AssignableScopes": [ "/subscriptions/00000000-0000-0000-0000-000000000000", "/subscriptions/11111111-1111-1111-1111-111111111111" ] } New-AzureRmRoleDefinition -InputFile "C:CustomRolescustomrole1.json" GetAzureRmRoleDefinition | ft name (Get-AzureRmRoleDefinition "Virtual Machine Contributor").actions Get-AzureRmRoleAssignment -scope "/subscriptions/f0675ec9-480d-4c2a-982a-ed97983af390" | select displayname New-AzureRmRoleAssignment -ObjectId "74b007ea-ab34-4209-981e-c538200fe251" RoleDefinitionName "Virtual Machine Contributor" -Scope "/subscriptions/f0675ec9-480d-4c2a-982a-ed97983"â Get-AzureRmADGroup -SearchString "Sales (Sample Group)" New-AzureRmRoleAssignment -ObjectId "74b007ea-ab34-4209-981e-c538200fe251" RoleDefinitionName "Virtual Machine Contributor" -Scope "/subscriptions/f0675ec9-480d-4c2a-982a-ed97983"â
4.
Storage, SQL Database,
App Service, Content Delivery Network, Key Vault #Storage New-AzureRmStorageAccount -Location Central-US -Name $storageaccount -ResourceGroupName $resourceGroup -SkuName Standard_GRS $StorageAccountKey=Get-AzureRmStorageAccountKey -ResourceGroupName SampleGroup -name SampleStore $ctx = New-AzureStorageContext -StorageAccountName $storageaccount -StorageAccountKey $StorageAccountKey.value[0] New-AzureStorageContainer -Name $storagecontainer -Context $ctx -Permission Blob #SQL New-AzureRmSqlDatabase -ResourceGroupName "ResourceGroup01" -ServerName "Server01" -DatabaseName "Database01" $serverDNSAlias = New-AzureRmSqlServerDnsAlias -ResourceGroupName rg -ServerName serverName -DnsAliasName aliasName New-AzureRmSqlElasticPool -ResourceGroupName "ResourceGroup01" -ServerName "Server01" -ElasticPoolName "ElasticPool01" -Edition "Standard" -Dtu 400 -DatabaseDtuMin 10 -DatabaseDtuMax 100 New-AzureRmSqlDatabase -ResourceGroupName "ResourceGroup01" -ServerName "Server01" -DatabaseName "Database01" -ElasticPoolName "ElasticPool01" New-AzureRmSqlDatabase -ResourceGroupName "ResourceGroup01" -ServerName "Server01" -DatabaseName "Database03" -Edition "GeneralPurpose" -Vcore 2 -ComputeGeneration "Gen4â #App Service New-AzureRmAppServicePlan -ResourceGroupName "Default-Web-WestUS" -Name "ContosoASP" -Location "West US" -Tier "Basic" -NumberofWorkers 2 -WorkerSize "Small" New-AzureRmWebApp -ResourceGroupName Default-Web-WestUS -Name "ContosoSite" -Location "West US" -AppServicePlan "ContosoServicePlan" New-AzureRmWebAppSSLBinding -ResourceGroupName "ContosoResourceGroup" -WebAppName "ContosoWebApp" -Thumbprint "E3A38EBA60CAA1C162785A2199C3" -Name www.contoso.com New-AzureRmWebAppBackup -ResourceGroupName "Default-Web-WestUS" -Name "ContosoWebApp" -StorageAccountUrl "https://storageaccount.file.core.windows.net" New-AzureRmWebAppDatabaseBackupSetting -ResourceGroupName "Default-Web-WestUS" -Name "ContosoWebApp" -ConnectionString "MyConnectionString" -DatabaseType "SqlAzure" New-AzureRmWebAppSlot -ResourceGroupName Default-Web-WestUS -Name "ContosoSite" -AppServicePlan "ContosoServicePlan" -Slot "Slot001â Set-AzureRmWebApp -ResourceGroupName "Default-Web-WestUS" -Name "ContosoWebApp" -HttpLoggingEnabled $true Restore-AzureRmWebAppBackup -ResourceGroupName "Default-Web-WestUS" -Name "ContosoWebApp" -StorageAccountUrl "https://storageaccount.file.core.windows.net" -BlobName "myBlob" Restart-AzureRmWebApp -ResourceGroupName "Default-Web-WestUS" -Name "ContosoSite" Start-AzureRmWebAppSlot -ResourceGroupName "Default-Web-WestUS" -Name "ContosoWebApp" -Slot "Slot001" --- Stop, Remove, Get Switch-AzureRmWebAppSlot -SourceSlotName "sourceslot" -DestinationSlotName "destinationslot" -ResourceGroupName "Default-Web-WestUS" -Name "ContosoWebAppâ #CDN New-AzureRmCdnProfile -ProfileName CdnPoshDemo -ResourceGroupName CdnDemoRG -Sku StandardAkamai -Location "Central US" New-AzureRmCdnEndpoint -ProfileName CdnPoshDemo -ResourceGroupName CdnDemoRG -Location "Central US" -EndpointName cdn1 -OriginName "Contoso" -OriginHostName "www.contoso.com" $endpoint = Get-AzureRmCdnEndpoint -ProfileName CdnPoshDemo -ResourceGroupName CdnDemoRG -EndpointName cdnposhdoc $endpoint.IsCompressionEnabled = $true $endpoint.ContentTypesToCompress = "text/javascript","text/css","application/json" Set-AzureRmCdnEndpoint -CdnEndpoint $endpoint Unpublish-AzureRmCdnEndpointContent -ProfileName CdnDemo -ResourceGroupName CdnDemoRG -EndpointName cdndocdemo -PurgeContent "/images/kitten.png","/video/rickroll.mp4" Publish-AzureRmCdnEndpointContent -ProfileName CdnDemo -ResourceGroupName CdnDemoRG -EndpointName cdndocdemo -LoadContent "/images/kitten.png","/video/rickroll.mp4" Get-AzureRmCdnProfile | Get-AzureRmCdnEndpoint | Unpublish-AzureRmCdnEndpointContent -PurgeContent "/images/*" Stop-AzureRmCdnEndpoint -ProfileName CdnDemo -ResourceGroupName CdnDemoRG -EndpointName cdndocdemo Get-AzureRmCdnProfile | Get-AzureRmCdnEndpoint | Stop-AzureRmCdnEndpoint Get-AzureRmCdnProfile | Get-AzureRmCdnEndpoint | Start-AzureRmCdnEndpoint Remove-AzureRmCdnEndpoint -ProfileName CdnPoshDemo -ResourceGroupName CdnDemoRG -EndpointName cdnposhdoc Get-AzureRmCdnProfile -ProfileName CdnPoshDemo -ResourceGroupName CdnDemoRG | Get-AzureRmCdnEndpoint | Remove-AzureRmCdnEndpoint -Force Remove-AzureRmCdnProfile -ProfileName CdnPoshDemo -ResourceGroupName CdnDemoRG #Key Vault New-AzureRmKeyVault -VaultName 'Contoso03Vault' -ResourceGroupName 'Group14' -Location 'East US' -Sku 'Premiumâ $Policy = New-AzureKeyVaultCertificatePolicy -SecretContentType "application/x-pkcs12" -SubjectName "CN=contoso.com" -IssuerName "Self" -ValidityInMonths 6 -ReuseKeyOnRenewal Add-AzureKeyVaultCertificate -VaultName "ContosoKV01" -Name "TestCert01" -CertificatePolicy $Policy Add-AzureKeyVaultCertificateContact -VaultName "ContosoKV01" -EmailAddress "patti.fuller@contoso.com" âPassThru Add-AzureKeyVaultKey -VaultName 'contoso' -Name 'ITSoftware' -Destination 'Software' Add-AzureKeyVaultKey -VaultName 'contoso' -Name 'ITHsm' -Destination 'HSMâ $Password = ConvertTo-SecureString -String "123" -AsPlainText -Force Import-AzureKeyVaultCertificate -VaultName "ContosoKV01" -Name "ImportCert01" -FilePath "C:UserscontosoUserDesktopimport.pfx" -Password $Password Undo-AzureKeyVaultSecretRemoval -VaultName 'MyKeyVault' -Name 'MySecret' Stop-AzureKeyVaultCertificateOperation -VaultName "Contoso01" -Name "TestCert02" -Force Backup-AzureKeyVaultCertificate -VaultName 'mykeyvault' -Name 'mycert' Backup-AzureKeyVaultKey -VaultName 'MyKeyVault' -Name 'MyCert' -OutputFile 'C:Backup.blob'
5.
Redis Cache, Service
Bus, Event Hub, Event Grid, Media Services, Logic Apps, Stream Analytics, IoT Hub #Redis Cache Get-AzureRmRedisCache -Name "myexistsâ New-AzureRmRedisCache -ResourceGroupName $resourceGroup -Name $RedisCacheName -Location $location -Sku Basic -Size 250MB New-AzureRmRedisCache -ResourceGroupName "MyGroup" -Name "MyCache" -Location "North Central US" New-AzureRmRedisCache -ResourceGroupName "MyGroup" -Name âmc1" -Location "North Central US" -Size 250MB -Sku "Standard" -RedisConfiguration @{"maxmemory-policy" = "allkeys-random"} -Force New-AzureRmRedisCacheFirewallRule -Name "mycache" -RuleName "ruleone" -StartIP "10.0.0.1" -EndIP "10.0.0.32" New-AzureRmRedisCacheKey -ResourceGroupName "ResourceGroup03" -Name "myCache" -KeyType "Primary" -Force New-AzureRmRedisCacheKey -ResourceGroupName "ResourceGroup03" -Name "myCache" -KeyType "Secondary" -Force Import-AzureRmRedisCache -ResourceGroupName "ResourceGroup13" -Name "RedisCache06" -Files @("https://mystorageaccount.blob.core.windows.net/container22/blobname?sv=2015-04- 05&sr=b&sig=caIwutG2uDa0NZ8mjdNJdgOY8%2F8mhwRuGNdICU%2B0pI4%3D&st=2016-05-27T00%3A00%3A00Z&se=2016-05-28T00%3A00%3A00Z&sp=rwd") -Force Export-AzureRmRedisCache -ResourceGroupName "ResourceGroup13" -Name "RedisCache06" -Prefix "blobprefix" -Container "https://mystorageaccount.blob.core.windows.net/container18?sv=2015-04- 05&sr=c&sig=HezZtBZ3DURmEGDduauE7pvETY4kqlPI8JCNa8ATmaw%3D&st=2016-05-27T00%3A00%3A00Z&se=2016-05-28T00%3A00%3A00Z&sp=rwdl" #Service Bus New-AzureRmServiceBusNamespace -Location $location -Name $ServiceBusname -ResourceGroupName $resourceGroup -SkuName Basic $CurrentNamespace = Get-AzureRMServiceBusNamespace -ResourceGroup $resourceGroup -NamespaceName $ServiceBusname New-AzureRmServiceBusQueue -Name $servicebusQueue -Namespace $ServiceBusname -ResourceGroupName $resourceGroup -MaxSizeInMegabytes 1024 New-AzureRmServiceBusAuthorizationRule -Name $servicebusrule -Namespace $ServiceBusname -Queue $servicebusQueue -ResourceGroupName $resourceGroup -Rights Send,listen,manage #Event Hub New-AzureRmEventHub -ResourceGroupName MyResourceGroupName -NamespaceName MyNamespaceName -Location WestUS -EventHubName MyEveNme -MessageRetentionInDays 3 -PartitionCount 2 New-AzureRmEventHubNamespace -ResourceGroupName MyResourceGroupName -NamespaceName MyNamespaceName -Location MyLocation New-AzureRmEventHubNamespace -ResourceGroupName MyResourceGroupName -NamespaceName MyNamespaceName -Location MyLocation -EnableAutoInflate -MaximumThroughputUnits 10 #Event Grid $includedEventTypes = "Microsoft.Resources.ResourceWriteFailure", "Microsoft.Resources.ResourceWriteSuccess" $labels = "Finance", "HR" New-AzureRmEventGridSubscription -Endpoint https://requestb.in/19qlscd1 -EventSubscriptionName ESub1 -SubjectBeginsWith "TestPrefix" -SubjectEndsWith "TestSuffix" -IncludedEventType $includedEventTypes -Label $labels New-AzureRmEventGridTopic -ResourceGroupName MyResourceGroupName -Name Topic1 -Location westus2 -Tag @{ Department="Finance"; Environment="Test" } New-AzureRmEventGridTopicKey -ResourceGroup MyResourceGroupName -TopicName Topic1 -KeyName key1 #Logic Apps $Workflow = Get-AzureRmLogicApp -ResourceGroupName "ResourceGroup11" -Name "LogicApp03" New-AzureRmLogicApp -ResourceGroupName "ResourceGroup11" -Name "LogicApp13" -State "Enabled" -AppServicePlan "SePlan01" -Definition $Workflow.Definition -Parameters $Workflow.Parameters #Media Services New-AzureRmMediaService -ResourceGroupName $ResourceGroupName -AccountName $MediaServiceName -Location $Location -StorageAccountId $StorageAccount.Id -Tags $Tags #Stream Analytics New-AzureRmStreamAnalyticsJob -ResourceGroupName "StreamAnalytics-Default-West-US" -File "C:JobDefinition.jsonâ New-AzureRmStreamAnalyticsJob -ResourceGroupName "StreamAnalytics-Default-West-US" -File "C:JobDefinition.json" -Name "StreamingJob" âForce New-AzureRmStreamAnalyticsInput -ResourceGroupName "StreamAnalytics-Default-West-US" -JobName "StreamingJob" -File "C:Input.json" -Name "EntryStreamâ New-AzureRmStreamAnalyticsOutput -ResourceGroupName "StreamAnalytics-Default-West-US" -File "C:Output.json" -JobName "StreamingJob" -Name "Outputâ #IoT Hub New-AzureRmIotHub -ResourceGroupName "myresourcegroup" -Name "myiothub" -SkuName "S1" -Units 1 -Location "northeurope" -Properties $properties New-AzureRmIotHubExportDevices -ResourceGroupName "myresourcegroup" -Name "myiothub" -ExportBlobContainerUri "https://mystorageaccount.blob.core.windows.net/?sv=2015-04- 05&ss=bfqt&sr=c&srt=sco&sp=rwdl&se=2016-10-27T04:01:48Z&st=2016-10-26T20:01:48Z&spr=https&sig=QqpIhHsIMF8hNuFO%3D" -ExcludeKeys $true New-AzureRmIotHubImportDevices -ResourceGroupName "myresourcegroup" -Name "myiothub" -InputBlobContainerUri "https://mystorageaccount.blob.core.windows.net/?sv=2015-04- 05&ss=bfqt&sr=c&srt=sco&sp=rwdl&se=2016-10-27T04:01:48Z&st=2016-10-26T20:01:48Z&spr=https&sig=QqpIhHsIMF8hNuFO%3D" -OutputBlobContainerUri "https://mystorageaccount.blob.core.windows.net/?sv=2015-04-05&ss=bfqt&sr=c&srt=sco&sp=rwdl&se=2016-10-27T04:01:48Z&st=2016-10-26T20:01:48Z&spr=https&sig=QqpIhHsIMF8hNuFO%3D" Set-AzureRmIotHub -ResourceGroupName "myresourcegroup" -Name "myiothub" -EventHubRetentionTimeInDays 4 Set-AzureRmIotHub -ResourceGroupName "myresourcegroup" -Name "myiothub" -SkuName S1 -Units 5 Add-AzureRmIotHubCertificate -ResourceGroupName "myresourcegroup" -Name "myiothub" -CertificateName "mycertificate" -Path "c:mycertificate.cer" -Etag "AAAAAAFPazE="
6.
Virtual Network, Subnet,
Network Gateway, Express Route, Network Security Group, Virtual Machine, DiSK #Virtual Network $subnetConfig1= New-AzureRmVirtualNetworkSubnetConfig -Name publicSubnet -AddressPrefix 192.168.0.0/24 -ServiceEndpoint Microsoft.sql $vnetName = "BridgelabzVnet" $vnet = New-AzureRmVirtualNetwork -ResourceGroupName $resourceGroup -Location $location -Name $vnetName -AddressPrefix 192.168.0.0/16 -Subnet $subnetConfig1 #Network Gateway New-AzureRmLocalNetworkGateway -Name Site1 -ResourceGroupName TestRG1 ` -Location 'East US' -GatewayIpAddress '23.99.221.164' -AddressPrefix '10.101.0.0/24â $gw = Get-AzureRmVirtualNetworkGateway -Name $GWName -ResourceGroupName $RG Resize-AzureRmVirtualNetworkGateway -VirtualNetworkGateway $gw -GatewaySku HighPerformance Remove-AzureRmVirtualNetworkGateway -Name $GWName -ResourceGroupName $RG New-AzureRmVirtualNetworkGatewayConnection -Name $Connection41 -ResourceGroupName $RG4 ` -VirtualNetworkGateway1 $vnet4gw -VirtualNetworkGateway2 $vnet1gw -Location $Location4 ` -ConnectionType Vnet2Vnet -SharedKey 'AzureA1b2C3â #Express Route $circuit = Get-AzureRmExpressRouteCircuit -Name "MyCircuit" -ResourceGroupName "MyRG" $gw = Get-AzureRmVirtualNetworkGateway -Name "ExpressRouteGw" -ResourceGroupName "MyRG" $connection = New-AzureRmVirtualNetworkGatewayConnection -Name "ERConnection" -ResourceGroupName "MyRG" -Location "East US" -VirtualNetworkGateway1 $gw -PeerId $circuit.Id -ConnectionType ExpressRoute New-AzureRmExpressRouteCircuit -Name "ExpressRouteARMCircuit" -ResourceGroupName "ExpressRouteResourceGroup" -Location "West US" -SkuTier Standard -SkuFamily MeteredData -ServiceProviderName "Equinix" -PeeringLocation "Silicon Valley" -BandwidthInMbps 200 Get-AzureRmExpressRouteCircuit -Name "ExpressRouteARMCircuit" -ResourceGroupName "ExpressRouteResourceGroupâ $ckt = Get-AzureRmExpressRouteCircuit -Name "ExpressRouteARMCircuit" -ResourceGroupName "ExpressRouteResourceGroup" $ckt.ServiceProviderProperties.BandwidthInMbps = 1000 $ckt.Sku.Family = "UnlimitedData" $ckt.sku.Name = "Premium_UnlimitedData" Set-AzureRmExpressRouteCircuit -ExpressRouteCircuit $ckt Remove-AzureRmExpressRouteCircuit -ResourceGroupName "ExpressRouteResourceGroup" -Name "ExpressRouteARMCircuit" #Network Security Group, Interface $rule1 = New-AzureRmNetworkSecurityRuleConfig -Name rdp-rule -Description "Allow RDP" -Access Allow -Protocol Tcp -Direction Inbound -Priority 100 ` -SourceAddressPrefix Internet -SourcePortRange * -DestinationAddressPrefix * -DestinationPortRange 3389 $nsgapp = New-AzureRmNetworkSecurityGroup -ResourceGroupName $resourceGroup -Location $location -Name appnsg -SecurityRules $rule1 $nic1=New-AzureRmNetworkInterface -ResourceGroupName $resourceGroup -Location $location -Name appNic -Subnet $vnet.Subnets[0] -NetworkSecurityGroup $nsgapp -LoadBalancerBackendAddressPool $apppool -LoadBalancerInboundNatRule $appinboundNATRule #Virtual Machine $appvmConfig = New-AzureRmVMConfig -VMName $vmName1 -VMSize Standard_B2s -AvailabilitySetId $appset.Id | ` Set-AzureRmVMOperatingSystem -Windows -ComputerName $vmName1 -Credential $cred | ` Set-AzureRmVMSourceImage -PublisherName MicrosoftWindowsServer -Offer WindowsServer -Skus 2016-Datacenter -Version latest | ` Add-AzureRmVMNetworkInterface -Id $nic1.Id New-AzureRmVM -ResourceGroupName $resourceGroup -Location $location -VM $appvmConfig New-AzureRmVm -ResourceGroupName "myResourceGroupAutomate" -Name "myVM" -Location "East US" -VirtualNetworkName "myVnet" -SubnetName "mySubnet" -SecurityGroupName "myNetworkSecurityGroup" -PublicIpAddressName "myPublicIpAddress" -OpenPorts 80 -Credential $cred Start-AzureRmVm -ResourceGroupName $resgroupname -Name $vmname Stop-AzureRmVm -ResourceGroupName $resgroupname -Name $vmname -Force Get-AzureRmPublicIPAddress -ResourceGroupName "myResourceGroupAutomate" -Name "myPublicIPAddress" | select IpAddress #Disk $rgName = 'myResourceGroupâ | $vmName = 'myVMâ | $location = 'East US' | $storageType = 'Premium_LRSâ | $dataDiskName = $vmName + '_datadisk1â $diskConfig = New-AzureRmDiskConfig -SkuName $storageType -Location $location -CreateOption Empty -DiskSizeGB 128 $dataDisk1 = New-AzureRmDisk -DiskName $dataDiskName -Disk $diskConfig -ResourceGroupName $rgName $vm = Get-AzureRmVM -Name $vmName -ResourceGroupName $rgName $vm = Add-AzureRmVMDataDisk -VM $vm -Name $dataDiskName -CreateOption Attach -ManagedDiskId $dataDisk1.Id -Lun 1 Update-AzureRmVM -VM $vm -ResourceGroupName $rgName $VirtualMachine = Get-AzureRmVM -ResourceGroupName "RG11" -Name "MyVM07" Remove-AzureRmVMDataDisk -VM $VirtualMachine -Name "DataDisk3" Update-AzureRmVM -ResourceGroupName "RG11" -VM $VirtualMachine
7.
Virtual Machine Extension,
Scale Set, VHD #Virtual Machine Extension Set-AzureRmVMExtension -ResourceGroupName "myResourceGroupAutomate" -ExtensionName "IIS" -VMName "myVM" -Location "EastUS" ` -Publisher Microsoft.Compute -ExtensionType CustomScriptExtension -TypeHandlerVersion 1.8 ` -SettingString '{"commandToExecute":"powershell Add-WindowsFeature Web-Server; powershell Add-Content -Path "C:inetpubwwwrootDefault.htm" -Value $($env:computername)"}â Set-AzureRmVMCustomScriptExtension -ResourceGroupName $resourcegroup -VMName $vmName1 -Name "NotesCustomScript" -FileUri $appblobUrl -Run "NotesAPPVM.ps1" -Location $location ********NotesAPPVM.ps1 Add-WindowsFeature Web-Server -IncludeManagementTools -includeallsubfeature Set-WebBinding -Name "Default Web Site" -BindingInformation "*:80:" -PropertyName Port -Value 1234 $rediskey='fundooredis.redis.cache.windows.net:6380,password=2TIr6mEkZwLJi+VmOT2NS+9u9UkHmjtVcN8KXK+LmzM=,ssl=True,abortConnect=False' $servicebuskey='Endpoint=sb://fundoobus.servicebus.windows.net/;SharedAccessKeyName=ReminderPolicy;SharedAccessKey=XujChsUu789yJmF8T9OGgeEujIgMzwKT7ATDYbTjAbQ=;EntityPath=remi nderâ [Environment]::SetEnvironmentVariable("RedisCache",$rediskey , "Machine") [Environment]::SetEnvironmentVariable("ServiceBus",$servicebuskey , "Machine") ********************* #Virtual Machine Scale Set New-AzureRmVmss -ResourceGroupName "myResourceGroupScaleSet" -Location "EastUS" -VMScaleSetName "myScaleSet" -VirtualNetworkName "myVnet" -SubnetName "mySubnet" ` -PublicIpAddressName "myPublicIPAddress" -LoadBalancerName "myLoadBalancer" -UpgradePolicy "Automaticâ $publicSettings = @{ "fileUris" = (,"https://raw.githubusercontent.com/Azure-Samples/compute-automation-configurations/master/automate-iis.ps1"); "commandToExecute" = "powershell -ExecutionPolicy Unrestricted -File automate-iis.ps1" } $vmss = Get-AzureRmVmss -ResourceGroupName "myResourceGroupScaleSet" -VMScaleSetName "myScaleSetâ Add-AzureRmVmssExtension -VirtualMachineScaleSet $vmss -Name "customScript" -Publisher "Microsoft.Compute" -Type "CustomScriptExtension" -TypeHandlerVersion 1.8 -Setting $publicSettings Update-AzureRmVmss -ResourceGroupName "myResourceGroupScaleSet" -Name "myScaleSet" -VirtualMachineScaleSet $vmss Get-AzureRmVmssVM -ResourceGroupName "myResourceGroup" -VMScaleSetName "myScaleSet" -InstanceId "0â $vmss = Get-AzureRmVmss -ResourceGroupName "myResourceGroup" -VMScaleSetName "myScaleSetâ $vmss.sku.capacity = 5 Update-AzureRmVmss -ResourceGroupName "myResourceGroup" -Name "myScaleSet" -VirtualMachineScaleSet $vmss Get-AzureRmVmssVM -ResourceGroupName "myResourceGroupScaleSet" -VMScaleSetName "myScaleSetâ Get-AzureRmVmssVM -ResourceGroupName "myResourceGroupScaleSet" -VMScaleSetName "myScaleSet" -InstanceId "1" Start-AzureRmVmss -ResourceGroupName "myResourceGroup" -VMScaleSetName "myScaleSet" -InstanceId "0" Stop-AzureRmVmss -ResourceGroupName "myResourceGroup" -VMScaleSetName "myScaleSet" -InstanceId "0â #Scale Down Rule $myScaleProfile = New-AzureRmAutoscaleProfile -DefaultCapacity 2 -MaximumCapacity 10 -MinimumCapacity 2 -Rules $myRuleScaleUp,$myRuleScaleDown -Name "autoprofile" Add-AzureRmAutoscaleSetting -Location $myLocation -Name "autosetting" -ResourceGroup $myResourceGroup -TargetResourceId $myScaleSetId -AutoscaleProfiles $myScaleProfile Restart-AzureRmVmss -ResourceGroupName "myResourceGroup" -VMScaleSetName "myScaleSet" -InstanceId "0" Remove-AzureRmVmss -ResourceGroupName "myResourceGroup" -VMScaleSetName "myScaleSet" -InstanceId "0â #VHD Add-AzureRmVhd -Destination "http://contosoaccount.blob.core.windows.net/vhdstore/win7baseimage.vhd" -LocalFilePath "C:vhdWin7Image.vhd" Add-AzureRmVhd -Destination "http://contosoaccount.blob.core.windows.net/vhdstore/win7baseimage.vhd" -LocalFilePath "C:vhdWin7Image.vhd" -Overwrite Add-AzureRmVhd -Destination "http://contosoaccount.blob.core.windows.net/vhdstore/win7baseimage.vhd" -LocalFilePath "C:vhdWin7Image.vhd" -NumberOfUploaderThreads 32 Add-AzureRmVhd -Destination "http://contosoaccount.blob.core.windows.net/vhdstore/win7baseimage.vhd?st=2013-01 -09T22%3A15%3A49Z&se=2013-01- 09T23%3A10%3A49Z&sr=b&sp=w&sig=13T9Ow%2FRJAMmhfO%2FaP3HhKKJ6AY093SmveO SIV4%2FR7w%3D" -LocalFilePath "C:vhdwin7baseimage.vhdâ ConvertTo-AzureRmVhd -HyperVVMName 'test' -ExportPath '.'; .testVirtual Hard DisksConvertedos.vhd .testVirtual Hard DisksConverteddisk.vhd Save-AzureRmVhd -SourceUri "http://contosoaccount.blob.core.windows.net/vhdstore/win7baseimage.vhd" -LocalFilePath "C:vhdWin7Image.vhd" -ResourceGroupName "rgname" Save-AzureRmVhd -SourceUri "http://contosoaccount.blob.core.windows.net/vhdstore/win7baseimage.vhd" -LocalFilePath "C:vhdWin7Image.vhd" -Overwrite -ResourceGroupName "rgname" Save-AzureRmVhd -SourceUri "http://contosoaccount.blob.core.windows.net/vhdstore/win7baseimage.vhd" -LocalFilePath "C:vhdWin7Image.vhd" -NumberOfThreads 32 -ResourceGroupName "rgname" Save-AzureRmVhd -SourceUri "http://contosoaccount.blob.core.windows.net/vhdstore/win7baseimage.vhd" -LocalFilePath "C:vhdWin7Image.vhd" -StorageKey "zNvcH0r5vAGmC5AbwEtpcyWCMyBd3eMDbdaa4ua6kwxq6vTZH3Y+sw==" -ResourceGroupName "rgname"
8.
Traffic Manager #Traffic Manager $profiles
= Get-AzureTrafficManagerProfile $profiles | Format-Table $profile = Get-AzureTrafficManagerProfile -Name "MyProfile" $profile | Format-List $profile.Endpoints | Format- $profile = New-AzureTrafficManagerProfile -Name "MyProfile" -DomainName "myprofile.trafficmanager.net" -LoadBalancingMethod "RoundRobin" -Ttl 30 -MonitorProtocol "Http" -MonitorPort 80 -MonitorRelativePath "/" $profile = Add-AzureTrafficManagerEndpoint -TrafficManagerProfile $profile -DomainName "myapp-eu.cloudapp.net" -Status "Enabled" -Type "CloudService" $profile = Add-AzureTrafficManagerEndpoint -TrafficManagerProfile $profile -DomainName "myapp-us.cloudapp.net" -Status "Enabled" -Type "CloudService" Set-AzureTrafficManagerProfile âTrafficManagerProfile $profile New-AzureTrafficManagerProfile -Name "MyProfile" -DomainName "myprofile.trafficmanager.net" -LoadBalancingMethod "RoundRobin" -Ttl 30 -MonitorProtocol "Http" -MonitorPort 80 -MonitorRelativePath "/" | Add-AzureTrafficManagerEndpoint -DomainName "myapp-eu.cloudapp.net" -Status "Enabled" -Type "CloudService" | Add-AzureTrafficManagerEndpoint -DomainName "myapp-us.cloudapp.net" -Status "Enabled" -Type "CloudService" | Set-AzureTrafficManagerProfile New-AzureRmTrafficManagerEndpoint -Name eu-endpoint -ProfileName MyProfile -ResourceGroupName MyRG -Type ExternalEndpoints -Target app-eu.contoso.com -EndpointStatus Enabled $child = New-AzureRmTrafficManagerProfile -Name child -ResourceGroupName MyRG -TrafficRoutingMethod Priority -RelativeDnsName child -Ttl 30 -MonitorProtocol HTTP -MonitorPort 80 -MonitorPath "/" $parent = New-AzureRmTrafficManagerProfile -Name parent -ResourceGroupName MyRG -TrafficRoutingMethod Performance -RelativeDnsName parent -Ttl 30 -MonitorProtocol HTTP -MonitorPort 80 -MonitorPath "/" Add-AzureRmTrafficManagerEndpointConfig -EndpointName child-endpoint -TrafficManagerProfile $parent -Type NestedEndpoints -TargetResourceId $child.Id -EndpointStatus Enabled -EndpointLocation "North Europe" -MinChildEndpoints 2 Set-AzureRmTrafficManagerProfile -TrafficManagerProfile $profile $child = Get-AzureRmTrafficManagerEndpoint -Name child -ResourceGroupName MyRG New-AzureRmTrafficManagerEndpoint -Name child-endpoint -ProfileName parent -ResourceGroupName MyRG -Type NestedEndpoints -TargetResourceId $child.Id -EndpointStatus Enabled -EndpointLocation "North Europe" -MinChildEndpoints 2 Set-AzureRmContext -SubscriptionId $EndpointSubscription $ip = Get-AzureRmPublicIpAddress -Name $IpAddresName -ResourceGroupName $EndpointRG Set-AzureRmContext -SubscriptionId $trafficmanagerSubscription New-AzureRmTrafficManagerEndpoint -Name $EndpointName -ProfileName $ProfileName -ResourceGroupName $TrafficManagerRG -Type AzureEndpoints -TargetResourceId $ip.Id -EndpointStatus Enabled $profile = New-AzureRmTrafficManagerProfile -Name FundooTraffic -ResourceGroupName $resourcegroup -TrafficRoutingMethod Performance -RelativeDnsName fundootraffic -Ttl 30 -MonitorProtocol HTTP -MonitorPort 80 -MonitorPath "/" $applb = Get-AzureRmPublicIpAddress -Name applbip -ResourceGroupName $resourcegroup Add-AzureRmTrafficManagerEndpointConfig -EndpointName applbEndpoint -TrafficManagerProfile $profile -Type AzureEndpoints -TargetResourceId $applb.Id -EndpointStatus Enabled Set-AzureRmTrafficManagerProfile -TrafficManagerProfile $profile #Update Endpoints $profile = Get-AzureTrafficManagerProfile -Name "MyProfile" $profile.MonitorRelativePath = "/monitor.aspx" Set-AzureTrafficManagerProfile âTrafficManagerProfile $profile $endpoint = Get-AzureRmTrafficManagerEndpoint -Name myendpoint -ProfileName myprofile -ResourceGroupName MyRG -Type ExternalEndpoints $endpoint.Weight = 20 Set-AzureRmTrafficManagerEndpoint -TrafficManagerEndpoint $endpoint $profile = Get-AzureRmTrafficManagerProfile -Name myprofile -ResourceGroupName MyRG $profile.Endpoints[0].Priority = 2 $profile.Endpoints[1].Priority = 1 Set-AzureRmTrafficManagerProfile -TrafficManagerProfile $profile Disable-AzureTrafficManagerProfile -Name "MyProfile" Enable-AzureTrafficManagerProfile -Name "MyProfileâ Remove-AzureTrafficManagerProfile -Name "MyProfile" -Force
9.
Load balancer, Monitor,
Data Store, Lake, Analytics #Load Balancer #Public Load Balancer $APPLBIP = New-AzureRmPublicIpAddress -Name applbip -ResourceGroupName $resourceGroup -Location $location -AllocationMethod Static -DomainNameLabel $DomainNameLabel $appfrontendIP = New-AzureRmLoadBalancerFrontendIpConfig -Name APP-LB-Frontend -PublicIpAddress $APPLBIP $apppool = New-AzureRmLoadBalancerBackendAddressPoolConfig -Name APP-LB-backend $appinboundNATRule= New-AzureRmLoadBalancerInboundNatRuleConfig -Name APPRDP -FrontendIpConfiguration $appfrontendIP -Protocol TCP -FrontendPort 3441 -BackendPort 3389 $apphealthProbe = New-AzureRmLoadBalancerProbeConfig -Name APPHealthProbe -RequestPath / -Protocol http -Port 80 -IntervalInSeconds 15 -ProbeCount 2 $applbrule = New-AzureRmLoadBalancerRuleConfig -Name APPHTTP -FrontendIpConfiguration $appfrontendIP -BackendAddressPool $appPool -Probe $apphealthProbe -Protocol Tcp -FrontendPort 80 -BackendPort 80 $APPLB = New-AzureRmLoadBalancer -ResourceGroupName $resourceGroup -Name applb -Location $location -FrontendIpConfiguration $appfrontendIP -InboundNatRule $appinboundNATRule -LoadBalancingRule $applbrule -BackendAddressPool $appPool -Probe $apphealthProbe #Private Load Balancer $apifrontendIP = New-AzureRmLoadBalancerFrontendIpConfig -Name API-LB-Frontend -PrivateIpAddress 192.168.0.110 -SubnetId $vnet.subnets[0].Id $apipool= New-AzureRmLoadBalancerBackendAddressPoolConfig -Name API-LB-backend $apiinboundNATRule= New-AzureRmLoadBalancerInboundNatRuleConfig -Name "RDP1" -FrontendIpConfiguration $apifrontendIP -Protocol TCP -FrontendPort 3442 -BackendPort 3389 $apihealthProbe= New-AzureRmLoadBalancerProbeConfig -Name "APIHealthProbe" -RequestPath / -Protocol http -Port 80 -IntervalInSeconds 15 -ProbeCount 2 $apilbrule = New-AzureRmLoadBalancerRuleConfig -Name "APIHTTP" -FrontendIpConfiguration $apifrontendIP -BackendAddressPool $apiPool -Probe $apihealthProbe -Protocol Tcp -FrontendPort 80 -BackendPort 80 $APILB = New-AzureRmLoadBalancer -ResourceGroupName $resourceGroup -Name apilb -Location $location -FrontendIpConfiguration $apifrontendIP -InboundNatRule $apiinboundNATRule -LoadBalancingRule $apilbrule -BackendAddressPool $apiPool -Probe $apihealthProbe #Monitor New-AzureRmApplicationInsights -Kind java -ResourceGroupName testgroup -Name test1027 -location eastus New-AzureRmAutoscaleNotification -CustomEmails "pattif@contoso.com, davidchew@contoso.net" #Create a profile with no schedule or fixed date $Rule = New-AzureRmAutoscaleRule -MetricName "Requests" -MetricResourceId "/subscriptions/b93fb07a-6f93-30be-bf3e-4f0deca15f4f/resourceGroups/Default-Web- EastUS/providers/microsoft.web/sites/mywebsite" -Operator GreaterThan -MetricStatistic Average -Threshold 10 -TimeGrain 00:01:00 -ScaleActionCooldown 00:05:00 -ScaleActionDirection Increase -ScaleActionScaleType ChangeCount -ScaleActionValue "1" $Profile = New-AzureRmAutoscaleProfile -DefaultCapacity "1" -MaximumCapacity "10" -MinimumCapacity "1" -Rules $Rule -Name "ProfileNameâ New-AzureRmAlertRuleEmail -CustomEmails pattif@contoso.com,davidchew@contoso.net Add-AzureRmMetricAlertRule -Name "metricRule5" -Location "East US" -ResourceGroup "Default-Web-EastUS" -Operator GreaterThan -Threshold 1 -TargetResourceId "/subscriptions/b93fb07a-6f93- 30be-bf3e-4f0deca15f4f/resourceGroups/Default-Web-EastUS/providers/microsoft.web/sites/mywebsite" -MetricName "Requests" -TimeAggregationOperator Total Add-AzureRmLogProfile -Locations "Global","West US" -Name ExportLogProfile -StorageAccountId /subscriptions/40gpe80s-9sb7-4f07-9042- b1b6a92ja9fk/resourceGroups/activitylogRG/providers/Microsoft.Storage/storageAccounts/activitylogstorageaccount Disable-AzureRmActivityLogAlert -Name "alert1" -ResourceGroupName "Default-ActivityLogsAlertsâ #Data Lake Analytics, Store, Lake New-AzureRmDataLakeAnalyticsAccount -Name "ContosoAdlAccount" -ResourceGroupName "ContosoOrg" -Location "East US 2" -DefaultDataLakeStore "ContosoAdlStore" New-AzureRmDataLakeAnalyticsCatalogCredential -AccountName "ContosoAdlAccount" -DatabaseName "databaseName" -CredentialName "exampleDbCred" -Credential (Get-Credential) -DatabaseHost "example.contoso.com" -Port 8080 Add-AzureRmDataLakeAnalyticsDataSource -Account "ContosoAdlA" -DataLakeStore "ContosoAdlS" Set-AzureRmDataLakeAnalyticsDataSource -Account "ContosoAdlAccount" -Blob "contosowasb" -AccessKey "...newaccesskey...â New-AzureRmDataLakeStoreAccount -Name "ContosoADL" -ResourceGroupName "ContosoOrg" -Location "East US 2" New-AzureRmDataLakeStoreItem -AccountName "ContosoADL" -Path "/NewFile.txt" New-AzureRmDataLakeStoreItem -AccountName "ContosoADL" -Path "/NewFolder" âFolder Set-AzureRmDataLakeStoreItemExpiry -AccountName "ContosoADL" -Path /myfile.txt -Expiration [DateTimeOffset]::Now.AddHours(2) Add-AzureRmDataLakeStoreItemContent -AccountName "ContosoADLS" -Path /abc/myFile.txt -Value "My content hereâ New-AzureRmDmsConnInfo -ServerType SQL -DataSource mySourceServer -AuthType SqlAuthentication -TrustServerCertificate:$true New-AzureRmDataMigrationDatabaseInfo -SourceDatabaseName 'AdventureWorks2016' New-AzureRmDmsFileShare -Path $fileSharePath -Credential $fileShareCred New-AzureRmDataMigrationProject -ResourceGroupName MyResourceGroup -ServiceName TestService -ProjectName MyDMSProject -Location "central us" -SourceType SQL -TargetType SQLDB -SourceConnection $sourceConnInfo -TargetConnection $targetConnInfo -DatabaseInfo $dbList New-AzureRmDataMigrationSelectedDB -MigrateSqlServerSqlDb -Name "HR" -TargetDatabaseName "HR_PSTEST" -TableMap $tableMap New-AzureRmDataMigrationSelectedDB -MigrateSqlServerSqlDbMi -Name "HR" -TargetDatabaseName "HR_PSTEST" -BackupFileShare $backupFileShare
10.
Power BI, Automation #PowerBI New-AzureRmPowerBIEmbeddedCapacity
-ResourceGroupName "testRG" -Name "testcapacity" -Location "West Central US" -Sku "A1" -Administrator admin@microsoft.com New-AzureRmPowerBIWorkspaceCollection -ResourceGroupName "ResourceGroup17" -WorkspaceCollectionName "WCN11" -Location "Japan Westâ #Automation New-AzureRmAutomationAccount -Name "ContosoAutomationAccount" -Location "East US" -ResourceGroupName "ResourceGroup01â $FieldValues = @{"AutomationCertificateName"="ContosoCertificate";"SubscriptionID"="81b59010-dc55-45b7-89cd-5ca26db62472"} New-AzureRmAutomationConnection -Name "Connection12" -ConnectionTypeName Azure -ConnectionFieldValues $FieldValues -ResourceGroupName "ResourceGroup01" -AutomationAccountName "AutomationAccount01" New-AzureRmAutomationModule -AutomationAccountName "Contoso17" -Name "ContosoModule" -ContentLink "http://contosostorage.blob.core.windows.net/modules/ContosoModule.zip" -ResourceGroupName "ResourceGroup01â New-AzureRmAutomationRunbook -AutomationAccountName "Contoso17" -Name "Runbook02" -ResourceGroupName "ResourceGroup01â #Schedule $ $TimeZone = ([System.TimeZoneInfo]::Local)Id New-AzureRmAutomationSchedule -AutomationAccountName "Contoso17" -Name "Schedule01" -StartTime "23:00" -OneTime -ResourceGroupName "ResourceGroup01" -TimeZone $TimeZone #Schedule â Recurring $StartTime = Get-Date "13:00:00" $EndTime = $StartTime.AddYears(1) New-AzureRmAutomationSchedule -AutomationAccountName "Contoso17" -Name "Schedule02" -StartTime $StartTime -ExpiryTime $EndTime -DayInterval 1 -ResourceGroupName "ResourceGroup01â #Backup New-AzureRmBackupVault -ResourceGroupName "ResourceGroup02" -Name "Vault03" -Region "westus" -Storage LocallyRedundant $Vault = Get-AzureRmBackupVault -Name "Vault03" Register-AzureRmBackupContainer -Vault $Vault -Name "Contoso03Vm" -ServiceName "ContosoService27â #Batch â Job $PoolInformation = New-Object -TypeName "Microsoft.Azure.Commands.Batch.Models.PSPoolInformation" $PoolInformation.PoolId = "Pool22" New-AzureBatchJob -Id "ContosoJob35" -PoolInformation $PoolInformation -BatchContext $Context #Batch â Schedule $Schedule = New-Object -TypeName "Microsoft.Azure.Commands.Batch.Models.PSSchedule" $Schedule.RecurrenceInterval = [TimeSpan]::FromDays(1) $JobSpecification = New-Object -TypeName "Microsoft.Azure.Commands.Batch.Models.PSJobSpecification" $JobSpecification.PoolInformation = New-Object -TypeName "Microsoft.Azure.Commands.Batch.Models.PSPoolInformation" $JobSpecification.PoolInformation.PoolId = "ContosoPool06" New-AzureBatchJobSchedule -Id "JobSchedule17" -Schedule $Schedule -JobSpecification $JobSpecification -BatchContext $Context
Download now