Skip to content
Draft
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
4 changes: 2 additions & 2 deletions sdk/keyvault/azure-keyvault-administration/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -194,12 +194,12 @@ role_definition = client.set_role_definition(scope=scope, role_name=role_name, p
new_permissions = [
KeyVaultPermission(
data_actions=[KeyVaultDataAction.READ_HSM_KEY],
not_data_actions=[KeyVaultDataAction.CREATE_HSM_KEY]
not_data_actions=[KeyVaultDataAction.CREATE_HSM_KEY],
)
]
unique_definition_name = role_definition.name
updated_definition = client.set_role_definition(
scope=scope, name=unique_definition_name, role_name=role_name, permissions=new_permissions
scope=scope, name=unique_definition_name, role_name=role_name, permissions=new_permissions,
)
```

Expand Down
65 changes: 65 additions & 0 deletions sdk/keyvault/azure-keyvault-administration/pyproject.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,71 @@
[build-system]
requires = ["setuptools>=61.0.0", "wheel"] # Requires 61.0.0 for dynamic version
build-backend = "setuptools.build_meta"

[project]
name = "azure-keyvault-administration"
authors = [
{name = "Microsoft Corporation", email = "azpysdkhelp@microsoft.com"},
]
description = "Microsoft Corporation Key Vault Administration Client Library for Python"
keywords = ["azure", "azure sdk"]
requires-python = ">=3.9"
license = {text = "MIT License"}
classifiers = [
"Development Status :: 5 - Production/Stable",
"Programming Language :: Python",
"Programming Language :: Python :: 3 :: Only",
"Programming Language :: Python :: 3",
"Programming Language :: Python :: 3.9",
"Programming Language :: Python :: 3.10",
"Programming Language :: Python :: 3.11",
"Programming Language :: Python :: 3.12",
"Programming Language :: Python :: 3.13",
"License :: OSI Approved :: MIT License",
]
dependencies = [
"isodate>=0.6.1",
"azure-core>=1.38.0",
"typing-extensions>=4.6.0",
]
dynamic = ["version", "readme"]

[project.urls]
repository = "https://github.com/Azure/azure-sdk-for-python/tree/main/sdk"

[tool.setuptools.dynamic]
version = {attr = "azure.keyvault.administration._version.VERSION"}
readme = {file = ["README.md", "CHANGELOG.md"], content-type = "text/markdown"}

[tool.setuptools.packages.find]
exclude = ["samples*", "tests*", "azure", "azure.keyvault"]

[tool.setuptools.package-data]
pytyped = ["py.typed"]

[tool.azure-sdk-build]
pyright = false

[tool.uv.sources]
azure-core = { path = "../../core/azure-core" }
azure-identity = { path = "../../identity/azure-identity" }
azure-keyvault-keys = { path = "../azure-keyvault-keys" }
azure-keyvault-nspkg = { path = "../../nspkg/azure-keyvault-nspkg" }
azure-sdk-tools = { path = "../../../eng/tools/azure-sdk-tools" }

[dependency-groups]
dev = [
"aiohttp>=3.0",
"azure-core",
"azure-identity",
"azure-keyvault-keys",
"azure-keyvault-nspkg",
"azure-sdk-tools",
"azure-storage-blob==12.6.0",
"parameterized>=0.7.3",
"python-dateutil>=2.8.0",
]

[tool.azure-sdk-conda]
in_bundle = true
bundle_name = "azure-keyvault"
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@
#
# 3. Set environment variable MANAGED_HSM_URL with the URL of your managed HSM and AZURE_CLIENT_ID with the ID of a
# service principal
#
#
# 4. Set up your environment to use azure-identity's DefaultAzureCredential. For more information about how to configure
# the DefaultAzureCredential, refer to https://aka.ms/azsdk/python/identity/docs#azure.identity.DefaultAzureCredential
#
Expand Down Expand Up @@ -80,12 +80,12 @@
new_permissions = [
KeyVaultPermission(
data_actions=[KeyVaultDataAction.READ_HSM_KEY],
not_data_actions=[KeyVaultDataAction.CREATE_HSM_KEY]
not_data_actions=[KeyVaultDataAction.CREATE_HSM_KEY],
)
]
unique_definition_name = role_definition.name
updated_definition = client.set_role_definition(
scope=scope, name=unique_definition_name, role_name=role_name, permissions=new_permissions
scope=scope, name=unique_definition_name, role_name=role_name, permissions=new_permissions,
)
# [END update_a_role_definition]
print(f"Role definition '{updated_definition.role_name}' updated successfully.")
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@
# 2. azure-keyvault-administration and azure-identity libraries (pip install these)
#
# 3. Set environment variable MANAGED_HSM_URL with the URL of your managed HSM
#
#
# 4. Set up your environment to use azure-identity's DefaultAzureCredential. For more information about how to configure
# the DefaultAzureCredential, refer to https://aka.ms/azsdk/python/identity/docs#azure.identity.DefaultAzureCredential
#
Expand All @@ -41,7 +41,7 @@ async def run_sample():
# Here we use the DefaultAzureCredential, but any azure-identity credential can be used.
credential = DefaultAzureCredential()
client = KeyVaultAccessControlClient(vault_url=MANAGED_HSM_URL, credential=credential)

# Let's first create a custom role definition. This role permits creating keys in a Managed HSM.
# We'll provide a friendly role name, and let a unique role definition name (a GUID) be generated for us.
print("\n.. Create a role definition")
Expand All @@ -58,12 +58,12 @@ async def run_sample():
new_permissions = [
KeyVaultPermission(
data_actions=[KeyVaultDataAction.READ_HSM_KEY],
not_data_actions=[KeyVaultDataAction.CREATE_HSM_KEY]
not_data_actions=[KeyVaultDataAction.CREATE_HSM_KEY],
)
]
unique_definition_name = role_definition.name
updated_definition = await client.set_role_definition(
scope=scope, name=unique_definition_name, role_name=role_name, permissions=new_permissions
scope=scope, name=unique_definition_name, role_name=role_name, permissions=new_permissions,
)
print(f"Role definition '{updated_definition.role_name}' updated successfully.")

Expand All @@ -75,7 +75,7 @@ async def run_sample():
definition_id = updated_definition.id
assert definition_id
role_assignment = await client.create_role_assignment(
scope=scope, definition_id=definition_id, principal_id=principal_id
scope=scope, definition_id=definition_id, principal_id=principal_id,
)
assert role_assignment.name
print(f"Role assignment {role_assignment.name} created successfully.")
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@
# 4. A user-assigned managed identity that has access to your managed HSM. For more information about how to create a
# user-assigned managed identity, refer to
# https://learn.microsoft.com/entra/identity/managed-identities-azure-resources/overview
#
#
# 5. A storage account, that your managed identity has access to, containing a blob storage container
# (See https://learn.microsoft.com/azure/storage/blobs/storage-blobs-introduction)
#
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@
# 4. A user-assigned managed identity that has access to your managed HSM. For more information about how to create a
# user-assigned managed identity, refer to
# https://learn.microsoft.com/entra/identity/managed-identities-azure-resources/overview
#
#
# 5. A storage account, that your managed identity has access to, containing a blob storage container
# (See https://learn.microsoft.com/azure/storage/blobs/storage-blobs-introduction)
#
Expand All @@ -45,7 +45,7 @@ async def run_sample():
# Here we use the DefaultAzureCredential, but any azure-identity credential can be used.
credential = ManagedIdentityCredential(client_id=MANAGED_IDENTITY_CLIENT_ID)
client = KeyVaultBackupClient(vault_url=MANAGED_HSM_URL, credential=credential)

# Let's back up the vault with begin_backup, which returns a poller. Calling result() on the poller will return
# a KeyVaultBackupResult that contains the URL of the backup after the operation completes. Calling wait() on
# the poller will wait until the operation is complete.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@
# 2. azure-keyvault-administration and azure-identity libraries (pip install these)
#
# 3. Set environment variable MANAGED_HSM_URL with the URL of your managed HSM
#
#
# 4. Set up your environment to use azure-identity's DefaultAzureCredential. For more information about how to configure
# the DefaultAzureCredential, refer to https://aka.ms/azsdk/python/identity/docs#azure.identity.DefaultAzureCredential
#
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@
# 2. azure-keyvault-administration and azure-identity libraries (pip install these)
#
# 3. Set environment variable MANAGED_HSM_URL with the URL of your managed HSM
#
#
# 4. Set up your environment to use azure-identity's DefaultAzureCredential. For more information about how to configure
# the DefaultAzureCredential, refer to https://aka.ms/azsdk/python/identity/docs#azure.identity.DefaultAzureCredential
#
Expand Down
69 changes: 0 additions & 69 deletions sdk/keyvault/azure-keyvault-administration/setup.py

This file was deleted.

63 changes: 63 additions & 0 deletions sdk/keyvault/azure-keyvault-certificates/pyproject.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,69 @@
[build-system]
requires = ["setuptools>=61.0.0", "wheel"] # Requires 61.0.0 for dynamic version
build-backend = "setuptools.build_meta"

[project]
name = "azure-keyvault-certificates"
authors = [
{name = "Microsoft Corporation", email = "azpysdkhelp@microsoft.com"},
]
description = "Microsoft Corporation Key Vault Certificates Client Library for Python"
keywords = ["azure", "azure sdk"]
requires-python = ">=3.9"
license = {text = "MIT License"}
classifiers = [
"Development Status :: 5 - Production/Stable",
"Programming Language :: Python",
"Programming Language :: Python :: 3 :: Only",
"Programming Language :: Python :: 3",
"Programming Language :: Python :: 3.9",
"Programming Language :: Python :: 3.10",
"Programming Language :: Python :: 3.11",
"Programming Language :: Python :: 3.12",
"Programming Language :: Python :: 3.13",
"License :: OSI Approved :: MIT License",
]
dependencies = [
"isodate>=0.6.1",
"azure-core>=1.31.0",
"typing-extensions>=4.6.0",
]
dynamic = ["version", "readme"]

[project.urls]
repository = "https://github.com/Azure/azure-sdk-for-python/tree/main/sdk"

[tool.setuptools.dynamic]
version = {attr = "azure.keyvault.certificates._version.VERSION"}
readme = {file = ["README.md", "CHANGELOG.md"], content-type = "text/markdown"}

[tool.setuptools.packages.find]
exclude = ["samples*", "tests*", "azure", "azure.keyvault"]

[tool.setuptools.package-data]
pytyped = ["py.typed"]

[tool.azure-sdk-build]
pyright = false

[tool.uv.sources]
azure-core = { path = "../../core/azure-core" }
azure-identity = { path = "../../identity/azure-identity" }
azure-keyvault-nspkg = { path = "../../nspkg/azure-keyvault-nspkg" }
azure-sdk-tools = { path = "../../../eng/tools/azure-sdk-tools" }

[dependency-groups]
dev = [
"aiohttp>=3.0",
"azure-core",
"azure-identity",
"azure-keyvault-nspkg",
"azure-sdk-tools",
"parameterized>=0.7.3",
"pyopenssl",
"python-dateutil>=2.8.0",
]

[tool.azure-sdk-conda]
in_bundle = true
bundle_name = "azure-keyvault"
Loading
Loading