Skip to content
Merged
Show file tree
Hide file tree
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
2 changes: 0 additions & 2 deletions Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -39,8 +39,6 @@ complete -o nospace -F _python_argcomplete \"az\"\n\
" > /etc/az.completion
RUN echo "\nsource '/etc/az.completion'\n" >> /etc/bash.bashrc

RUN curl -sSL https://get.docker.com/ | sh

WORKDIR /

CMD az; bash
22 changes: 15 additions & 7 deletions src/azure/cli/_azure_env.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,9 @@

CLIENT_ID = '04b07795-8ddb-461a-bbee-02f9e1bf7b46'

ENV_DEFAULT = 'dogfood'
ENV_DEFAULT = 'AzureCloud'
ENV_US_GOVERNMENT = 'AzureUSGovernment'
ENV_CHINA = 'AzureChinaCloud'

COMMON_TENANT = 'common'

Expand All @@ -14,16 +16,22 @@ class ENDPOINT_URLS: #pylint: disable=too-few-public-methods,old-style-class,no-
MANAGEMENT = 'management'
ACTIVE_DIRECTORY_AUTHORITY = 'active_directory_authority'
ACTIVE_DIRECTORY_GRAPH_RESOURCE_ID = 'active_directory_graph_resource_id'
RESOURCE_MANAGER = 'resource_manager'
STORAGE_END_POINT_SUFFIX = 'storage end point suffix'

_environments = {
ENV_DEFAULT: {
ENDPOINT_URLS.MANAGEMENT: 'https://management.core.windows.net/',
ENDPOINT_URLS.ACTIVE_DIRECTORY_AUTHORITY : 'https://login.windows-ppe.net',
ENDPOINT_URLS.ACTIVE_DIRECTORY_GRAPH_RESOURCE_ID: 'https://graph.ppe.windows.net/',
ENDPOINT_URLS.RESOURCE_MANAGER: 'https://api-dogfood.resources.windows-int.net/',
ENDPOINT_URLS.STORAGE_END_POINT_SUFFIX: 'blob.core.test-cint.azure-test.net/'
ENDPOINT_URLS.ACTIVE_DIRECTORY_AUTHORITY : 'https://login.microsoftonline.com',
ENDPOINT_URLS.ACTIVE_DIRECTORY_GRAPH_RESOURCE_ID: 'https://graph.windows.net/'
},
ENV_CHINA: {
ENDPOINT_URLS.MANAGEMENT: 'https://management.core.chinacloudapi.cn/',
ENDPOINT_URLS.ACTIVE_DIRECTORY_AUTHORITY: 'https://login.chinacloudapi.cn',
ENDPOINT_URLS.ACTIVE_DIRECTORY_GRAPH_RESOURCE_ID: 'https://graph.chinacloudapi.cn/'
},
ENV_US_GOVERNMENT: {
ENDPOINT_URLS.MANAGEMENT: 'https://management.core.usgovcloudapi.net/',
ENDPOINT_URLS.ACTIVE_DIRECTORY_AUTHORITY: 'https://login.microsoftonline.com',
ENDPOINT_URLS.ACTIVE_DIRECTORY_GRAPH_RESOURCE_ID: 'https://graph.windows.net/'
}
}

Expand Down
2 changes: 1 addition & 1 deletion src/azure/cli/_profile.py
Original file line number Diff line number Diff line change
Expand Up @@ -245,7 +245,7 @@ def __init__(self, auth_context_factory, adal_token_cache, arm_client_factory=No
self._auth_context_factory = auth_context_factory
self.user_id = None # will figure out after log user in
self._arm_client_factory = arm_client_factory or \
(lambda config: SubscriptionClient(config, base_url=get_env()[ENDPOINT_URLS.RESOURCE_MANAGER])) #pylint: disable=unnecessary-lambda
(lambda config: SubscriptionClient(config)) #pylint: disable=unnecessary-lambda

def find_from_user_account(self, username, password, resource):
context = self._create_auth_context(COMMON_TENANT)
Expand Down
7 changes: 1 addition & 6 deletions src/azure/cli/commands/client_factory.py
Original file line number Diff line number Diff line change
Expand Up @@ -9,11 +9,6 @@
import azure.cli._logging as _logging
from azure.cli.application import APPLICATION

from azure.cli._azure_env import (
get_env,
ENDPOINT_URLS
)

logger = _logging.get_az_logger(__name__)

def get_mgmt_service_client(client_type):
Expand Down Expand Up @@ -45,7 +40,7 @@ def _get_mgmt_service_client(client_type, subscription_bound=True):
profile = Profile()
cred, subscription_id, _ = profile.get_login_credentials()
if subscription_bound:
client = client_type(cred, subscription_id, base_url=get_env()[ENDPOINT_URLS.RESOURCE_MANAGER])
client = client_type(cred, subscription_id)
else:
client = client_type(cred)

Expand Down