Azure Virtual Machines Ssh Public Keys API

The SshPublicKeys API from Azure Virtual Machines — 4 operation(s) for sshpublickeys.

GitHub OpenAPI

Operations 7

GET /subscriptions/{subscriptionId}/providers/Microsoft.Compute/sshPublicKeys Ssh public keys list by subscription #
GET /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/sshPublicKeys Ssh public keys list by resource group #
GET /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/sshPublicKeys/{sshPublicKeyName} Ssh public keys get #
PUT /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/sshPublicKeys/{sshPublicKeyName} Ssh public keys create #
PATCH /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/sshPublicKeys/{sshPublicKeyName} Ssh public keys update #
DELETE /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/sshPublicKeys/{sshPublicKeyName} Ssh public keys delete #
POST /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/sshPublicKeys/{sshPublicKeyName}/generateKeyPair Ssh public keys generate key pair #

Documentation

Specifications

SDKs

Schemas & Data

Other Resources

Work with this as data

Every API here is available over the APIs.io API and to AI agents over MCP.

MCP server

One button, every client — Claude, Cursor, VS Code and the rest.

https://apis.io/mcp

Tools for apis

7 MCP tools reach this
  • find_apisBrowse and filter every API in the catalog.
  • get_api_artifactsOne API's artifacts, grouped by type.
  • get_openapiThe primary OpenAPI for this API.
  • find_similar_apisAPIs that look like this one.
  • apis_io_searchSTART HERE — APIs, providers and tags for one query, each with its total.
  • resolveTurn a domain, URL or GitHub org into the provider it belongs to.
  • find_cohortsEvery scored population of providers in the catalog.
All 92 tools →

Call it yourself

curl for this page
This API
curl "https://apis.io/api/v1/apis/microsoft-azure-virtual-machines:microsoft-azure-virtual-machines-sshpublickeys-api"
All apis
curl "https://apis.io/api/v1/apis?limit=25"

Calls without X-API-Key need no key. Calls with it need a paid plan — get a key.

Get an API key

Free tier, no form to fill in. Signing in shares your email address with us — we store it to create your key and to recognise you if you sign in with another provider. By signing up you are subscribing to the APIs.io and API Evangelist newsletters — you can unsubscribe from any issue. See our Privacy Policy and Terms.

A second provider on the same verified email joins the account you already have.

OpenAPI Specification

microsoft-azure-virtual-machines-sshpublickeys-api-openapi.yml Raw ↑
openapi: 3.2.0
info:
  title: Azure Compute resource management API. Ssh Public Keys API
  version: '2026-04-01'
  description: Compute Client
  x-typespec-generated:
  - emitter: '@azure-tools/typespec-autorest'
servers:
- url: https://management.azure.com
security:
- azure_auth:
  - user_impersonation
