---
title: "PATCH /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/managedInstances/{managedInstanceName}"
method: PATCH
path: "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/managedInstances/{managedInstanceName}"
tags: ["ManagedInstances"]
---

# PATCH /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/managedInstances/{managedInstanceName}

`PATCH /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/managedInstances/{managedInstanceName}`

Updates a managed instance.

## Path parameters

- `resourceGroupName` string, required
- `managedInstanceName` string, required
- `subscriptionId` string, required

## Query parameters

- `api-version` string, required

## Request body

- ManagedInstanceUpdate — An update request for an Azure SQL Database managed instance.
  - `sku` Sku — unresolved $ref
  - `properties` ManagedInstanceProperties — The properties of a managed instance.
    - `managedInstanceCreateMode` 'Default' | 'PointInTimeRestore' — Specifies the mode of database creation. Default: Regular instance creation. Restore: Creates an instance by restoring a set of backups to specific point in time. RestorePointInTime and SourceManagedInstanceId must be specified.
    - `fullyQualifiedDomainName` string — The fully qualified domain name of the managed instance.
    - `administratorLogin` string — Administrator username for the managed instance. Can only be specified when the managed instance is being created (and is required for creation).
    - `administratorLoginPassword` string — The administrator login password (required for managed instance creation).
    - `subnetId` string — Subnet resource ID for the managed instance.
    - `state` string — The state of the managed instance.
    - `licenseType` 'LicenseIncluded' | 'BasePrice' — The license type. Possible values are 'LicenseIncluded' (regular price inclusive of a new SQL license) and 'BasePrice' (discounted AHB price for bringing your own SQL licenses).
    - `vCores` integer — The number of vCores. Allowed values: 8, 16, 24, 32, 40, 64, 80.
    - `storageSizeInGB` integer — Storage size in GB. Minimum value: 32. Maximum value: 8192. Increments of 32 GB allowed only.
    - `collation` string — Collation of the managed instance.
    - `dnsZone` string — The Dns Zone that the managed instance is in.
    - `dnsZonePartner` string — The resource id of another managed instance whose DNS zone this managed instance will share after creation.
    - `publicDataEndpointEnabled` boolean — Whether or not the public data endpoint is enabled.
    - `sourceManagedInstanceId` string — The resource identifier of the source managed instance associated with create operation of this instance.
    - `restorePointInTime` string, date-time — Specifies the point in time (ISO8601 format) of the source database that will be restored to create the new database.
    - `proxyOverride` 'Proxy' | 'Redirect' | 'Default' — Connection type used for connecting to the instance.
    - `timezoneId` string — Id of the timezone. Allowed values are timezones supported by Windows. Windows keeps details on supported timezones, including the id, in registry under KEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows NT\CurrentVersion\Time Zones. You can get those registry values via SQL Server by querying SELECT name AS timezone_id FROM sys.time_zone_info. List of Ids can also be obtained by executing [System.TimeZoneInfo]::GetSystemTimeZones() in PowerShell. An example of valid timezone id is "Pacific Standard Time" or "W. Europe Standard Time".
    - `instancePoolId` string — The Id of the instance pool this managed server belongs to.
    - `maintenanceConfigurationId` string — Specifies maintenance configuration id to apply to this managed instance.
    - `minimalTlsVersion` string — Minimal TLS version. Allowed values: 'None', '1.0', '1.1', '1.2'
  - `tags` object — Resource tags.

## Response `200`

Successfully updated the managed instance.

- ManagedInstance — unresolved $ref

## Other responses

