Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -2,10 +2,7 @@
import os

import azure.functions as func

from azure.common.credentials import (ServicePrincipalCredentials, get_azure_cli_credentials)
from msrestazure.azure_active_directory import MSIAuthentication

from azure.identity import DefaultAzureCredential
from .resource_group_operations import list_rgs


Expand All @@ -14,11 +11,7 @@ async def main(req: func.HttpRequest) -> func.HttpResponse:
The main entry point to the function.
"""

if "MSI_ENDPOINT" in os.environ:
credentials = MSIAuthentication()
else:
credentials, *_ = get_azure_cli_credentials()

credentials = DefaultAzureCredential()
subscription_id = os.environ.get(
'AZURE_SUBSCRIPTION_ID', '11111111-1111-1111-1111-111111111111')

Expand Down