tags:
- name: SshPublicKeys
paths:
  /subscriptions/{subscriptionId}/providers/Microsoft.Compute/sshPublicKeys:
    get:
      operationId: SshPublicKeys_ListBySubscription
      tags:
      - SshPublicKeys
      description: Lists all of the SSH public keys in the subscription. Use the nextLink property in the response to get the next page of SSH public keys.
      parameters:
      - $ref: '#/components/parameters/ApiVersionParameter'
      - $ref: '#/components/parameters/SubscriptionIdParameter'
      responses:
        '200':
          description: The request has succeeded.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/SshPublicKeysGroupListResult'
        default:
          description: An unexpected error response.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/CloudError'
      x-ms-pageable:
        nextLinkName: nextLink
      summary: Ssh public keys list by subscription
      x-summary-source: derived
  /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/sshPublicKeys:
    get:
      operationId: SshPublicKeys_ListByResourceGroup
      tags:
      - SshPublicKeys
      description: Lists all of the SSH public keys in the specified resource group. Use the nextLink property in the response to get the next page of SSH public keys.
      parameters:
      - $ref: '#/components/parameters/ApiVersionParameter'
      - $ref: '#/components/parameters/SubscriptionIdParameter'
      - $ref: '#/components/parameters/ResourceGroupNameParameter'
      responses:
        '200':
          description: The request has succeeded.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/SshPublicKeysGroupListResult'
        default:
          description: An unexpected error response.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/CloudError'
      x-ms-pageable:
        nextLinkName: nextLink
      summary: Ssh public keys list by resource group
      x-summary-source: derived
  ? /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/sshPublicKeys/{sshPublicKeyName}
  : get:
      operationId: SshPublicKeys_Get
      tags:
      - SshPublicKeys
      description: Retrieves information about an SSH public key.
      parameters:
      - $ref: '#/components/parameters/ApiVersionParameter'
      - $ref: '#/components/parameters/SubscriptionIdParameter'
      - $ref: '#/components/parameters/ResourceGroupNameParameter'
      - name: sshPublicKeyName
        in: path
        description: The name of the SSH public key.
        required: true
        schema:
          type: string
      responses:
        '200':
          description: Azure operation completed successfully.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/SshPublicKeyResource'
        default:
          description: An unexpected error response.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/CloudError'
      summary: Ssh public keys get
      x-summary-source: derived
    put:
      operationId: SshPublicKeys_Create
      tags:
      - SshPublicKeys
      description: Creates a new SSH public key resource.
      parameters:
      - $ref: '#/components/parameters/ApiVersionParameter'
      - $ref: '#/components/parameters/SubscriptionIdParameter'
      - $ref: '#/components/parameters/ResourceGroupNameParameter'
      - name: sshPublicKeyName
        in: path
        description: The name of the SSH public key.
        required: true
        schema:
          type: string
      responses:
        '200':
          description: Resource 'SshPublicKeyResource' update operation succeeded
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/SshPublicKeyResource'
        '201':
          description: Resource 'SshPublicKeyResource' create operation succeeded
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/SshPublicKeyResource'
        default:
          description: An unexpected error response.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/CloudError'
      requestBody:
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/SshPublicKeyResource'
        description: Parameters supplied to create the SSH public key.
        required: true
      summary: Ssh public keys create
      x-summary-source: derived
    patch:
      operationId: SshPublicKeys_Update
      tags:
      - SshPublicKeys
      description: Updates a new SSH public key resource.
      parameters:
      - $ref: '#/components/parameters/ApiVersionParameter'
      - $ref: '#/components/parameters/SubscriptionIdParameter'
      - $ref: '#/components/parameters/ResourceGroupNameParameter'
      - name: sshPublicKeyName
        in: path
        description: The name of the SSH public key.
        required: true
        schema:
          type: string
      responses:
        '200':
          description: Azure operation completed successfully.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/SshPublicKeyResource'
        default:
          description: An unexpected error response.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/CloudError'
      requestBody:
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/SshPublicKeyUpdateResource'
        description: Parameters supplied to update the SSH public key.
        required: true
      summary: Ssh public keys update
      x-summary-source: derived
    delete:
      operationId: SshPublicKeys_Delete
      tags:
      - SshPublicKeys
      description: Delete an SSH public key.
      parameters:
      - $ref: '#/components/parameters/ApiVersionParameter'
      - $ref: '#/components/parameters/SubscriptionIdParameter'
      - $ref: '#/components/parameters/ResourceGroupNameParameter'
      - name: sshPublicKeyName
        in: path
        description: The name of the SSH public key.
        required: true
        schema:
          type: string
      responses:
        '200':
          description: Resource deleted successfully.
        '204':
          description: Resource does not exist.
        default:
          description: An unexpected error response.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/CloudError'
      summary: Ssh public keys delete
      x-summary-source: derived
  ? /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/sshPublicKeys/{sshPublicKeyName}/generateKeyPair
  : post:
      operationId: SshPublicKeys_GenerateKeyPair
      tags:
      - SshPublicKeys
      description: Generates and returns a public/private key pair and populates the SSH public key resource with the public key. The length of the key will be 3072 bits. This operation can only be performed once per SSH public key resource.
      parameters:
      - $ref: '#/components/parameters/ApiVersionParameter'
      - $ref: '#/components/parameters/SubscriptionIdParameter'
      - $ref: '#/components/parameters/ResourceGroupNameParameter'
      - name: sshPublicKeyName
        in: path
        description: The name of the SSH public key.
        required: true
        schema:
          type: string
      responses:
        '200':
          description: Azure operation completed successfully.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/SshPublicKeyGenerateKeyPairResult'
        default:
          description: An unexpected error response.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/CloudError'
      requestBody:
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/SshGenerateKeyPairInputParameters'
        description: Parameters supplied to generate the SSH public key.
      summary: Ssh public keys generate key pair
      x-summary-source: derived
