Derive a valid Azure storage account name from the instance name. Storage account names must be 3-24 lowercase alphanumeric characters (no hyphens, no uppercase). We strip non-alphanumerics from the instance name, then prepend ``copyrit`` and append ``sa`` to keep the naming pa
(instance: str)
| 423 | |
| 424 | |
| 425 | def _storage_account_name(instance: str) -> str: |
| 426 | """ |
| 427 | Derive a valid Azure storage account name from the instance name. |
| 428 | |
| 429 | Storage account names must be 3-24 lowercase alphanumeric characters |
| 430 | (no hyphens, no uppercase). We strip non-alphanumerics from the instance |
| 431 | name, then prepend ``copyrit`` and append ``sa`` to keep the naming |
| 432 | pattern consistent with the rest of the per-instance resources. |
| 433 | |
| 434 | Args: |
| 435 | instance (str): The instance name (e.g., ``partners-demo``). |
| 436 | |
| 437 | Returns: |
| 438 | str: The derived storage account name (e.g., ``copyritpartnersdemosa``). |
| 439 | """ |
| 440 | normalized = re.sub(r"[^a-z0-9]", "", instance.lower()) |
| 441 | return f"copyrit{normalized}sa" |
| 442 | |
| 443 | |
| 444 | def _prepare_env_content( |