Skip to content

Commit

Permalink
Merge pull request #8 from charmed-kubernetes/KU-438/repair-azure-rol…
Browse files Browse the repository at this point in the history
…e-assignment

A change in the az CLI has forces this change to assign_role
  • Loading branch information
kwmonroe authored Mar 7, 2024
2 parents 863b056 + 59d9dcc commit f3f8d47
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 3 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/tox.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -15,4 +15,4 @@ jobs:
needs:
- call-inclusive-naming-check
with:
python: "['3.6', '3.7', '3.8', '3.9', '3.10']"
python: "['3.8', '3.9', '3.10', '3.11']"
7 changes: 5 additions & 2 deletions lib/charms/layer/azure.py
Original file line number Diff line number Diff line change
Expand Up @@ -867,15 +867,18 @@ def _assign_role(request, role, resource_group=None):
rg = request.resource_group
if resource_group is not None:
rg = resource_group
sub_id = kv().get("charm.azure.sub-id")
scope = f"/subscriptions/{sub_id}/resourceGroups/{rg}"

try:
_azure(
"role",
"assignment",
"create",
"--assignee-object-id",
msi,
"--resource-group",
rg,
"--scope",
scope,
"--role",
role,
)
Expand Down

0 comments on commit f3f8d47

Please sign in to comment.