Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Service Connector] Fix Azure/azure-cli-extension#7235: az containerapp connection: Create postgresql-flexible #28112

Closed
wants to merge 1 commit into from
Closed
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 @@ -343,17 +343,17 @@ def is_packaged_installed(package_name):


def get_object_id_of_current_user():
signed_in_user = run_cli_cmd('az account show').get('user')
signed_in_user = run_cli_cmd('az account show -o json').get('user')
user_type = signed_in_user.get('type')
try:
if user_type == 'user':
user_info = run_cli_cmd('az ad signed-in-user show')
user_info = run_cli_cmd('az ad signed-in-user show -o json')
user_object_id = user_info.get('objectId') if user_info.get(
'objectId') else user_info.get('id')
return user_object_id
if user_type == 'servicePrincipal':
user_info = run_cli_cmd(
f'az ad sp show --id {signed_in_user.get("name")}')
f'az ad sp show --id {signed_in_user.get("name")} -o json')
user_object_id = user_info.get('id')
return user_object_id
except CLIInternalError as e:
Expand Down
Loading