Repository navigation
[App Service] az functionapp flex-migration start: Reuse the source app's existing storage access when no storage account is specified - #34525
Open
Vishal Gupta (vishal1997) wants to merge 3 commits into
Conversation
When no storage account is named, migration reuses the storage access the source app already has: its AzureWebJobsStorage connection string, or the managed identity it uses for host storage after confirming that identity's blob data role assignment. New access (account keys, role assignments, deployment containers) is set up only for storage accounts named with --storage-account or --deployment-storage-name. Side-by-side migration now passes the --deployment-storage-* arguments to app creation. Storage settings that reference different accounts stop the command, deployment storage authentication options require a named account, and role assignment conditions are preserved when identity role assignments are copied. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
…r message Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
|
Azure Pipelines: There may be pipelines that require an authorized user to comment /azp run to run. |
Contributor
|
Thank you for your contribution Vishal Gupta (@vishal1997)! We will review the pull request and get back to you soon. |
Contributor
There was a problem hiding this comment.
🟡 Changes recommended
Migration can overwrite target deployment-storage credentials and continue after required identity-role transfer failures, potentially reporting success when the target cannot access its configured storage.
4 open issues
Require and verify deployment storage access for the target identity · New Preserve target deployment connection string during settings migration · New Avoid subscription-wide storage lookup when resource-group lookup succeeds · New Resolve storage account ID before clearing deployment credentials · New
What changed in this PR
Updates App Service Flex migration to reuse the source app’s storage credentials or managed-identity access when no storage account is specified.
Changes:
- Adds storage-access validation and credential-based container setup.
- Updates argument help and preserves conditions when copying role assignments.
- Expands mocked coverage and configures storage access in live identity-migration tests.
| File | Description |
|---|---|
src/azure-cli/azure/cli/command_modules/appservice/tests/latest/test_functionapp_commands.py |
Grants source identities blob access for live tests. |
src/azure-cli/azure/cli/command_modules/appservice/tests/latest/test_functionapp_commands_thru_mock.py |
Tests storage reuse, validation, and settings preservation. |
src/azure-cli/azure/cli/command_modules/appservice/custom.py |
Implements storage-access reuse and migration integration. |
src/azure-cli/azure/cli/command_modules/appservice/_params.py |
Clarifies storage options and hides internal arguments. |
src/azure-cli/azure/cli/command_modules/appservice/_constants.py |
Adds the Storage Blob Data Owner role identifier. |
Review effort: Balanced
| 'deployment_storage_auth_type': plan['deployment_storage_auth_type'], | ||
| 'deployment_storage_auth_value': plan['deployment_storage_auth_value'], | ||
| 'deployment_container_connection_string': plan['container_connection_string'], | ||
| 'allow_deployment_storage_role_assignment': False |
Comment on lines
+1578
to
+1579
| _migrate_app_settings(cmd, source_resource_group, source_name, resource_group, name, storage_account, | ||
| host_storage_reused=True) |
| def _find_storage_account_id(cmd, account_name, resource_group_name): | ||
| """Look up a storage account's resource ID for validation only. Nothing is provisioned on the result.""" | ||
| from azure.cli.command_modules.storage.operations.account import list_storage_accounts | ||
| for accounts in (list_storage_accounts(cmd, resource_group_name), list_storage_accounts(cmd)): |
| deployment_storage_auth_value in existing_settings_dict: | ||
| # Validating an existing container needs only read access, so it's checked through the management plane. | ||
| # Deployment storage reuses the app's existing connection string setting, so no keys are read. | ||
| container_connection_string = None |
Member
|
/azp run |
|
Azure Pipelines: Successfully started running 3 pipeline(s). |
Look up storage accounts in the resource group before listing the subscription, resolve the account ID when an existing deployment container is validated in place, keep the target app's deployment storage connection string setting when app settings are copied, and check that the target app's system-assigned identity can access deployment storage after role assignments are migrated. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Member
|
/azp run |
|
Azure Pipelines: Successfully started running 3 pipeline(s). |
This branch has not been deployed
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.


🤖 PR Validation — ️✔️ All clear
Related command
Description
Testing Guide
History Notes
[Component Name 1] BREAKING CHANGE:
az command a: Make some customer-facing breaking change[Component Name 2]
az command b: Add some customer-facing featureThis checklist is used to make sure that common guidelines for a pull request are followed.
The PR title and description has followed the guideline in Submitting Pull Requests.
I adhere to the Command Guidelines.
I adhere to the Error Handling Guidelines.