Skip to content

{KeyVault} Add new profile 2020-09-01-hybrid in function is_azure_stack_profile#15535

Merged
bim-msft merged 1 commit intoAzure:devfrom
bim-msft:bim_kv_add_profile
Oct 22, 2020
Merged

{KeyVault} Add new profile 2020-09-01-hybrid in function is_azure_stack_profile#15535
bim-msft merged 1 commit intoAzure:devfrom
bim-msft:bim_kv_add_profile

Conversation

@bim-msft
Copy link
Contributor

@bim-msft bim-msft commented Oct 15, 2020

This function is used for determining whether to enable HSM functionality.

def is_azure_stack_profile(cmd):
    return cmd.cli_ctx.cloud.profile in [
        '2020-09-01-hybrid',
        '2019-03-01-hybrid',
        '2018-03-01-hybrid',
        '2017-03-09-profile'
    ]

e.g:

def delete_vault_or_hsm(cmd, client, resource_group_name=None, vault_name=None, hsm_name=None, no_wait=False):
    if is_azure_stack_profile(cmd) or vault_name:
        return client.delete(resource_group_name=resource_group_name, vault_name=vault_name)

    assert hsm_name
    hsm_client = get_client_factory(ResourceType.MGMT_KEYVAULT, Clients.managed_hsms)(cmd.cli_ctx, None)
    return sdk_no_wait(
        no_wait, hsm_client.begin_delete,
        resource_group_name=resource_group_name,
        name=hsm_name
    )

This checklist is used to make sure that common guidelines for a pull request are followed.

@bim-msft bim-msft added this to the S177 milestone Oct 15, 2020
@bim-msft bim-msft self-assigned this Oct 15, 2020
@bim-msft bim-msft added the KeyVault az keyvault label Oct 15, 2020
@bim-msft bim-msft merged commit 1eed077 into Azure:dev Oct 22, 2020
@bim-msft bim-msft deleted the bim_kv_add_profile branch October 22, 2020 09:30
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

KeyVault az keyvault

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants