Skip to content

Commit 9f9c5b5

Browse files
committed
update
1 parent 16a3a51 commit 9f9c5b5

File tree

4 files changed

+300
-367
lines changed

4 files changed

+300
-367
lines changed

src/containerapp/azext_containerapp/_help.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -715,7 +715,7 @@
715715
- name: Configure the app to listen to the forward headers X-FORWARDED-HOST and X-FORWARDED-PROTO.
716716
text: |
717717
az containerapp auth update -g myResourceGroup --name my-containerapp --proxy-convention Standard
718-
- name: Configure the blob storage token store using system assigned managed identity to authenticate.
718+
- name: Configure the blob storage token store using default system assigned managed identity to authenticate.
719719
text: |
720720
az containerapp auth update -g myResourceGroup --name my-containerapp --token-store true --blob-container-uri https://storageAccount1.blob.core.windows.net/container1
721721
- name: Configure the blob storage token store using user assigned managed identity to authenticate.

src/containerapp/azext_containerapp/_params.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -279,7 +279,7 @@ def load_arguments(self, _):
279279
with self.argument_context('containerapp auth') as c:
280280
c.argument('blob_container_uri', help='The URI of the blob storage containing the tokens. Should not be used along with sas_url_secret and sas_url_secret_name.', is_preview=True)
281281
c.argument('blob_container_identity', options_list=['--blob-container-identity', '--bci'],
282-
help='Resource ID of a managed identity to authenticate with Azure blob storage, or Empty to use a system-assigned identity.', is_preview=True)
282+
help='Default Empty to use system-assigned identity, or using Resource ID of a managed identity to authenticate with Azure blob storage.', is_preview=True)
283283

284284
with self.argument_context('containerapp env workload-profile set') as c:
285285
c.argument('workload_profile_type', help="The type of workload profile to add or update. Run `az containerapp env workload-profile list-supported -l <region>` to check the options for your region.")

src/containerapp/azext_containerapp/containerapp_auth_decorator.py

Lines changed: 4 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -73,14 +73,7 @@ def set_up_token_store(self):
7373
safe_set(self.existing_auth, "login", "tokenStore", "enabled", value=True)
7474
safe_set(self.existing_auth, "login", "tokenStore", "azureBlobStorage", value={})
7575

76-
param_provided = 0
77-
if self.get_argument_sas_url_secret() is not None:
78-
param_provided += 1
79-
if self.get_argument_sas_url_secret_name() is not None:
80-
param_provided += 1
81-
if self.get_argument_blob_container_uri() is not None:
82-
param_provided += 1
83-
76+
param_provided = sum(1 for param in [self.get_argument_sas_url_secret(), self.get_argument_sas_url_secret_name(), self.get_argument_blob_container_uri()] if param is not None)
8477
if param_provided != 1:
8578
raise ArgumentUsageError(
8679
'Usage Error: only blob storage token store is supported. --sas-url-secret, --sas-url-secret-name and --blob-container-uri should provide exactly one when token store is enabled')
@@ -90,14 +83,11 @@ def set_up_token_store(self):
9083
value=self.get_argument_blob_container_uri())
9184

9285
identity = self.get_argument_blob_container_identity()
93-
if identity is None:
94-
identity = ""
95-
identity = identity.lower()
96-
if identity != "":
86+
if identity is not None:
87+
identity = identity.lower()
9788
subscription_id = get_subscription_id(self.cmd.cli_ctx)
9889
identity = _ensure_identity_resource_id(subscription_id, self.get_argument_resource_group_name(), identity)
99-
safe_set(self.existing_auth, "login", "tokenStore", "azureBlobStorage", "managedIdentityResourceId",
100-
value=identity)
90+
safe_set(self.existing_auth, "login", "tokenStore", "azureBlobStorage", "managedIdentityResourceId", value=identity)
10191
return
10292

10393
sas_url_setting_name = BLOB_STORAGE_TOKEN_STORE_SECRET_SETTING_NAME

0 commit comments

Comments
 (0)