components:
  parameters:
    SubscriptionIdParameter:
      name: subscriptionId
      in: path
      description: The ID of the target subscription.
      required: true
      schema:
        type: string
        minLength: 1
    ResourceGroupNameParameter:
      name: resourceGroupName
      in: path
      description: The name of the resource group. The name is case insensitive.
      required: true
      x-ms-parameter-location: method
      schema:
        type: string
        maxLength: 90
        minLength: 1
    ApiVersionParameter:
      name: api-version
      in: query
      description: The API version to use for this operation.
      required: true
      schema:
        type: string
        minLength: 1
  schemas:
    SshPublicKeyResourceProperties:
      type: object
      description: Properties of the SSH public key.
      properties:
        publicKey:
          type: string
          description: SSH public key used to authenticate to a virtual machine through ssh. If this property is not initially provided when the resource is created, the publicKey property will be populated when generateKeyPair is called. If the public key is provided upon resource creation, the provided public key needs to be at least 2048-bit and in ssh-rsa format.
    TrackedResource:
      type: object
      title: Tracked Resource
      description: The resource model definition for an Azure Resource Manager tracked top level resource which has 'tags' and a 'location'
      properties:
        tags:
          type: object
          description: Resource tags.
          additionalProperties:
            type: string
          x-ms-mutability:
          - read
          - create
          - update
        location:
          type: string
          description: The geo-location where the resource lives
          x-ms-mutability:
          - read
          - create
      required:
      - location
      allOf:
      - $ref: '#/components/schemas/Resource'
    ApiError:
      type: object
      properties:
        details:
          type: array
          items:
            $ref: '#/components/schemas/ApiErrorBase'
          x-ms-identifiers:
          - message
          - target
          description: The Api error details
        innererror:
          $ref: '#/components/schemas/InnerError'
          description: The Api inner error
        code:
          type: string
          description: The error code.
        target:
          type: string
          description: The target of the particular error.
        message:
          type: string
          description: The error message.
      description: Api error.
    CloudError:
      type: object
      x-ms-external: true
      properties:
        error:
          $ref: '#/components/schemas/ApiError'
      description: An error response from the Compute service.
    SshPublicKeysGroupListResult:
      type: object
      description: The list SSH public keys operation response.
      properties:
        value:
          type: array
          description: The list of SSH public keys.
          items:
            $ref: '#/components/schemas/SshPublicKeyResource'
        nextLink:
          type: string
          format: uri
          description: The URI to fetch the next page of SSH public keys. Call ListNext() with this URI to fetch the next page of SSH public keys.
      required:
      - value
    SshPublicKeyResource:
      type: object
      description: Specifies information about the SSH public key.
      properties:
        properties:
          $ref: '#/components/schemas/SshPublicKeyResourceProperties'
          description: Properties of the SSH public key.
          x-ms-client-flatten: true
      allOf:
      - $ref: '#/components/schemas/TrackedResource'
    UpdateResource:
      type: object
      description: The Update Resource model definition.
      properties:
        tags:
          type: object
          description: Resource tags
          additionalProperties:
            type: string
    SshEncryptionTypes:
      type: string
      description: The encryption type of the SSH keys to be generated. See SshEncryptionTypes for possible set of values. If not provided, will default to RSA
      enum:
      - RSA
      - Ed25519
      x-ms-enum:
        name: SshEncryptionTypes
        modelAsString: true
        values:
        - name: RSA
          value: RSA
        - name: Ed25519
          value: Ed25519
    SshPublicKeyGenerateKeyPairResult:
      type: object
      description: Response from generation of an SSH key pair.
      properties:
        privateKey:
          type: string
          description: Private key portion of the key pair used to authenticate to a virtual machine through ssh. The private key is returned in RFC3447 format and should be treated as a secret.
        publicKey:
          type: string
          description: Public key portion of the key pair used to authenticate to a virtual machine through ssh. The public key is in ssh-rsa format.
        id:
          type: string
          description: The ARM resource id in the form of /subscriptions/{SubscriptionId}/resourceGroups/{ResourceGroupName}/providers/Microsoft.Compute/sshPublicKeys/{SshPublicKeyName}
      required:
      - privateKey
      - publicKey
      - id
    SshGenerateKeyPairInputParameters:
      type: object
      description: Parameters for GenerateSshKeyPair.
      properties:
        encryptionType:
          $ref: '#/components/schemas/SshEncryptionTypes'
          description: The encryption type of the SSH keys to be generated. See SshEncryptionTypes for possible set of values. If not provided, will default to RSA
    SshPublicKeyUpdateResource:
      type: object
      description: Specifies information about the SSH public key.
      properties:
        properties:
          $ref: '#/components/schemas/SshPublicKeyResourceProperties'
          description: Properties of the SSH public key.
          x-ms-client-flatten: true
      allOf:
      - $ref: '#/components/schemas/UpdateResource'
  securitySchemes:
    azure_auth:
      type: oauth2
      flows:
        implicit:
          scopes:
            user_impersonation: impersonate your user account
          authorizationUrl: https://login.microsoftonline.com/common/oauth2/authorize
      description: Azure Active Directory OAuth2 Flow.
x-ms-paths:
  ? /subscriptions/{subscriptionId}/providers/Microsoft.Compute/locations/{location}/publishers/{publisherName}/artifacttypes/vmimage/offers/{offer}/skus/{skus}/versions?$expand=Properties
  : get:
      operationId: VirtualMachineImages_ListWithProperties
      tags:
      - VirtualMachineImages
      parameters:
      - $ref: '#/components/parameters/ApiVersionParameter'
      - $ref: '#/components/parameters/SubscriptionIdParameter'
      - $ref: '#/components/parameters/LocationParameter'
      - name: publisherName
        in: path
        description: A valid image publisher.
        required: true
        type: string
      - name: offer
        in: path
        description: A valid image publisher offer.
        required: true
        type: string
      - name: skus
        in: path
        description: A valid image SKU.
        required: true
        type: string
      - name: $expand
        in: query
        description: The expand expression to apply on the operation.
        required: true
        type: string
      - name: $top
        in: query
        required: false
        type: integer
        format: int32
      - name: $orderby
        in: query
        required: false
        type: string
      responses:
        '200':
          description: Azure operation completed successfully.
          schema:
            type: array
            items:
              $ref: '#/components/schemas/VirtualMachineImage'
        default:
          description: An unexpected error response.
          schema:
            $ref: '#/components/schemas/CloudError'