Scripting and Command Line Tools

Azure provides two command line tools – PowerShell and Cross-Platform CLI – for you to manage your Azure subscriptions, accelerate your development and automate tasks via scripting, no matter whether you are on Windows, Mac or Linux.

If you have any feedback on Azure PowerShell or Azure Cross-Platform CLI, we’d love to hear it.

  1. Generate PowerShell Script from actions user takes in Azure Management Portal.

    When a user performs one or more action in the Azure Management Portal that results in an activity in Azure the equivalent PowerShell scriptlet should be generated and the user be allowed to download it. This is similar to other Microsoft products that provide PowerShell script access for actions completed via the UI.

    429 votes
    Vote
    Sign in
    (thinking…)
    Sign in with: Microsoft
    Signed in as (Sign out)
    You have left! (?) (thinking…)
    5 comments  ·  Powershell  ·  Flag idea as inappropriate…  ·  Admin →

    This is a great idea. We are thinking about adding such functionality to the Portal. No confirmed plan yet. Thanks.

  2. Windows Azure VM Documentor

    This script should export the VM configuration like roles, drive configuration, memory, CPU, network settings to a csv file and Visio

    201 votes
    Vote
    Sign in
    (thinking…)
    Sign in with: Microsoft
    Signed in as (Sign out)
    You have left! (?) (thinking…)
    under review  ·  1 comment  ·  Powershell  ·  Flag idea as inappropriate…  ·  Admin →
  3. Endpoint Notification / Audit

    I would like a powershell script that will go out and discovery any/all configured endpoints (anytime a VM in IaaS is using an Azure public IP). Produce a list of all endpoints, with IPs and ports.

    This is to prevent the use of public endpoints on VMs running in Azure when we have a VPN into a private vNET. The code below almost does what I'm looking for but not able to get back every port.

    foreach ($item in Get-AzureService)
    {

     Get-AzureVM -ServiceName $item.Label -Name $item.Label| where {$_.PowerState -eq "Started"}
    
    @{
    #Name = "RDP";
    Expression = { ($_ | Get-AzureEndpoint
    160 votes
    Vote
    Sign in
    (thinking…)
    Sign in with: Microsoft
    Signed in as (Sign out)
    You have left! (?) (thinking…)
    2 comments  ·  Powershell  ·  Flag idea as inappropriate…  ·  Admin →

    We will see whether there is a way to do this with the Current Windows Azure PowerShell and if not, what it would take to provide such functionality.

  4. PowerShell scripts for Azure ServiceBus management features

    I was looking the PowerShell CmdLet reference for managing the Azure ServiceBus. Although there is a REST API available, I would like to have CmdLets for creating/deleting queues, topics, subscriptions and manage rules.

    Is this planned or scheduled in a future release?

    33 votes
    Vote
    Sign in
    (thinking…)
    Sign in with: Microsoft
    Signed in as (Sign out)
    You have left! (?) (thinking…)
    1 comment  ·  Powershell  ·  Flag idea as inappropriate…  ·  Admin →
  5. Network and Firewall Logs

    It would be ideal if we could get the logs from the network and firewalls. I see that there are diagnostics available for the VPN but it would be ideal to see activity on the firewall and be able to put those logs into System Center or a syslog server or a system like LogRhythm for security analysis.

    19 votes
    Vote
    Sign in
    (thinking…)
    Sign in with: Microsoft
    Signed in as (Sign out)
    You have left! (?) (thinking…)
    2 comments  ·  Powershell  ·  Flag idea as inappropriate…  ·  Admin →
  6. Ensure the Powershell cmdlets are suitable for scripting, not just interactive use, by supporting the Get-OperationStatus cmdlet

    The Codeplex versions of the PowerShell cmdlets supported Get-OperationStatus, which caused the script to wait until a previous operation was complete. This allowed scripting of deployments.

    Without this the PowerShell cmdlets are of little use for continuous deployment scripting.

    19 votes
    Vote
    Sign in
    (thinking…)
    Sign in with: Microsoft
    Signed in as (Sign out)
    You have left! (?) (thinking…)
    1 comment  ·  Powershell  ·  Flag idea as inappropriate…  ·  Admin →

    We understand the needs. Will think about besides expose the cmdlet, what else do we need to make it good for scripting.

  7. Get-AzureRmSubscription should return Offer ID

    as need it when working with Rate Card API so want to automate set up of Application / Security Principal

    16 votes
    Vote
    Sign in
    (thinking…)
    Sign in with: Microsoft
    Signed in as (Sign out)
    You have left! (?) (thinking…)
    0 comments  ·  Powershell  ·  Flag idea as inappropriate…  ·  Admin →
  8. Cleanup Services, VM's & VHD's deployed under a Cloud Service

    <#
    # PowerShell script to delete all VM's created under a Cloud Service.
    It also delete the VHDs from the storage

    >

    $subscription = Read-Host "Enter your Subscription Name"
    Select-AzureSubscription –Default $subscription
    Get-AzureService |
    Select-Object @{"Label"="ServiceName";Expression={$.Label}} |
    Out-GridView -Title "Select VM Deployments to Remove" -PassThru |
    ForEach-Object { Remove-AzureDeployment -ServiceName $
    .ServiceName -Slot Production -DeleteVHD -Force
    Remove-AzureService -ServiceName $_.ServiceName -Force }

    15 votes
    Vote
    Sign in
    (thinking…)
    Sign in with: Microsoft
    Signed in as (Sign out)
    You have left! (?) (thinking…)
    0 comments  ·  Powershell  ·  Flag idea as inappropriate…  ·  Admin →
  9. Remove Azure VNet Using PowerShell Script

    Hi Guys,

    I am trying to remove the vnet from my subscription using power shell script but I am not able to find any way. I am also refer some blog for the same and I am not able to find it.

    So can you suggest me, How can I remove vnet using power shell?

    13 votes
    Vote
    Sign in
    (thinking…)
    Sign in with: Microsoft
    Signed in as (Sign out)
    You have left! (?) (thinking…)
    1 comment  ·  Powershell  ·  Flag idea as inappropriate…  ·  Admin →
  10. Azure Backup Vault Status report notification via email

    After not finding a solution online for Azure Backup Vault reports I #developed this script.

    Script by De Jager Laubscher djlmeister@gmail.com and revised by #Theodore Seroadi

    Import-module Azure

    Put Your Azure Logon details below

    $MyAzureName = "joeblogs@blogs.com";
    $MyAzurePassword = ConvertTo-SecureString 'YourPasswordHere' -AsPlainText -Force;
    $AzureRMCredential = new-object -typename System.Management.Automation.PSCredential -argumentlist $MyAzureName, $MyAzurePassword
    Add-AzureRMAccount -Credential $AzureRMCredential
    Switch-AzureMode AzureResourceManager

    cls

    Set the backup vault name and number of days you want to report Backups for

    Put the name of your Azure Backup Vault Below

    $backupvaultname = "Your Backup Vault name"
    $numberofdays = 2

    Initialize variables

    $DAILYBACKUPSTATS = @()
    $backupvault = Get-AzureRMBackupVault…

    13 votes
    Vote
    Sign in
    (thinking…)
    Sign in with: Microsoft
    Signed in as (Sign out)
    You have left! (?) (thinking…)
    2 comments  ·  Powershell  ·  Flag idea as inappropriate…  ·  Admin →
  11. Deploy Multiple Domain joined Azure VM's in a new or existing Cloud Service

    <#
    # .SYNOPSIS
    The script is designed to create Multiple Azure VM's and join them to the specified domain while creation.
    Using this script you can achieve:
    1.Create Multiple Azure VM's under the same Cloud Service
    2.Add additional Azure VM's under an already created Cloud Service

    Requirements:
    1.Azure Powershell Module installed in the machine.
    2.Your Subscription Name, you need to specify the subscription name while using the script.
    3.Pre-created Affinity Group, you need to specify the name while using the script.
    4.Pre-created Storage in Azure, you need to specify the storage name while using the script.
    5.Pre-created Virtual Network in…

    12 votes
    Vote
    Sign in
    (thinking…)
    Sign in with: Microsoft
    Signed in as (Sign out)
    You have left! (?) (thinking…)
    0 comments  ·  Powershell  ·  Flag idea as inappropriate…  ·  Admin →
  12. Powershell Cmd to List All Alert Rules of Subscription

    Hi,

    In our environment we are trying to stop all alert rules on non-business hours. Since monitor section does not have any maintenance window, we are trying to create powershell using get all the alert rule and disable it. Please allow us to enable\disable all Alert rule(Activity\Metric\Log Analytics Query) using pwershell cmd.

    12 votes
    Vote
    Sign in
    (thinking…)
    Sign in with: Microsoft
    Signed in as (Sign out)
    You have left! (?) (thinking…)
    0 comments  ·  Powershell  ·  Flag idea as inappropriate…  ·  Admin →
  13. Reevaluate Azure Policy button/powershell command

    In Azure Policies, we can find the compliance state, but it will take too long to evaluate this compliance state.
    1-Please, speedup evaluation
    2- Add a button "reevaluate policy now", because after an update of the policy- customer want asap see - how his modification affect resources

    11 votes
    Vote
    Sign in
    (thinking…)
    Sign in with: Microsoft
    Signed in as (Sign out)
    You have left! (?) (thinking…)
    4 comments  ·  Powershell  ·  Flag idea as inappropriate…  ·  Admin →
  14. Identify the co-administrators in with a powershell cmdlet

    Need a way to view the administrators and co-administrators within a subscription

    11 votes
    Vote
    Sign in
    (thinking…)
    Sign in with: Microsoft
    Signed in as (Sign out)
    You have left! (?) (thinking…)
    1 comment  ·  Powershell  ·  Flag idea as inappropriate…  ·  Admin →
  15. Inventory Generation for ARM

    Create a PowerShell script to generate inventory of a particular subscription for an Azure account. It should be developed for both ASM and ARM.

    11 votes
    Vote
    Sign in
    (thinking…)
    Sign in with: Microsoft
    Signed in as (Sign out)
    You have left! (?) (thinking…)
    0 comments  ·  Powershell  ·  Flag idea as inappropriate…  ·  Admin →
  16. upgrade MSBuild from 14to15 onkudu as compatibility with C#7 version so could you upgrade to 15 because industry using MSBuild 15 as for C#

    we need MSBuild version 15 on kudu as compatibility with C#7 version so could you upgrade to 15 because industry using MSBuild 15 as for C#

    10 votes
    Vote
    Sign in
    (thinking…)
    Sign in with: Microsoft
    Signed in as (Sign out)
    You have left! (?) (thinking…)
    1 comment  ·  Powershell  ·  Flag idea as inappropriate…  ·  Admin →
  17. Invoke-Sqlcmd -Credential still only supports SQL user accounts v21.1.18080

    Invoke-Sqlcmd has the -Credential Parameter which says it supports a PSCredential. In testing it does not work with windows accounts (domain or local) even though a PSCredential can store them and they work with other cmdlets. We should be able to use a single credential if it has rights to both the OS and Instance, the documentation is wrong or the implementation is wrong.

    8 votes
    Vote
    Sign in
    (thinking…)
    Sign in with: Microsoft
    Signed in as (Sign out)
    You have left! (?) (thinking…)
    0 comments  ·  Powershell  ·  Flag idea as inappropriate…  ·  Admin →
  18. add the ability to run PowerShell 3.0 from the System Center 2012 Orchestrator Runbook Run .Net Script without calling a subroutine

    I've documented this problem in the Windows Azure forums:
    http://social.technet.microsoft.com/Forums/en/scogeneral/thread/d0431d3f-52c3-41b4-be37-7c192e28a62a

    Basically you have to do a workaround to call PowerShell 3.0 from a System Center 2012 Orchestrator Runbook Run .Net Script Activity because for whatever reason the activity called PowerShell 2.0 instead which isn't supported by Windows Azure PowerShell. Calling subroutines is a royal pain.

    7 votes
    Vote
    Sign in
    (thinking…)
    Sign in with: Microsoft
    Signed in as (Sign out)
    You have left! (?) (thinking…)
    0 comments  ·  Powershell  ·  Flag idea as inappropriate…  ·  Admin →
  19. To automate the build of DEV, QA, and PROD SharePoint 2016 farms

    To automate the build of the complete Azure environment for SharePoint 2016 farms including the networking for DEV, QA, and PROD farms that are using SQL Always On or assuming HA is required so companies can have their BUs spin up "IT Approved" full farm environments saving IT time.

    7 votes
    Vote
    Sign in
    (thinking…)
    Sign in with: Microsoft
    Signed in as (Sign out)
    You have left! (?) (thinking…)
    0 comments  ·  Powershell  ·  Flag idea as inappropriate…  ·  Admin →
  20. ImportError: No module named 'azure'

    ImportError: No module named 'azure'

    why does this happen?

    7 votes
    Vote
    Sign in
    (thinking…)
    Sign in with: Microsoft
    Signed in as (Sign out)
    You have left! (?) (thinking…)
    0 comments  ·  Powershell  ·  Flag idea as inappropriate…  ·  Admin →
← Previous 1 3
  • Don't see your idea?

Scripting and Command Line Tools

Categories

Feedback and Knowledge Base