- `202` — Accepted
- `default` — *** Error Responses: *** * 400 SubscriptionNotFound - The requested subscription was not found. * 400 HkCannotSwitchToInactive - The database cannot proceed with pricing-tier update as it has memory-optimized objects. Please drop such objects and try again. * 400 ManagedInstanceInvalidStorageSizeLessThenCurrentSizeUsed - Invalid storage size: Storage size limit ({0} GB) is less that current storage used ({1} GB). Please specify higher storage size limit. * 400 InstanceTimezoneUpdateNotSupported - Instance timezone update not supported. * 400 CreateManagedInstanceWithNonDefaultTimezoneNotSupported - Create Managed Instance with non-default timezone not supported. * 400 ManagedInstanceIpAddressRangeLimit - Cannot create a Managed Instance as there are not enough available ip addresses in the selected subnet * 400 VnetDelegationNotAllowed - User tried to inject Managed Server to subnet which is delegated. * 400 SubnetHasResourcesOfDifferentType - User tried to create MI in subnet that has resources of different type. * 400 UpdateManagedServerWithMaintenanceWindowNotAllowed - Update of Managed Instance with maintenance window settings is not allowed. * 400 VnetPrepareNIPFailed - User tried to prepare subnet that has a conflict with NetworkIntentPolicy. * 400 InvalidUsername - Supplied user name contains invalid characters. * 400 InvalidParameterValue - An invalid value was given to a parameter. * 400 InstancePoolNotEnoughCapacity - An instance pool does not have enough capacity * 400 ServerNotFound - The requested server was not found. * 400 TokenTooLong - The provided token is too long. * 400 ManagedInstanceSloUpdateFailed - SLO '{0}' operation cannot succeed as the memory usage of '{1}' exceeds the quota. * 400 ManagedInstanceLocalStorageUpdateSloDisabled - Update SLO for managed instances with local storage is not supported yet. * 400 InvalidLoginName - The provided login name is invalid. * 400 RegionDoesNotSupportVersion - A user attempted to create a server of a specified version in a location where that server version isn't supported. * 400 PasswordTooShort - The provided password is too short * 400 PasswordTooLong - The provided password is too long. * 400 PasswordNotComplex - The provided password is not complex enough. * 400 GatewayInvalidEdition - '{0}' is not a valid database edition in this version of SQL Server. * 400 InvalidSubnetResourceId - The provided subnet resource ID for the managed instance create or update is invalid. * 400 SubscriptionNotFound - The requested subscription was not found. * 400 InvalidLocation - An invalid location was specified. * 400 VnetInWrongRegion - Virtual network is in wrong region. * 400 InvalidServerName - Invalid server name specified. * 400 VnetAddressRangeError - Virtual network address range is invalid. * 400 VnetConfigIsNotAllowed - Virtual network configuration is not allowed. * 400 InvalidCollation - Invalid collation. * 400 InvalidIdentifier - The identifier contains NULL or an invalid unicode character. * 400 ManagedInstanceClassicVnetNotSupported - Managed Instance cannot be joined to a classic virtual network. * 400 AlterDbDeactivatedNotSupported - Database Operation failed for Server '{0}', Database '{1}' due to unexpected delay. Please try again. * 400 RegionDoesNotAllowProvisioning - The selected location is not accepting new Windows Azure SQL Database servers. This may change at a later time. * 400 VnetConfigHasNsg - User tried to inject Managed Server subnet with Network Security Groups. * 400 VnetConfigHasNoUdr - User tried to inject Managed Server subnet without default User Defined Route Table. * 400 VnetConfigHasInvalidUdr - User tried to inject Managed Server subnet with invalid User Defined Route Table. * 400 VnetConfigHasInvalidDns - User tried to inject Managed Server subnet with invalid custom DNS. * 400 VnetConfigHasServiceEndpoints - User tried to inject Managed Server subnet with service endpoints. * 400 VnetSubnetIsInUse - User tried to inject Managed Server subnet that is not empty. * 400 VnetSubnetIsLocked - User tried to inject Managed Server subnet that is in locked scope. * 400 VnetSubnetIsGateway - User tried to inject Managed Server subnet that is Gateway subnet. * 400 VnetSubnetIsUnknown - User tried to inject Managed Server subnet that does not exist. * 400 VnetSubnetConflictWithIntendedPolicy - User tried to inject Managed Server subnet that has a conflict with IntendedPolicy. * 400 NameAlreadyExists - The provided name already exists. * 400 ManagedInstanceInvalidEditionForSku - The specified edition {0} is not consistent with the specified SKU {1}. * 400 ProvisioningDisabled - Displays error message from resources operation authorizer as is, without changes * 400 ManagedInstanceInvalidLicenseType - The specified license type {0} is not valid. * 400 ManagedInstanceUpdateSloInProgress - "The operation could not be completed because a service tier change is in progress for managed instance '{0}.' Please wait for the operation in progress to complete and try again." * 400 VnetResourceNotFound - Resource not found: '{0}'. * 400 InvalidTimezone - Invalid timezone. * 400 UnableToResolveRemoteServer - The remote partner server name could not be resolved due to an invalid server name or DNS connectivity issues. * 400 InstanceCollationUpdateNotSupported - User cannot change instance collation on Managed Instance. * 400 CreateManagedInstanceWithNonDefaultCollationNotSupported - User can create a Managed Instance only with collation 'SQL_Latin1_General_CP1_CI_AS'. * 400 ManagedInstanceOperationInProgress - The operation could not be completed because {0} operation is in progress. Please wait for the operation in progress to complete and try again. * 400 ManagedInstanceExceedMaxAzureStorage - The operation could not be completed because total allocated storage size for General Purpose instance would exceed {0}. Please reduce the number of database files and retry operation. * 400 ManagedInstanceHasGeoReplica - The operation could not be completed because instance has configured geo replicated secondary instance. * 400 ProvisioningDisabled - Displays error message from resources operation authorizer as is, without changes * 400 ManagementServiceFeatureDisabled - User attempted to use a feature which is disabled. * 400 MismatchingResourceGroupNameWithUrl - The provided resource group name did not match the name in the Url. * 400 MismatchingSubscriptionWithUrl - The provided subscription did not match the subscription in the Url. * 400 InvalidMinimalTlsVersion - Invalid minimal TLS version. * 400 InvalidMaintenanceWindowSettings - Invalid maintenance window settings. * 400 InvalidMaintenanceWindowProperty - Invalid maintenance window property was specified. * 400 InvalidMaintenanceWindowPropertyNull - Invalid maintenance window with required properties null. * 400 InvalidMaintenanceWindowTypeWithPropertySpecified - Maintenance window type must not have certain properties specified. * 404 ServerNotInSubscription - Specified server does not exist on the specified subscription. * 404 ManagedInstanceNotInSubscriptionResourceGroup - Specified managed instance does not exist in the specified resource group and subscription. * 404 OperationIdNotFound - The operation with Id does not exist. * 404 ResourceDoesNotExist - Resource with the name '{0}' does not exist. To continue, specify a valid resource name. * 404 ResourceNotFound - The requested resource was not found. * 405 InvalidVcoreValue - vCore value {0} is not valid. Please specify a valid vCore value. * 405 InvalidHardwareGenerationValue - HardwareGeneration {0} is not valid. Please specify a valid HardwareGeneration value. * 405 InvalidStorageSizeValue - "Invalid storage size: {0} GB. Storage size must be specified between {1} and {2} gigabytes, in increments of {3} GB. * 409 OperationCancelled - The operation has been cancelled by user. * 409 OperationInterrupted - The operation on the resource could not be completed because it was interrupted by another operation on the same resource. * 409 ConflictingServerOperation - An operation is currently in progress for the server. * 409 SubscriptionDisabled - Subscription is disabled. * 409 ServerAlreadyExists - Duplicate server name. * 409 ServerOverridePreconditionFailed - Failed to apply server override on category '{0}', because physical db or instance '{1}' in server '{2}' is currently not in 'Ready' or 'Deactivated' state. * 409 ServerDisabled - Server is disabled. * 409 ManagedInstanceIsBusy - The server '{0}' is currently busy. Please wait a few minutes before trying again. * 409 ServerQuotaExceeded - Server cannot be added to a subscription because it will exceed quota. * 409 ConflictingManagedInstanceOperation - An operation is currently in progress for the managed instance. * 409 MiDropFailedOnAuthLocks - User tried to drop last Managed Instance in subnet that has Lock applied on resource(s). * 429 SubscriptionTooManyCreateUpdateRequests - Requests beyond max requests that can be processed by available resources. * 429 SubscriptionTooManyRequests - Requests beyond max requests that can be processed by available resources. * 429 ConflictingSubscriptionOperation - An operation is currently in progress for the subscription. * 429 SubscriptionTooManyCreateUpdateRequests - Requests beyond max requests that can be processed by available resources. * 429 SubscriptionTooManyRequests - Requests beyond max requests that can be processed by available resources. * 429 SubscriptionTooManyCreateUpdateRequests - Requests beyond max requests that can be processed by available resources. * 429 SubscriptionTooManyRequests - Requests beyond max requests that can be processed by available resources. * 429 ConflictingSubscriptionOperation - An operation is currently in progress for the subscription. * 500 OperationTimedOut - The operation timed out and automatically rolled back. Please retry the operation. * 500 GatewayInternalServerError - The server encountered an unexpected exception. * 503 TooManyRequests - Requests beyond max requests that can be processed by available resources. * 503 TooManyRequests - Requests beyond max requests that can be processed by available resources. * 503 TooManyRequests - Requests beyond max requests that can be processed by available resources. * 504 RequestTimeout - Service request exceeded the allowed timeout. * 504 RequestTimeout - Service request exceeded the allowed timeout. * 504 RequestTimeout - Service request exceeded the allowed timeout.

---

[API](https://skmtc.dev/azure/apis/sqlmanagementclient-48.md) · [All operations](https://skmtc.dev/azure/apis/sqlmanagementclient-48/llms.txt) · [OpenAPI document](https://skmtc-service-production.skmtc.workers.dev/v1/apis/azure/sqlmanagementclient-48/revisions/0511893cb6d2/schema)
