MCPcopy Index your code
hub / github.com/microsoft/PyRIT / _storage_account_name

Function _storage_account_name

infra/deploy_instance.py:425–441  ·  view source on GitHub ↗

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)

Source from the content-addressed store, hash-verified

423
424
425def _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
444def _prepare_env_content(

Callers 1

mainFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected