From d773655321765a86bc3f57630ab7849313096ec6 Mon Sep 17 00:00:00 2001 From: Zainudeen V K Date: Mon, 28 Dec 2020 16:21:55 +0530 Subject: [PATCH] Updating azlogin readme (#91) * Update README.md * Update README.md Co-authored-by: Amruta Kawade <65217380+AmrutaKawade@users.noreply.github.com> --- README.md | 19 +++++++++++++++++++ 1 file changed, 19 insertions(+) diff --git a/README.md b/README.md index 000fa7ee..0b623b2a 100644 --- a/README.md +++ b/README.md @@ -16,6 +16,8 @@ With the Azure login Action, you can automate your workflow to do an Azure login By default, the action only logs in with the Azure CLI (using the `az login` command). To log in with the Az PowerShell module, set `enable-AzPSSession` to true. To login to Azure tenants without any subscriptions, set the optional parameter `allow-no-subscriptions` to true. +To login into one of the Azure Government clouds, set the optional parameter environment with supported cloud names AzureUSGovernment or AzureChinaCloud. If this parameter is not specified, it takes the default value AzureCloud and connect to the Azure Public Cloud. Additionally the parameter creds takes the Azure service principal created in the particular cloud to connect (Refer to Configure deployment credentials section below for details). + This repository contains GitHub Action for [Azure Login](https://github.com/Azure/login/blob/master/action.yml). ## Sample workflow that uses Azure login action to run az cli @@ -74,6 +76,23 @@ jobs: Get-AzVM -ResourceGroupName "ActionsDemo" ``` +## Sample to connect to Azure US Government cloud + +``` + - name: Login to Azure US Gov Cloud with CLI + uses: azure/login@v1 + with: + creds: ${{ secrets.AZURE_US_GOV_CREDENTIALS }} + environment: 'AzureUSGovernment' + enable-AzPSSession: false + - name: Login to Azure US Gov Cloud with Az Powershell + uses: azure/login@v1 + with: + creds: ${{ secrets.AZURE_US_GOV_CREDENTIALS }} + environment: 'AzureUSGovernment' + enable-AzPSSession: true +``` + Refer to the [Azure PowerShell](https://github.com/azure/powershell) Github action to run your Azure PowerShell scripts. ## Configure deployment credentials: