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

{App Service} Fix: #21721: az webapp config storage-account add: Add validation for non-existent FileShare #30990

Open
wants to merge 10 commits into
base: dev
Choose a base branch
from
Open
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
Original file line number Diff line number Diff line change
Expand Up @@ -580,6 +580,14 @@ def update_application_settings_polling(cmd, resource_group_name, name, app_sett
def add_azure_storage_account(cmd, resource_group_name, name, custom_id, storage_type, account_name,
share_name, access_key, mount_path=None, slot=None, slot_setting=False):
AzureStorageInfoValue = cmd.get_models('AzureStorageInfoValue')
storage_client = get_mgmt_service_client(cmd.cli_ctx, StorageManagementClient)

# Check if the file share exists
try:
storage_client.file_shares.get(resource_group_name, account_name, share_name)
except:
raise ValidationError(f"The share '{share_name}' does not exist in the storage account '{account_name}'.")

azure_storage_accounts = _generic_site_operation(cmd.cli_ctx, resource_group_name, name,
'list_azure_storage_accounts', slot)

Expand Down
Loading