Azure Powershell - automating Login-AzureRmAccount AD Login - for Azure function

前端 未结 3 1034
耶瑟儿~
耶瑟儿~ 2021-01-13 06:31

I have this Azure Powershell script, which successfully backs up a SQL Azure DB to Azure Blob.

In its current form, it requires me to log in via AD.

I now n

3条回答
  •  没有蜡笔的小新
    2021-01-13 07:20

    Run PowerShell as Administrator, you need to install AzureRM in PowerShell,

    • Login to Azure

    Login-AzureRmAccount

    • Enter your Azure credentials
    • To get your subscription(s) details enter

    Get-AzureRmSubscription

    • Use the subscription id to select the subscription.

    Select-AzureRmSubscription -SubscriptionId xxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx

    • Save the AzureProfile using the below command

    Save-AzureRmProfile -Path "C:\AzureScripts\profile.json"

    • The json file can be used to login to Azure

    Select-AzureRmProfile -Path "C:\AzureScripts\profile.json"

    Put this line on top of you .ps1 file, you does not require human input.

    Ref : http://www.smartcoding.in/blog/auto-login-azure-power-shell

提交回复
热议问题