| page_type | name | topic | description | languages | products | urlFragment | ||||
|---|---|---|---|---|---|---|---|---|---|---|
sample |
AzStorageDiscoveryScripts |
sample |
AzStorageDiscoveryScripts has a simple script to migrate Storage Discovery resource created with API verison 2025-04-01-preview to Discovery resource of version 2025-06-01-preview.
|
|
|
update-this-to-unique-url-stub |
The PowerShell scripts automates the migration of Azure Storage Discovery Workspace (ASDW) resources from an older API version (2025-04-01-preview) to a newer version (2025-06-01-preview). It fetches the existing resource, modifies its properties to match the new schema, creates a new resource with the updated API version, and deletes the old one.
Migrate_ASDW.ps1 uses ARMClient to do the migration.
Migrate_ASDW_REST.ps1 invoked REST APIs to the migration.
The script performs the following steps:
- Reads configuration values from a
config.txtfile. - Logs all actions to a
DiscoveryMigrate.logfile. - Downloads and extracts the latest ARMClient tool.
- Authenticates with Azure using
az login. - Fetches the existing ASDW resource.
- Modifies the resource properties to match the new API schema.
- Creates a new ASDW resource with the updated API version.
- Deletes the old ASDW resource.
- PowerShell 7.5 or later
- Azure CLI installed and authenticated
- Internet access to download ARMClient
- Permissions to read/write ASDW resources in the specified subscription
Create a config.txt file in the same directory as the script with the following key-value pairs:
- targetTenantId
- subscriptionId
- resourceGroup
- resourceName
Note: Do not add any quotes around the values.
- Place the script and
config.txtin the same directory. - Open PowerShell and navigate to the script directory.
- Run the script:
.\Migrate-ASDW.ps1
All actions and key events are logged to DiscoveryMigrate.log in the same directory as the script. This includes:
Start and end of the script Resource fetch and transformation steps Creation and deletion of resources Any errors encountered
The script uses ARMClient.exe to interact with Azure Resource Manager APIs directly. It replaces deprecated properties like discoveryScopes and discoveryScopeLevels with scopes and workspaceRoots. Ensure the original ASDW resource is not in use before deletion. Always review the log file for any issues or validation errors.
Important
This script is provided as-is without warranty. It is intended for demonstration or evaluation on non-production purposes only.
This project may contain trademarks or logos for projects, products, or services. Authorized use of Microsoft trademarks or logos is subject to and must follow Microsoft's Trademark & Brand Guidelines. Use of Microsoft trademarks or logos in modified versions of this project must not cause confusion or imply Microsoft sponsorship. Any use of third-party trademarks or logos are subject to those third-party's policies.