Creates a new workspace.
PUT https://management.azure.com/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Databricks/workspaces/{workspaceName}?api-version=2023-02-01
URI Parameters
Name |
In |
Required |
Type |
Description |
resourceGroupName
|
path |
True
|
string
|
The name of the resource group. The name is case insensitive.
Regex pattern: ^[-\w\._\(\)]+$
|
subscriptionId
|
path |
True
|
string
|
The ID of the target subscription.
|
workspaceName
|
path |
True
|
string
|
The name of the workspace.
|
api-version
|
query |
True
|
string
|
The API version to use for this operation.
|
Request Body
Name |
Required |
Type |
Description |
location
|
True
|
string
|
The geo-location where the resource lives
|
properties.managedResourceGroupId
|
True
|
string
|
The managed resource group Id.
|
properties.authorizations
|
|
WorkspaceProviderAuthorization[]
|
The workspace provider authorizations.
|
properties.createdBy
|
|
CreatedBy
|
Indicates the Object ID, PUID and Application ID of entity that created the workspace.
|
properties.encryption
|
|
WorkspaceProperties.Encryption
|
Encryption properties for databricks workspace
|
properties.managedDiskIdentity
|
|
ManagedIdentityConfiguration
|
The details of Managed Identity of Disk Encryption Set used for Managed Disk Encryption
|
properties.parameters
|
|
WorkspaceCustomParameters
|
The workspace's custom parameters.
|
properties.publicNetworkAccess
|
|
PublicNetworkAccess
|
The network access type for accessing workspace. Set value to disabled to access workspace only via private link.
|
properties.requiredNsgRules
|
|
RequiredNsgRules
|
Gets or sets a value indicating whether data plane (clusters) to control plane communication happen over private endpoint. Supported values are 'AllRules' and 'NoAzureDatabricksRules'. 'NoAzureServiceRules' value is for internal use only.
|
properties.storageAccountIdentity
|
|
ManagedIdentityConfiguration
|
The details of Managed Identity of Storage Account
|
properties.uiDefinitionUri
|
|
string
|
The blob URI where the UI definition file is located.
|
properties.updatedBy
|
|
CreatedBy
|
Indicates the Object ID, PUID and Application ID of entity that last updated the workspace.
|
sku
|
|
Sku
|
The SKU of the resource.
|
tags
|
|
object
|
Resource tags.
|
Responses
Name |
Type |
Description |
200 OK
|
Workspace
|
Created - Returns information about the workspace, including provisioning status.
|
201 Created
|
Workspace
|
Created - Returns information about the workspace, including provisioning status.
|
Other Status Codes
|
ErrorResponse
|
Error response describing why the operation failed.
|
Security
azure_auth
Azure Active Directory OAuth2 Flow
Type:
oauth2
Flow:
implicit
Authorization URL:
https://login.microsoftonline.com/common/oauth2/authorize
Scopes
Name |
Description |
user_impersonation
|
impersonate your user account
|
Examples
Create a workspace which is ready for Customer-Managed Key (CMK) encryption
Sample Request
PUT https://management.azure.com/subscriptions/subid/resourceGroups/rg/providers/Microsoft.Databricks/workspaces/myWorkspace?api-version=2023-02-01
{
"properties": {
"managedResourceGroupId": "/subscriptions/subid/resourceGroups/myManagedRG",
"parameters": {
"prepareEncryption": {
"value": true
}
}
},
"location": "westus"
}
import com.azure.resourcemanager.databricks.models.WorkspaceCustomBooleanParameter;
import com.azure.resourcemanager.databricks.models.WorkspaceCustomParameters;
import java.util.HashMap;
import java.util.Map;
/** Samples for Workspaces CreateOrUpdate. */
public final class Main {
/*
* x-ms-original-file: specification/databricks/resource-manager/Microsoft.Databricks/stable/2023-02-01/examples/PrepareEncryption.json
*/
/**
* Sample code: Create a workspace which is ready for Customer-Managed Key (CMK) encryption.
*
* @param manager Entry point to AzureDatabricksManager.
*/
public static void createAWorkspaceWhichIsReadyForCustomerManagedKeyCMKEncryption(
com.azure.resourcemanager.databricks.AzureDatabricksManager manager) {
manager
.workspaces()
.define("myWorkspace")
.withRegion("westus")
.withExistingResourceGroup("rg")
.withManagedResourceGroupId("/subscriptions/subid/resourceGroups/myManagedRG")
.withParameters(
new WorkspaceCustomParameters()
.withPrepareEncryption(new WorkspaceCustomBooleanParameter().withValue(true)))
.create();
}
@SuppressWarnings("unchecked")
private static <T> Map<String, T> mapOf(Object... inputs) {
Map<String, T> map = new HashMap<>();
for (int i = 0; i < inputs.length; i += 2) {
String key = (String) inputs[i];
T value = (T) inputs[i + 1];
map.put(key, value);
}
return map;
}
}
To use the Azure SDK library in your project, see this documentation. To provide feedback on this code sample, open a GitHub issue
from azure.identity import DefaultAzureCredential
from azure.mgmt.databricks import AzureDatabricksManagementClient
"""
# PREREQUISITES
pip install azure-identity
pip install azure-mgmt-databricks
# USAGE
python prepare_encryption.py
Before run the sample, please set the values of the client ID, tenant ID and client secret
of the AAD application as environment variables: AZURE_CLIENT_ID, AZURE_TENANT_ID,
AZURE_CLIENT_SECRET. For more info about how to get the value, please see:
https://docs.microsoft.com/azure/active-directory/develop/howto-create-service-principal-portal
"""
def main():
client = AzureDatabricksManagementClient(
credential=DefaultAzureCredential(),
subscription_id="subid",
)
response = client.workspaces.begin_create_or_update(
resource_group_name="rg",
workspace_name="myWorkspace",
parameters={
"location": "westus",
"properties": {
"managedResourceGroupId": "/subscriptions/subid/resourceGroups/myManagedRG",
"parameters": {"prepareEncryption": {"value": True}},
},
},
).result()
print(response)
# x-ms-original-file: specification/databricks/resource-manager/Microsoft.Databricks/stable/2023-02-01/examples/PrepareEncryption.json
if __name__ == "__main__":
main()
To use the Azure SDK library in your project, see this documentation. To provide feedback on this code sample, open a GitHub issue
package armdatabricks_test
import (
"context"
"log"
"github.com/Azure/azure-sdk-for-go/sdk/azcore/to"
"github.com/Azure/azure-sdk-for-go/sdk/azidentity"
"github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/databricks/armdatabricks"
)
// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/e1a87e1a5deb3f986ea1474d233d6680f1e19fc1/specification/databricks/resource-manager/Microsoft.Databricks/stable/2023-02-01/examples/PrepareEncryption.json
func ExampleWorkspacesClient_BeginCreateOrUpdate_createAWorkspaceWhichIsReadyForCustomerManagedKeyCmkEncryption() {
cred, err := azidentity.NewDefaultAzureCredential(nil)
if err != nil {
log.Fatalf("failed to obtain a credential: %v", err)
}
ctx := context.Background()
clientFactory, err := armdatabricks.NewClientFactory("<subscription-id>", cred, nil)
if err != nil {
log.Fatalf("failed to create client: %v", err)
}
poller, err := clientFactory.NewWorkspacesClient().BeginCreateOrUpdate(ctx, "rg", "myWorkspace", armdatabricks.Workspace{
Location: to.Ptr("westus"),
Properties: &armdatabricks.WorkspaceProperties{
ManagedResourceGroupID: to.Ptr("/subscriptions/subid/resourceGroups/myManagedRG"),
Parameters: &armdatabricks.WorkspaceCustomParameters{
PrepareEncryption: &armdatabricks.WorkspaceCustomBooleanParameter{
Value: to.Ptr(true),
},
},
},
}, nil)
if err != nil {
log.Fatalf("failed to finish the request: %v", err)
}
res, err := poller.PollUntilDone(ctx, nil)
if err != nil {
log.Fatalf("failed to pull the result: %v", err)
}
// You could use response here. We use blank identifier for just demo purposes.
_ = res
// If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes.
// res.Workspace = armdatabricks.Workspace{
// Name: to.Ptr("myWorkspace"),
// Type: to.Ptr("Microsoft.Databricks/workspaces"),
// ID: to.Ptr("/subscriptions/subid/resourceGroups/rg/providers/Microsoft.Databricks/workspaces/myWorkspace"),
// Location: to.Ptr("East US 2"),
// Properties: &armdatabricks.WorkspaceProperties{
// Authorizations: []*armdatabricks.WorkspaceProviderAuthorization{
// {
// PrincipalID: to.Ptr("00000000-0000-0000-0000-000000000000"),
// RoleDefinitionID: to.Ptr("11111111-1111-1111-1111-111111111111"),
// }},
// CreatedBy: &armdatabricks.CreatedBy{
// ApplicationID: to.Ptr("44444444-4444-4444-4444-444444444444"),
// Oid: to.Ptr("22222222-2222-2222-2222-222222222222"),
// Puid: to.Ptr("33333333"),
// },
// CreatedDateTime: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2020-02-20T00:10:29.285Z"); return t}()),
// ManagedResourceGroupID: to.Ptr("/subscriptions/subid/resourceGroups/myManagedRG"),
// ProvisioningState: to.Ptr(armdatabricks.ProvisioningStateSucceeded),
// StorageAccountIdentity: &armdatabricks.ManagedIdentityConfiguration{
// Type: to.Ptr("SystemAssigned"),
// PrincipalID: to.Ptr("55555555-5555-5555-5555-555555555555"),
// TenantID: to.Ptr("66666666-6666-6666-6666-666666666666"),
// },
// UIDefinitionURI: to.Ptr("https://path/to/workspaceCreateUiDefinition.json"),
// UpdatedBy: &armdatabricks.CreatedBy{
// ApplicationID: to.Ptr("44444444-4444-4444-4444-444444444444"),
// Oid: to.Ptr("22222222-2222-2222-2222-222222222222"),
// Puid: to.Ptr("33333333"),
// },
// WorkspaceID: to.Ptr("5555555555555555"),
// WorkspaceURL: to.Ptr("adb-5555555555555555.19.azuredatabricks.net"),
// },
// SKU: &armdatabricks.SKU{
// Name: to.Ptr("premium"),
// },
// }
}
To use the Azure SDK library in your project, see this documentation. To provide feedback on this code sample, open a GitHub issue
const { AzureDatabricksManagementClient } = require("@azure/arm-databricks");
const { DefaultAzureCredential } = require("@azure/identity");
/**
* This sample demonstrates how to Creates a new workspace.
*
* @summary Creates a new workspace.
* x-ms-original-file: specification/databricks/resource-manager/Microsoft.Databricks/stable/2023-02-01/examples/PrepareEncryption.json
*/
async function createAWorkspaceWhichIsReadyForCustomerManagedKeyCmkEncryption() {
const subscriptionId = process.env["DATABRICKS_SUBSCRIPTION_ID"] || "subid";
const resourceGroupName = process.env["DATABRICKS_RESOURCE_GROUP"] || "rg";
const workspaceName = "myWorkspace";
const parameters = {
location: "westus",
managedResourceGroupId: "/subscriptions/subid/resourceGroups/myManagedRG",
parameters: { prepareEncryption: { value: true } },
};
const credential = new DefaultAzureCredential();
const client = new AzureDatabricksManagementClient(credential, subscriptionId);
const result = await client.workspaces.beginCreateOrUpdateAndWait(
resourceGroupName,
workspaceName,
parameters
);
console.log(result);
}
To use the Azure SDK library in your project, see this documentation. To provide feedback on this code sample, open a GitHub issue
Sample Response
{
"name": "myWorkspace",
"id": "/subscriptions/subid/resourceGroups/rg/providers/Microsoft.Databricks/workspaces/myWorkspace",
"type": "Microsoft.Databricks/workspaces",
"sku": {
"name": "premium"
},
"location": "East US 2",
"properties": {
"managedResourceGroupId": "/subscriptions/subid/resourceGroups/myManagedRG",
"parameters": null,
"provisioningState": "Succeeded",
"uiDefinitionUri": "https://path/to/workspaceCreateUiDefinition.json",
"authorizations": [
{
"principalId": "00000000-0000-0000-0000-000000000000",
"roleDefinitionId": "11111111-1111-1111-1111-111111111111"
}
],
"createdBy": {
"oid": "22222222-2222-2222-2222-222222222222",
"puid": "33333333",
"applicationId": "44444444-4444-4444-4444-444444444444"
},
"storageAccountIdentity": {
"principalId": "55555555-5555-5555-5555-555555555555",
"tenantId": "66666666-6666-6666-6666-666666666666",
"type": "SystemAssigned"
},
"updatedBy": {
"oid": "22222222-2222-2222-2222-222222222222",
"puid": "33333333",
"applicationId": "44444444-4444-4444-4444-444444444444"
},
"createdDateTime": "2020-02-20T00:10:29.2858439Z",
"workspaceId": "5555555555555555",
"workspaceUrl": "adb-5555555555555555.19.azuredatabricks.net"
}
}
{
"name": "myWorkspace",
"id": "/subscriptions/subid/resourceGroups/rg/providers/Microsoft.Databricks/workspaces/myWorkspace",
"type": "Microsoft.Databricks/workspaces",
"location": "East US 2",
"tags": {
"environment": "dev"
},
"sku": {
"name": "premium"
},
"properties": {
"managedResourceGroupId": "/subscriptions/subid/resourceGroups/myManagedRG",
"parameters": null,
"provisioningState": "Accepted",
"uiDefinitionUri": "https://path/to/workspaceCreateUiDefinition.json",
"authorizations": [
{
"principalId": "00000000-0000-0000-0000-000000000000",
"roleDefinitionId": "11111111-1111-1111-1111-111111111111"
}
],
"createdBy": {
"oid": "22222222-2222-2222-2222-222222222222",
"puid": "33333333",
"applicationId": "44444444-4444-4444-4444-444444444444"
},
"updatedBy": {
"oid": "22222222-2222-2222-2222-222222222222",
"puid": "33333333",
"applicationId": "44444444-4444-4444-4444-444444444444"
},
"createdDateTime": "2020-02-20T00:10:29.2858439Z"
}
}
Create a workspace with Customer-Managed Key (CMK) encryption for Managed Disks
Sample Request
PUT https://management.azure.com/subscriptions/subid/resourceGroups/rg/providers/Microsoft.Databricks/workspaces/myWorkspace?api-version=2023-02-01
{
"properties": {
"managedResourceGroupId": "/subscriptions/subid/resourceGroups/myManagedRG",
"encryption": {
"entities": {
"managedDisk": {
"keySource": "Microsoft.Keyvault",
"keyVaultProperties": {
"keyVaultUri": "https://test-vault-name.vault.azure.net/",
"keyName": "test-cmk-key",
"keyVersion": "00000000000000000000000000000000"
},
"rotationToLatestKeyVersionEnabled": true
}
}
}
},
"location": "westus"
}
import com.azure.resourcemanager.databricks.models.EncryptionEntitiesDefinition;
import com.azure.resourcemanager.databricks.models.EncryptionKeySource;
import com.azure.resourcemanager.databricks.models.ManagedDiskEncryption;
import com.azure.resourcemanager.databricks.models.ManagedDiskEncryptionKeyVaultProperties;
import com.azure.resourcemanager.databricks.models.WorkspacePropertiesEncryption;
import java.util.HashMap;
import java.util.Map;
/** Samples for Workspaces CreateOrUpdate. */
public final class Main {
/*
* x-ms-original-file: specification/databricks/resource-manager/Microsoft.Databricks/stable/2023-02-01/examples/WorkspaceManagedDiskEncryptionCreate.json
*/
/**
* Sample code: Create a workspace with Customer-Managed Key (CMK) encryption for Managed Disks.
*
* @param manager Entry point to AzureDatabricksManager.
*/
public static void createAWorkspaceWithCustomerManagedKeyCMKEncryptionForManagedDisks(
com.azure.resourcemanager.databricks.AzureDatabricksManager manager) {
manager
.workspaces()
.define("myWorkspace")
.withRegion("westus")
.withExistingResourceGroup("rg")
.withManagedResourceGroupId("/subscriptions/subid/resourceGroups/myManagedRG")
.withEncryption(
new WorkspacePropertiesEncryption()
.withEntities(
new EncryptionEntitiesDefinition()
.withManagedDisk(
new ManagedDiskEncryption()
.withKeySource(EncryptionKeySource.MICROSOFT_KEYVAULT)
.withKeyVaultProperties(
new ManagedDiskEncryptionKeyVaultProperties()
.withKeyVaultUri("fakeTokenPlaceholder")
.withKeyName("fakeTokenPlaceholder")
.withKeyVersion("fakeTokenPlaceholder"))
.withRotationToLatestKeyVersionEnabled(true))))
.create();
}
@SuppressWarnings("unchecked")
private static <T> Map<String, T> mapOf(Object... inputs) {
Map<String, T> map = new HashMap<>();
for (int i = 0; i < inputs.length; i += 2) {
String key = (String) inputs[i];
T value = (T) inputs[i + 1];
map.put(key, value);
}
return map;
}
}
To use the Azure SDK library in your project, see this documentation. To provide feedback on this code sample, open a GitHub issue
from azure.identity import DefaultAzureCredential
from azure.mgmt.databricks import AzureDatabricksManagementClient
"""
# PREREQUISITES
pip install azure-identity
pip install azure-mgmt-databricks
# USAGE
python workspace_managed_disk_encryption_create.py
Before run the sample, please set the values of the client ID, tenant ID and client secret
of the AAD application as environment variables: AZURE_CLIENT_ID, AZURE_TENANT_ID,
AZURE_CLIENT_SECRET. For more info about how to get the value, please see:
https://docs.microsoft.com/azure/active-directory/develop/howto-create-service-principal-portal
"""
def main():
client = AzureDatabricksManagementClient(
credential=DefaultAzureCredential(),
subscription_id="subid",
)
response = client.workspaces.begin_create_or_update(
resource_group_name="rg",
workspace_name="myWorkspace",
parameters={
"location": "westus",
"properties": {
"encryption": {
"entities": {
"managedDisk": {
"keySource": "Microsoft.Keyvault",
"keyVaultProperties": {
"keyName": "test-cmk-key",
"keyVaultUri": "https://test-vault-name.vault.azure.net/",
"keyVersion": "00000000000000000000000000000000",
},
"rotationToLatestKeyVersionEnabled": True,
}
}
},
"managedResourceGroupId": "/subscriptions/subid/resourceGroups/myManagedRG",
},
},
).result()
print(response)
# x-ms-original-file: specification/databricks/resource-manager/Microsoft.Databricks/stable/2023-02-01/examples/WorkspaceManagedDiskEncryptionCreate.json
if __name__ == "__main__":
main()
To use the Azure SDK library in your project, see this documentation. To provide feedback on this code sample, open a GitHub issue
package armdatabricks_test
import (
"context"
"log"
"github.com/Azure/azure-sdk-for-go/sdk/azcore/to"
"github.com/Azure/azure-sdk-for-go/sdk/azidentity"
"github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/databricks/armdatabricks"
)
// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/e1a87e1a5deb3f986ea1474d233d6680f1e19fc1/specification/databricks/resource-manager/Microsoft.Databricks/stable/2023-02-01/examples/WorkspaceManagedDiskEncryptionCreate.json
func ExampleWorkspacesClient_BeginCreateOrUpdate_createAWorkspaceWithCustomerManagedKeyCmkEncryptionForManagedDisks() {
cred, err := azidentity.NewDefaultAzureCredential(nil)
if err != nil {
log.Fatalf("failed to obtain a credential: %v", err)
}
ctx := context.Background()
clientFactory, err := armdatabricks.NewClientFactory("<subscription-id>", cred, nil)
if err != nil {
log.Fatalf("failed to create client: %v", err)
}
poller, err := clientFactory.NewWorkspacesClient().BeginCreateOrUpdate(ctx, "rg", "myWorkspace", armdatabricks.Workspace{
Location: to.Ptr("westus"),
Properties: &armdatabricks.WorkspaceProperties{
Encryption: &armdatabricks.WorkspacePropertiesEncryption{
Entities: &armdatabricks.EncryptionEntitiesDefinition{
ManagedDisk: &armdatabricks.ManagedDiskEncryption{
KeySource: to.Ptr(armdatabricks.EncryptionKeySourceMicrosoftKeyvault),
KeyVaultProperties: &armdatabricks.ManagedDiskEncryptionKeyVaultProperties{
KeyName: to.Ptr("test-cmk-key"),
KeyVaultURI: to.Ptr("https://test-vault-name.vault.azure.net/"),
KeyVersion: to.Ptr("00000000000000000000000000000000"),
},
RotationToLatestKeyVersionEnabled: to.Ptr(true),
},
},
},
ManagedResourceGroupID: to.Ptr("/subscriptions/subid/resourceGroups/myManagedRG"),
},
}, nil)
if err != nil {
log.Fatalf("failed to finish the request: %v", err)
}
res, err := poller.PollUntilDone(ctx, nil)
if err != nil {
log.Fatalf("failed to pull the result: %v", err)
}
// You could use response here. We use blank identifier for just demo purposes.
_ = res
// If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes.
// res.Workspace = armdatabricks.Workspace{
// Type: to.Ptr("Microsoft.Databricks/workspaces"),
// ID: to.Ptr("/subscriptions/subid/resourceGroups/rg/providers/Microsoft.Databricks/workspaces/myWorkspace"),
// Location: to.Ptr("East US 2"),
// Properties: &armdatabricks.WorkspaceProperties{
// Authorizations: []*armdatabricks.WorkspaceProviderAuthorization{
// {
// PrincipalID: to.Ptr("00000000-0000-0000-0000-000000000000"),
// RoleDefinitionID: to.Ptr("11111111-1111-1111-1111-111111111111"),
// }},
// CreatedBy: &armdatabricks.CreatedBy{
// ApplicationID: to.Ptr("44444444-4444-4444-4444-444444444444"),
// Oid: to.Ptr("22222222-2222-2222-2222-222222222222"),
// Puid: to.Ptr("33333333"),
// },
// CreatedDateTime: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2020-02-20T00:10:29.285Z"); return t}()),
// DiskEncryptionSetID: to.Ptr("/subscriptions/subid/resourceGroups/myManagedRG/providers/Microsoft.Compute/diskEncryptionSets/myDiskEncryptionSet"),
// Encryption: &armdatabricks.WorkspacePropertiesEncryption{
// Entities: &armdatabricks.EncryptionEntitiesDefinition{
// ManagedDisk: &armdatabricks.ManagedDiskEncryption{
// KeySource: to.Ptr(armdatabricks.EncryptionKeySourceMicrosoftKeyvault),
// KeyVaultProperties: &armdatabricks.ManagedDiskEncryptionKeyVaultProperties{
// KeyName: to.Ptr("test-cmk-key"),
// KeyVaultURI: to.Ptr("https://test-vault-name.vault.azure.net/"),
// KeyVersion: to.Ptr("00000000000000000000000000000000"),
// },
// RotationToLatestKeyVersionEnabled: to.Ptr(true),
// },
// },
// },
// ManagedDiskIdentity: &armdatabricks.ManagedIdentityConfiguration{
// Type: to.Ptr("SystemAssigned"),
// PrincipalID: to.Ptr("22222222-2222-2222-2222-222222222222"),
// TenantID: to.Ptr("44444444-4444-4444-4444-444444444444"),
// },
// ManagedResourceGroupID: to.Ptr("/subscriptions/subid/resourceGroups/myManagedRG"),
// ProvisioningState: to.Ptr(armdatabricks.ProvisioningStateSucceeded),
// UIDefinitionURI: to.Ptr("https://path/to/workspaceCreateUiDefinition.json"),
// UpdatedBy: &armdatabricks.CreatedBy{
// ApplicationID: to.Ptr("44444444-4444-4444-4444-444444444444"),
// Oid: to.Ptr("22222222-2222-2222-2222-222222222222"),
// Puid: to.Ptr("33333333"),
// },
// WorkspaceID: to.Ptr("5555555555555555"),
// WorkspaceURL: to.Ptr("adb-5555555555555555.19.azuredatabricks.net"),
// },
// SKU: &armdatabricks.SKU{
// Name: to.Ptr("premium"),
// },
// }
}
To use the Azure SDK library in your project, see this documentation. To provide feedback on this code sample, open a GitHub issue
const { AzureDatabricksManagementClient } = require("@azure/arm-databricks");
const { DefaultAzureCredential } = require("@azure/identity");
/**
* This sample demonstrates how to Creates a new workspace.
*
* @summary Creates a new workspace.
* x-ms-original-file: specification/databricks/resource-manager/Microsoft.Databricks/stable/2023-02-01/examples/WorkspaceManagedDiskEncryptionCreate.json
*/
async function createAWorkspaceWithCustomerManagedKeyCmkEncryptionForManagedDisks() {
const subscriptionId = process.env["DATABRICKS_SUBSCRIPTION_ID"] || "subid";
const resourceGroupName = process.env["DATABRICKS_RESOURCE_GROUP"] || "rg";
const workspaceName = "myWorkspace";
const parameters = {
encryption: {
entities: {
managedDisk: {
keySource: "Microsoft.Keyvault",
keyVaultProperties: {
keyName: "test-cmk-key",
keyVaultUri: "https://test-vault-name.vault.azure.net/",
keyVersion: "00000000000000000000000000000000",
},
rotationToLatestKeyVersionEnabled: true,
},
},
},
location: "westus",
managedResourceGroupId: "/subscriptions/subid/resourceGroups/myManagedRG",
};
const credential = new DefaultAzureCredential();
const client = new AzureDatabricksManagementClient(credential, subscriptionId);
const result = await client.workspaces.beginCreateOrUpdateAndWait(
resourceGroupName,
workspaceName,
parameters
);
console.log(result);
}
To use the Azure SDK library in your project, see this documentation. To provide feedback on this code sample, open a GitHub issue
Sample Response
{
"id": "/subscriptions/subid/resourceGroups/rg/providers/Microsoft.Databricks/workspaces/myWorkspace",
"type": "Microsoft.Databricks/workspaces",
"location": "East US 2",
"tags": null,
"sku": {
"name": "premium"
},
"properties": {
"managedResourceGroupId": "/subscriptions/subid/resourceGroups/myManagedRG",
"diskEncryptionSetId": "/subscriptions/subid/resourceGroups/myManagedRG/providers/Microsoft.Compute/diskEncryptionSets/myDiskEncryptionSet",
"encryption": {
"entities": {
"managedDisk": {
"keySource": "Microsoft.Keyvault",
"keyVaultProperties": {
"keyVaultUri": "https://test-vault-name.vault.azure.net/",
"keyName": "test-cmk-key",
"keyVersion": "00000000000000000000000000000000"
},
"rotationToLatestKeyVersionEnabled": true
}
}
},
"parameters": null,
"provisioningState": "Accepted",
"uiDefinitionUri": "https://path/to/workspaceCreateUiDefinition.json",
"authorizations": [
{
"principalId": "00000000-0000-0000-0000-000000000000",
"roleDefinitionId": "11111111-1111-1111-1111-111111111111"
}
],
"createdBy": {
"oid": "22222222-2222-2222-2222-222222222222",
"puid": "33333333",
"applicationId": "44444444-4444-4444-4444-444444444444"
},
"updatedBy": {
"oid": "22222222-2222-2222-2222-222222222222",
"puid": "33333333",
"applicationId": "44444444-4444-4444-4444-444444444444"
},
"managedDiskIdentity": {
"principalId": "22222222-2222-2222-2222-222222222222",
"tenantId": "44444444-4444-4444-4444-444444444444",
"type": "SystemAssigned"
},
"createdDateTime": "2020-02-20T00:10:29.2858439Z",
"workspaceId": "5555555555555555",
"workspaceUrl": "adb-5555555555555555.19.azuredatabricks.net"
}
}
{
"name": "myWorkspace",
"id": "/subscriptions/subid/resourceGroups/rg/providers/Microsoft.Databricks/workspaces/myWorkspace",
"type": "Microsoft.Databricks/workspaces",
"location": "East US 2",
"tags": {
"environment": "dev"
},
"sku": {
"name": "premium"
},
"properties": {
"managedResourceGroupId": "/subscriptions/subid/resourceGroups/myManagedRG",
"diskEncryptionSetId": "/subscriptions/subid/resourceGroups/myManagedRG/providers/Microsoft.Compute/diskEncryptionSets/myDiskEncryptionSet",
"encryption": {
"entities": {
"managedDisk": {
"keySource": "Microsoft.Keyvault",
"keyVaultProperties": {
"keyVaultUri": "https://test-vault-name.vault.azure.net/",
"keyName": "test-cmk-key",
"keyVersion": "00000000000000000000000000000000"
},
"rotationToLatestKeyVersionEnabled": true
}
}
},
"parameters": null,
"provisioningState": "Accepted",
"uiDefinitionUri": "https://path/to/workspaceCreateUiDefinition.json",
"authorizations": [
{
"principalId": "00000000-0000-0000-0000-000000000000",
"roleDefinitionId": "11111111-1111-1111-1111-111111111111"
}
],
"createdBy": {
"oid": "22222222-2222-2222-2222-222222222222",
"puid": "33333333",
"applicationId": "44444444-4444-4444-4444-444444444444"
},
"updatedBy": {
"oid": "22222222-2222-2222-2222-222222222222",
"puid": "33333333",
"applicationId": "44444444-4444-4444-4444-444444444444"
},
"managedDiskIdentity": {
"principalId": "22222222-2222-2222-2222-222222222222",
"tenantId": "44444444-4444-4444-4444-444444444444",
"type": "SystemAssigned"
},
"createdDateTime": "2020-02-20T00:10:29.2858439Z"
}
}
Create or update workspace
Sample Request
PUT https://management.azure.com/subscriptions/subid/resourceGroups/rg/providers/Microsoft.Databricks/workspaces/myWorkspace?api-version=2023-02-01
{
"properties": {
"managedResourceGroupId": "/subscriptions/subid/resourceGroups/myManagedRG"
},
"location": "westus"
}
import java.util.HashMap;
import java.util.Map;
/** Samples for Workspaces CreateOrUpdate. */
public final class Main {
/*
* x-ms-original-file: specification/databricks/resource-manager/Microsoft.Databricks/stable/2023-02-01/examples/WorkspaceCreate.json
*/
/**
* Sample code: Create or update workspace.
*
* @param manager Entry point to AzureDatabricksManager.
*/
public static void createOrUpdateWorkspace(com.azure.resourcemanager.databricks.AzureDatabricksManager manager) {
manager
.workspaces()
.define("myWorkspace")
.withRegion("westus")
.withExistingResourceGroup("rg")
.withManagedResourceGroupId("/subscriptions/subid/resourceGroups/myManagedRG")
.create();
}
@SuppressWarnings("unchecked")
private static <T> Map<String, T> mapOf(Object... inputs) {
Map<String, T> map = new HashMap<>();
for (int i = 0; i < inputs.length; i += 2) {
String key = (String) inputs[i];
T value = (T) inputs[i + 1];
map.put(key, value);
}
return map;
}
}
To use the Azure SDK library in your project, see this documentation. To provide feedback on this code sample, open a GitHub issue
from azure.identity import DefaultAzureCredential
from azure.mgmt.databricks import AzureDatabricksManagementClient
"""
# PREREQUISITES
pip install azure-identity
pip install azure-mgmt-databricks
# USAGE
python workspace_create.py
Before run the sample, please set the values of the client ID, tenant ID and client secret
of the AAD application as environment variables: AZURE_CLIENT_ID, AZURE_TENANT_ID,
AZURE_CLIENT_SECRET. For more info about how to get the value, please see:
https://docs.microsoft.com/azure/active-directory/develop/howto-create-service-principal-portal
"""
def main():
client = AzureDatabricksManagementClient(
credential=DefaultAzureCredential(),
subscription_id="subid",
)
response = client.workspaces.begin_create_or_update(
resource_group_name="rg",
workspace_name="myWorkspace",
parameters={
"location": "westus",
"properties": {"managedResourceGroupId": "/subscriptions/subid/resourceGroups/myManagedRG"},
},
).result()
print(response)
# x-ms-original-file: specification/databricks/resource-manager/Microsoft.Databricks/stable/2023-02-01/examples/WorkspaceCreate.json
if __name__ == "__main__":
main()
To use the Azure SDK library in your project, see this documentation. To provide feedback on this code sample, open a GitHub issue
package armdatabricks_test
import (
"context"
"log"
"github.com/Azure/azure-sdk-for-go/sdk/azcore/to"
"github.com/Azure/azure-sdk-for-go/sdk/azidentity"
"github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/databricks/armdatabricks"
)
// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/e1a87e1a5deb3f986ea1474d233d6680f1e19fc1/specification/databricks/resource-manager/Microsoft.Databricks/stable/2023-02-01/examples/WorkspaceCreate.json
func ExampleWorkspacesClient_BeginCreateOrUpdate_createOrUpdateWorkspace() {
cred, err := azidentity.NewDefaultAzureCredential(nil)
if err != nil {
log.Fatalf("failed to obtain a credential: %v", err)
}
ctx := context.Background()
clientFactory, err := armdatabricks.NewClientFactory("<subscription-id>", cred, nil)
if err != nil {
log.Fatalf("failed to create client: %v", err)
}
poller, err := clientFactory.NewWorkspacesClient().BeginCreateOrUpdate(ctx, "rg", "myWorkspace", armdatabricks.Workspace{
Location: to.Ptr("westus"),
Properties: &armdatabricks.WorkspaceProperties{
ManagedResourceGroupID: to.Ptr("/subscriptions/subid/resourceGroups/myManagedRG"),
},
}, nil)
if err != nil {
log.Fatalf("failed to finish the request: %v", err)
}
res, err := poller.PollUntilDone(ctx, nil)
if err != nil {
log.Fatalf("failed to pull the result: %v", err)
}
// You could use response here. We use blank identifier for just demo purposes.
_ = res
// If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes.
// res.Workspace = armdatabricks.Workspace{
// Type: to.Ptr("Microsoft.Databricks/workspaces"),
// ID: to.Ptr("/subscriptions/subid/resourceGroups/rg/providers/Microsoft.Databricks/workspaces/myWorkspace"),
// Location: to.Ptr("East US 2"),
// Properties: &armdatabricks.WorkspaceProperties{
// Authorizations: []*armdatabricks.WorkspaceProviderAuthorization{
// {
// PrincipalID: to.Ptr("00000000-0000-0000-0000-000000000000"),
// RoleDefinitionID: to.Ptr("11111111-1111-1111-1111-111111111111"),
// }},
// CreatedBy: &armdatabricks.CreatedBy{
// ApplicationID: to.Ptr("44444444-4444-4444-4444-444444444444"),
// Oid: to.Ptr("22222222-2222-2222-2222-222222222222"),
// Puid: to.Ptr("33333333"),
// },
// CreatedDateTime: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2020-02-20T00:10:29.285Z"); return t}()),
// ManagedResourceGroupID: to.Ptr("/subscriptions/subid/resourceGroups/myManagedRG"),
// ProvisioningState: to.Ptr(armdatabricks.ProvisioningStateSucceeded),
// UIDefinitionURI: to.Ptr("https://path/to/workspaceCreateUiDefinition.json"),
// UpdatedBy: &armdatabricks.CreatedBy{
// ApplicationID: to.Ptr("44444444-4444-4444-4444-444444444444"),
// Oid: to.Ptr("22222222-2222-2222-2222-222222222222"),
// Puid: to.Ptr("33333333"),
// },
// WorkspaceID: to.Ptr("5555555555555555"),
// WorkspaceURL: to.Ptr("adb-5555555555555555.19.azuredatabricks.net"),
// },
// SKU: &armdatabricks.SKU{
// Name: to.Ptr("premium"),
// },
// }
}
To use the Azure SDK library in your project, see this documentation. To provide feedback on this code sample, open a GitHub issue
const { AzureDatabricksManagementClient } = require("@azure/arm-databricks");
const { DefaultAzureCredential } = require("@azure/identity");
/**
* This sample demonstrates how to Creates a new workspace.
*
* @summary Creates a new workspace.
* x-ms-original-file: specification/databricks/resource-manager/Microsoft.Databricks/stable/2023-02-01/examples/WorkspaceCreate.json
*/
async function createOrUpdateWorkspace() {
const subscriptionId = process.env["DATABRICKS_SUBSCRIPTION_ID"] || "subid";
const resourceGroupName = process.env["DATABRICKS_RESOURCE_GROUP"] || "rg";
const workspaceName = "myWorkspace";
const parameters = {
location: "westus",
managedResourceGroupId: "/subscriptions/subid/resourceGroups/myManagedRG",
};
const credential = new DefaultAzureCredential();
const client = new AzureDatabricksManagementClient(credential, subscriptionId);
const result = await client.workspaces.beginCreateOrUpdateAndWait(
resourceGroupName,
workspaceName,
parameters
);
console.log(result);
}
To use the Azure SDK library in your project, see this documentation. To provide feedback on this code sample, open a GitHub issue
Sample Response
{
"id": "/subscriptions/subid/resourceGroups/rg/providers/Microsoft.Databricks/workspaces/myWorkspace",
"type": "Microsoft.Databricks/workspaces",
"location": "East US 2",
"tags": null,
"sku": {
"name": "premium"
},
"properties": {
"managedResourceGroupId": "/subscriptions/subid/resourceGroups/myManagedRG",
"parameters": null,
"provisioningState": "Accepted",
"uiDefinitionUri": "https://path/to/workspaceCreateUiDefinition.json",
"authorizations": [
{
"principalId": "00000000-0000-0000-0000-000000000000",
"roleDefinitionId": "11111111-1111-1111-1111-111111111111"
}
],
"createdBy": {
"oid": "22222222-2222-2222-2222-222222222222",
"puid": "33333333",
"applicationId": "44444444-4444-4444-4444-444444444444"
},
"updatedBy": {
"oid": "22222222-2222-2222-2222-222222222222",
"puid": "33333333",
"applicationId": "44444444-4444-4444-4444-444444444444"
},
"createdDateTime": "2020-02-20T00:10:29.2858439Z",
"workspaceId": "5555555555555555",
"workspaceUrl": "adb-5555555555555555.19.azuredatabricks.net"
}
}
{
"name": "myWorkspace",
"id": "/subscriptions/subid/resourceGroups/rg/providers/Microsoft.Databricks/workspaces/myWorkspace",
"type": "Microsoft.Databricks/workspaces",
"location": "East US 2",
"tags": {
"environment": "dev"
},
"sku": {
"name": "premium"
},
"properties": {
"managedResourceGroupId": "/subscriptions/subid/resourceGroups/myManagedRG",
"parameters": null,
"provisioningState": "Accepted",
"uiDefinitionUri": "https://path/to/workspaceCreateUiDefinition.json",
"authorizations": [
{
"principalId": "00000000-0000-0000-0000-000000000000",
"roleDefinitionId": "11111111-1111-1111-1111-111111111111"
}
],
"createdBy": {
"oid": "22222222-2222-2222-2222-222222222222",
"puid": "33333333",
"applicationId": "44444444-4444-4444-4444-444444444444"
},
"updatedBy": {
"oid": "22222222-2222-2222-2222-222222222222",
"puid": "33333333",
"applicationId": "44444444-4444-4444-4444-444444444444"
},
"createdDateTime": "2020-02-20T00:10:29.2858439Z"
}
}
Create or update workspace with custom parameters
Sample Request
PUT https://management.azure.com/subscriptions/subid/resourceGroups/rg/providers/Microsoft.Databricks/workspaces/myWorkspace?api-version=2023-02-01
{
"properties": {
"managedResourceGroupId": "/subscriptions/subid/resourceGroups/myManagedRG",
"parameters": {
"customVirtualNetworkId": {
"value": "/subscriptions/subid/resourceGroups/rg/providers/Microsoft.Network/virtualNetworks/myNetwork"
},
"customPublicSubnetName": {
"value": "myPublicSubnet"
},
"customPrivateSubnetName": {
"value": "myPrivateSubnet"
}
}
},
"location": "westus"
}
import com.azure.resourcemanager.databricks.models.WorkspaceCustomParameters;
import com.azure.resourcemanager.databricks.models.WorkspaceCustomStringParameter;
import java.util.HashMap;
import java.util.Map;
/** Samples for Workspaces CreateOrUpdate. */
public final class Main {
/*
* x-ms-original-file: specification/databricks/resource-manager/Microsoft.Databricks/stable/2023-02-01/examples/WorkspaceCreateWithParameters.json
*/
/**
* Sample code: Create or update workspace with custom parameters.
*
* @param manager Entry point to AzureDatabricksManager.
*/
public static void createOrUpdateWorkspaceWithCustomParameters(
com.azure.resourcemanager.databricks.AzureDatabricksManager manager) {
manager
.workspaces()
.define("myWorkspace")
.withRegion("westus")
.withExistingResourceGroup("rg")
.withManagedResourceGroupId("/subscriptions/subid/resourceGroups/myManagedRG")
.withParameters(
new WorkspaceCustomParameters()
.withCustomVirtualNetworkId(
new WorkspaceCustomStringParameter()
.withValue(
"/subscriptions/subid/resourceGroups/rg/providers/Microsoft.Network/virtualNetworks/myNetwork"))
.withCustomPublicSubnetName(new WorkspaceCustomStringParameter().withValue("myPublicSubnet"))
.withCustomPrivateSubnetName(new WorkspaceCustomStringParameter().withValue("myPrivateSubnet")))
.create();
}
@SuppressWarnings("unchecked")
private static <T> Map<String, T> mapOf(Object... inputs) {
Map<String, T> map = new HashMap<>();
for (int i = 0; i < inputs.length; i += 2) {
String key = (String) inputs[i];
T value = (T) inputs[i + 1];
map.put(key, value);
}
return map;
}
}
To use the Azure SDK library in your project, see this documentation. To provide feedback on this code sample, open a GitHub issue
from azure.identity import DefaultAzureCredential
from azure.mgmt.databricks import AzureDatabricksManagementClient
"""
# PREREQUISITES
pip install azure-identity
pip install azure-mgmt-databricks
# USAGE
python workspace_create_with_parameters.py
Before run the sample, please set the values of the client ID, tenant ID and client secret
of the AAD application as environment variables: AZURE_CLIENT_ID, AZURE_TENANT_ID,
AZURE_CLIENT_SECRET. For more info about how to get the value, please see:
https://docs.microsoft.com/azure/active-directory/develop/howto-create-service-principal-portal
"""
def main():
client = AzureDatabricksManagementClient(
credential=DefaultAzureCredential(),
subscription_id="subid",
)
response = client.workspaces.begin_create_or_update(
resource_group_name="rg",
workspace_name="myWorkspace",
parameters={
"location": "westus",
"properties": {
"managedResourceGroupId": "/subscriptions/subid/resourceGroups/myManagedRG",
"parameters": {
"customPrivateSubnetName": {"value": "myPrivateSubnet"},
"customPublicSubnetName": {"value": "myPublicSubnet"},
"customVirtualNetworkId": {
"value": "/subscriptions/subid/resourceGroups/rg/providers/Microsoft.Network/virtualNetworks/myNetwork"
},
},
},
},
).result()
print(response)
# x-ms-original-file: specification/databricks/resource-manager/Microsoft.Databricks/stable/2023-02-01/examples/WorkspaceCreateWithParameters.json
if __name__ == "__main__":
main()
To use the Azure SDK library in your project, see this documentation. To provide feedback on this code sample, open a GitHub issue
package armdatabricks_test
import (
"context"
"log"
"github.com/Azure/azure-sdk-for-go/sdk/azcore/to"
"github.com/Azure/azure-sdk-for-go/sdk/azidentity"
"github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/databricks/armdatabricks"
)
// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/e1a87e1a5deb3f986ea1474d233d6680f1e19fc1/specification/databricks/resource-manager/Microsoft.Databricks/stable/2023-02-01/examples/WorkspaceCreateWithParameters.json
func ExampleWorkspacesClient_BeginCreateOrUpdate_createOrUpdateWorkspaceWithCustomParameters() {
cred, err := azidentity.NewDefaultAzureCredential(nil)
if err != nil {
log.Fatalf("failed to obtain a credential: %v", err)
}
ctx := context.Background()
clientFactory, err := armdatabricks.NewClientFactory("<subscription-id>", cred, nil)
if err != nil {
log.Fatalf("failed to create client: %v", err)
}
poller, err := clientFactory.NewWorkspacesClient().BeginCreateOrUpdate(ctx, "rg", "myWorkspace", armdatabricks.Workspace{
Location: to.Ptr("westus"),
Properties: &armdatabricks.WorkspaceProperties{
ManagedResourceGroupID: to.Ptr("/subscriptions/subid/resourceGroups/myManagedRG"),
Parameters: &armdatabricks.WorkspaceCustomParameters{
CustomPrivateSubnetName: &armdatabricks.WorkspaceCustomStringParameter{
Value: to.Ptr("myPrivateSubnet"),
},
CustomPublicSubnetName: &armdatabricks.WorkspaceCustomStringParameter{
Value: to.Ptr("myPublicSubnet"),
},
CustomVirtualNetworkID: &armdatabricks.WorkspaceCustomStringParameter{
Value: to.Ptr("/subscriptions/subid/resourceGroups/rg/providers/Microsoft.Network/virtualNetworks/myNetwork"),
},
},
},
}, nil)
if err != nil {
log.Fatalf("failed to finish the request: %v", err)
}
res, err := poller.PollUntilDone(ctx, nil)
if err != nil {
log.Fatalf("failed to pull the result: %v", err)
}
// You could use response here. We use blank identifier for just demo purposes.
_ = res
// If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes.
// res.Workspace = armdatabricks.Workspace{
// Type: to.Ptr("Microsoft.Databricks/workspaces"),
// ID: to.Ptr("/subscriptions/subid/resourceGroups/rg/providers/Microsoft.Databricks/workspaces/myWorkspace"),
// Location: to.Ptr("East US 2"),
// Properties: &armdatabricks.WorkspaceProperties{
// Authorizations: []*armdatabricks.WorkspaceProviderAuthorization{
// {
// PrincipalID: to.Ptr("00000000-0000-0000-0000-000000000000"),
// RoleDefinitionID: to.Ptr("11111111-1111-1111-1111-111111111111"),
// }},
// CreatedBy: &armdatabricks.CreatedBy{
// ApplicationID: to.Ptr("44444444-4444-4444-4444-444444444444"),
// Oid: to.Ptr("22222222-2222-2222-2222-222222222222"),
// Puid: to.Ptr("33333333"),
// },
// CreatedDateTime: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2020-02-20T00:10:29.285Z"); return t}()),
// ManagedResourceGroupID: to.Ptr("/subscriptions/subid/resourceGroups/myManagedRG"),
// Parameters: &armdatabricks.WorkspaceCustomParameters{
// CustomPrivateSubnetName: &armdatabricks.WorkspaceCustomStringParameter{
// Type: to.Ptr(armdatabricks.CustomParameterTypeString),
// Value: to.Ptr("myPrivateSubnet"),
// },
// CustomPublicSubnetName: &armdatabricks.WorkspaceCustomStringParameter{
// Type: to.Ptr(armdatabricks.CustomParameterTypeString),
// Value: to.Ptr("myPublicSubnet"),
// },
// CustomVirtualNetworkID: &armdatabricks.WorkspaceCustomStringParameter{
// Type: to.Ptr(armdatabricks.CustomParameterTypeString),
// Value: to.Ptr("/subscriptions/subid/resourceGroups/rg/providers/Microsoft.Network/virtualNetworks/myNetwork"),
// },
// },
// ProvisioningState: to.Ptr(armdatabricks.ProvisioningStateSucceeded),
// UIDefinitionURI: to.Ptr("https://path/to/workspaceCreateUiDefinition.json"),
// UpdatedBy: &armdatabricks.CreatedBy{
// ApplicationID: to.Ptr("44444444-4444-4444-4444-444444444444"),
// Oid: to.Ptr("22222222-2222-2222-2222-222222222222"),
// Puid: to.Ptr("33333333"),
// },
// WorkspaceID: to.Ptr("5555555555555555"),
// WorkspaceURL: to.Ptr("adb-5555555555555555.19.azuredatabricks.net"),
// },
// SKU: &armdatabricks.SKU{
// Name: to.Ptr("premium"),
// },
// }
}
To use the Azure SDK library in your project, see this documentation. To provide feedback on this code sample, open a GitHub issue
const { AzureDatabricksManagementClient } = require("@azure/arm-databricks");
const { DefaultAzureCredential } = require("@azure/identity");
/**
* This sample demonstrates how to Creates a new workspace.
*
* @summary Creates a new workspace.
* x-ms-original-file: specification/databricks/resource-manager/Microsoft.Databricks/stable/2023-02-01/examples/WorkspaceCreateWithParameters.json
*/
async function createOrUpdateWorkspaceWithCustomParameters() {
const subscriptionId = process.env["DATABRICKS_SUBSCRIPTION_ID"] || "subid";
const resourceGroupName = process.env["DATABRICKS_RESOURCE_GROUP"] || "rg";
const workspaceName = "myWorkspace";
const parameters = {
location: "westus",
managedResourceGroupId: "/subscriptions/subid/resourceGroups/myManagedRG",
parameters: {
customPrivateSubnetName: { value: "myPrivateSubnet" },
customPublicSubnetName: { value: "myPublicSubnet" },
customVirtualNetworkId: {
value:
"/subscriptions/subid/resourceGroups/rg/providers/Microsoft.Network/virtualNetworks/myNetwork",
},
},
};
const credential = new DefaultAzureCredential();
const client = new AzureDatabricksManagementClient(credential, subscriptionId);
const result = await client.workspaces.beginCreateOrUpdateAndWait(
resourceGroupName,
workspaceName,
parameters
);
console.log(result);
}
To use the Azure SDK library in your project, see this documentation. To provide feedback on this code sample, open a GitHub issue
Sample Response
{
"id": "/subscriptions/subid/resourceGroups/rg/providers/Microsoft.Databricks/workspaces/myWorkspace",
"type": "Microsoft.Databricks/workspaces",
"location": "East US 2",
"tags": null,
"sku": {
"name": "premium"
},
"properties": {
"managedResourceGroupId": "/subscriptions/subid/resourceGroups/myManagedRG",
"parameters": {
"customPrivateSubnetName": {
"type": "String",
"value": "myPrivateSubnet"
},
"customPublicSubnetName": {
"type": "String",
"value": "myPublicSubnet"
},
"customVirtualNetworkId": {
"type": "String",
"value": "/subscriptions/subid/resourceGroups/rg/providers/Microsoft.Network/virtualNetworks/myNetwork"
}
},
"provisioningState": "Succeeded",
"uiDefinitionUri": "https://path/to/workspaceCreateUiDefinition.json",
"authorizations": [
{
"principalId": "00000000-0000-0000-0000-000000000000",
"roleDefinitionId": "11111111-1111-1111-1111-111111111111"
}
],
"createdBy": {
"oid": "22222222-2222-2222-2222-222222222222",
"puid": "33333333",
"applicationId": "44444444-4444-4444-4444-444444444444"
},
"updatedBy": {
"oid": "22222222-2222-2222-2222-222222222222",
"puid": "33333333",
"applicationId": "44444444-4444-4444-4444-444444444444"
},
"createdDateTime": "2020-02-20T00:10:29.2858439Z",
"workspaceId": "5555555555555555",
"workspaceUrl": "adb-5555555555555555.19.azuredatabricks.net"
}
}
{
"name": "myWorkspace",
"id": "/subscriptions/subid/resourceGroups/rg/providers/Microsoft.Databricks/workspaces/myWorkspace",
"type": "Microsoft.Databricks/workspaces",
"location": "East US 2",
"tags": {
"environment": "dev"
},
"sku": {
"name": "premium"
},
"properties": {
"managedResourceGroupId": "/subscriptions/subid/resourceGroups/myManagedRG",
"provisioningState": "Accepted",
"uiDefinitionUri": "https://path/to/workspaceCreateUiDefinition.json",
"authorizations": [
{
"principalId": "00000000-0000-0000-0000-000000000000",
"roleDefinitionId": "11111111-1111-1111-1111-111111111111"
}
],
"createdBy": {
"oid": "22222222-2222-2222-2222-222222222222",
"puid": "33333333",
"applicationId": "44444444-4444-4444-4444-444444444444"
},
"updatedBy": {
"oid": "22222222-2222-2222-2222-222222222222",
"puid": "33333333",
"applicationId": "44444444-4444-4444-4444-444444444444"
},
"createdDateTime": "2020-02-20T00:10:29.2858439Z"
}
}
Enable Customer-Managed Key (CMK) encryption on a workspace which is prepared for encryption
Sample Request
PUT https://management.azure.com/subscriptions/subid/resourceGroups/rg/providers/Microsoft.Databricks/workspaces/myWorkspace?api-version=2023-02-01
{
"properties": {
"managedResourceGroupId": "/subscriptions/subid/resourceGroups/myManagedRG",
"parameters": {
"prepareEncryption": {
"value": true
},
"encryption": {
"value": {
"keySource": "Microsoft.Keyvault",
"keyvaulturi": "https://myKeyVault.vault.azure.net/",
"KeyName": "myKeyName",
"keyversion": "00000000000000000000000000000000"
}
}
}
},
"location": "westus"
}
import com.azure.resourcemanager.databricks.models.Encryption;
import com.azure.resourcemanager.databricks.models.KeySource;
import com.azure.resourcemanager.databricks.models.WorkspaceCustomBooleanParameter;
import com.azure.resourcemanager.databricks.models.WorkspaceCustomParameters;
import com.azure.resourcemanager.databricks.models.WorkspaceEncryptionParameter;
import java.util.HashMap;
import java.util.Map;
/** Samples for Workspaces CreateOrUpdate. */
public final class Main {
/*
* x-ms-original-file: specification/databricks/resource-manager/Microsoft.Databricks/stable/2023-02-01/examples/EnableEncryption.json
*/
/**
* Sample code: Enable Customer-Managed Key (CMK) encryption on a workspace which is prepared for encryption.
*
* @param manager Entry point to AzureDatabricksManager.
*/
public static void enableCustomerManagedKeyCMKEncryptionOnAWorkspaceWhichIsPreparedForEncryption(
com.azure.resourcemanager.databricks.AzureDatabricksManager manager) {
manager
.workspaces()
.define("myWorkspace")
.withRegion("westus")
.withExistingResourceGroup("rg")
.withManagedResourceGroupId("/subscriptions/subid/resourceGroups/myManagedRG")
.withParameters(
new WorkspaceCustomParameters()
.withPrepareEncryption(new WorkspaceCustomBooleanParameter().withValue(true))
.withEncryption(
new WorkspaceEncryptionParameter()
.withValue(
new Encryption()
.withKeySource(KeySource.MICROSOFT_KEYVAULT)
.withKeyName("fakeTokenPlaceholder")
.withKeyVersion("fakeTokenPlaceholder")
.withKeyVaultUri("fakeTokenPlaceholder"))))
.create();
}
@SuppressWarnings("unchecked")
private static <T> Map<String, T> mapOf(Object... inputs) {
Map<String, T> map = new HashMap<>();
for (int i = 0; i < inputs.length; i += 2) {
String key = (String) inputs[i];
T value = (T) inputs[i + 1];
map.put(key, value);
}
return map;
}
}
To use the Azure SDK library in your project, see this documentation. To provide feedback on this code sample, open a GitHub issue
from azure.identity import DefaultAzureCredential
from azure.mgmt.databricks import AzureDatabricksManagementClient
"""
# PREREQUISITES
pip install azure-identity
pip install azure-mgmt-databricks
# USAGE
python enable_encryption.py
Before run the sample, please set the values of the client ID, tenant ID and client secret
of the AAD application as environment variables: AZURE_CLIENT_ID, AZURE_TENANT_ID,
AZURE_CLIENT_SECRET. For more info about how to get the value, please see:
https://docs.microsoft.com/azure/active-directory/develop/howto-create-service-principal-portal
"""
def main():
client = AzureDatabricksManagementClient(
credential=DefaultAzureCredential(),
subscription_id="subid",
)
response = client.workspaces.begin_create_or_update(
resource_group_name="rg",
workspace_name="myWorkspace",
parameters={
"location": "westus",
"properties": {
"managedResourceGroupId": "/subscriptions/subid/resourceGroups/myManagedRG",
"parameters": {
"encryption": {
"value": {
"KeyName": "myKeyName",
"keySource": "Microsoft.Keyvault",
"keyvaulturi": "https://myKeyVault.vault.azure.net/",
"keyversion": "00000000000000000000000000000000",
}
},
"prepareEncryption": {"value": True},
},
},
},
).result()
print(response)
# x-ms-original-file: specification/databricks/resource-manager/Microsoft.Databricks/stable/2023-02-01/examples/EnableEncryption.json
if __name__ == "__main__":
main()
To use the Azure SDK library in your project, see this documentation. To provide feedback on this code sample, open a GitHub issue
package armdatabricks_test
import (
"context"
"log"
"github.com/Azure/azure-sdk-for-go/sdk/azcore/to"
"github.com/Azure/azure-sdk-for-go/sdk/azidentity"
"github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/databricks/armdatabricks"
)
// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/e1a87e1a5deb3f986ea1474d233d6680f1e19fc1/specification/databricks/resource-manager/Microsoft.Databricks/stable/2023-02-01/examples/EnableEncryption.json
func ExampleWorkspacesClient_BeginCreateOrUpdate_enableCustomerManagedKeyCmkEncryptionOnAWorkspaceWhichIsPreparedForEncryption() {
cred, err := azidentity.NewDefaultAzureCredential(nil)
if err != nil {
log.Fatalf("failed to obtain a credential: %v", err)
}
ctx := context.Background()
clientFactory, err := armdatabricks.NewClientFactory("<subscription-id>", cred, nil)
if err != nil {
log.Fatalf("failed to create client: %v", err)
}
poller, err := clientFactory.NewWorkspacesClient().BeginCreateOrUpdate(ctx, "rg", "myWorkspace", armdatabricks.Workspace{
Location: to.Ptr("westus"),
Properties: &armdatabricks.WorkspaceProperties{
ManagedResourceGroupID: to.Ptr("/subscriptions/subid/resourceGroups/myManagedRG"),
Parameters: &armdatabricks.WorkspaceCustomParameters{
Encryption: &armdatabricks.WorkspaceEncryptionParameter{
Value: &armdatabricks.Encryption{
KeyName: to.Ptr("myKeyName"),
KeySource: to.Ptr(armdatabricks.KeySourceMicrosoftKeyvault),
KeyVaultURI: to.Ptr("https://myKeyVault.vault.azure.net/"),
KeyVersion: to.Ptr("00000000000000000000000000000000"),
},
},
PrepareEncryption: &armdatabricks.WorkspaceCustomBooleanParameter{
Value: to.Ptr(true),
},
},
},
}, nil)
if err != nil {
log.Fatalf("failed to finish the request: %v", err)
}
res, err := poller.PollUntilDone(ctx, nil)
if err != nil {
log.Fatalf("failed to pull the result: %v", err)
}
// You could use response here. We use blank identifier for just demo purposes.
_ = res
// If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes.
// res.Workspace = armdatabricks.Workspace{
// Name: to.Ptr("myWorkspace"),
// Type: to.Ptr("Microsoft.Databricks/workspaces"),
// ID: to.Ptr("/subscriptions/subid/resourceGroups/rg/providers/Microsoft.Databricks/workspaces/myWorkspace"),
// Location: to.Ptr("East US 2"),
// Properties: &armdatabricks.WorkspaceProperties{
// Authorizations: []*armdatabricks.WorkspaceProviderAuthorization{
// {
// PrincipalID: to.Ptr("00000000-0000-0000-0000-000000000000"),
// RoleDefinitionID: to.Ptr("11111111-1111-1111-1111-111111111111"),
// }},
// CreatedBy: &armdatabricks.CreatedBy{
// ApplicationID: to.Ptr("44444444-4444-4444-4444-444444444444"),
// Oid: to.Ptr("22222222-2222-2222-2222-222222222222"),
// Puid: to.Ptr("33333333"),
// },
// CreatedDateTime: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2020-02-20T00:10:29.285Z"); return t}()),
// ManagedResourceGroupID: to.Ptr("/subscriptions/subid/resourceGroups/myManagedRG"),
// Parameters: &armdatabricks.WorkspaceCustomParameters{
// CustomPrivateSubnetName: &armdatabricks.WorkspaceCustomStringParameter{
// Type: to.Ptr(armdatabricks.CustomParameterTypeString),
// Value: to.Ptr("PrivateBob"),
// },
// CustomPublicSubnetName: &armdatabricks.WorkspaceCustomStringParameter{
// Type: to.Ptr(armdatabricks.CustomParameterTypeString),
// Value: to.Ptr("PublicSarah"),
// },
// CustomVirtualNetworkID: &armdatabricks.WorkspaceCustomStringParameter{
// Type: to.Ptr(armdatabricks.CustomParameterTypeString),
// Value: to.Ptr("/subscriptions/subid/resourceGroups/rg/providers/Microsoft.Network/virtualNetworks/myNetwork"),
// },
// Encryption: &armdatabricks.WorkspaceEncryptionParameter{
// Type: to.Ptr(armdatabricks.CustomParameterTypeObject),
// Value: &armdatabricks.Encryption{
// KeyName: to.Ptr("myKeyName"),
// KeySource: to.Ptr(armdatabricks.KeySourceMicrosoftKeyvault),
// KeyVaultURI: to.Ptr("https://myKeyVault.vault.azure.net/"),
// KeyVersion: to.Ptr("00000000000000000000000000000000"),
// },
// },
// PrepareEncryption: &armdatabricks.WorkspaceCustomBooleanParameter{
// Type: to.Ptr(armdatabricks.CustomParameterTypeBool),
// Value: to.Ptr(true),
// },
// },
// ProvisioningState: to.Ptr(armdatabricks.ProvisioningStateSucceeded),
// StorageAccountIdentity: &armdatabricks.ManagedIdentityConfiguration{
// Type: to.Ptr("SystemAssigned"),
// PrincipalID: to.Ptr("55555555-5555-5555-5555-555555555555"),
// TenantID: to.Ptr("66666666-6666-6666-6666-666666666666"),
// },
// UIDefinitionURI: to.Ptr("https://path/to/workspaceCreateUiDefinition.json"),
// UpdatedBy: &armdatabricks.CreatedBy{
// ApplicationID: to.Ptr("44444444-4444-4444-4444-444444444444"),
// Oid: to.Ptr("22222222-2222-2222-2222-222222222222"),
// Puid: to.Ptr("33333333"),
// },
// WorkspaceID: to.Ptr("5555555555555555"),
// WorkspaceURL: to.Ptr("adb-5555555555555555.19.azuredatabricks.net"),
// },
// SKU: &armdatabricks.SKU{
// Name: to.Ptr("premium"),
// },
// }
}
To use the Azure SDK library in your project, see this documentation. To provide feedback on this code sample, open a GitHub issue
const { AzureDatabricksManagementClient } = require("@azure/arm-databricks");
const { DefaultAzureCredential } = require("@azure/identity");
/**
* This sample demonstrates how to Creates a new workspace.
*
* @summary Creates a new workspace.
* x-ms-original-file: specification/databricks/resource-manager/Microsoft.Databricks/stable/2023-02-01/examples/EnableEncryption.json
*/
async function enableCustomerManagedKeyCmkEncryptionOnAWorkspaceWhichIsPreparedForEncryption() {
const subscriptionId = process.env["DATABRICKS_SUBSCRIPTION_ID"] || "subid";
const resourceGroupName = process.env["DATABRICKS_RESOURCE_GROUP"] || "rg";
const workspaceName = "myWorkspace";
const parameters = {
location: "westus",
managedResourceGroupId: "/subscriptions/subid/resourceGroups/myManagedRG",
parameters: {
encryption: {
value: {
keyName: "myKeyName",
keySource: "Microsoft.Keyvault",
keyVaultUri: "https://myKeyVault.vault.azure.net/",
keyVersion: "00000000000000000000000000000000",
},
},
prepareEncryption: { value: true },
},
};
const credential = new DefaultAzureCredential();
const client = new AzureDatabricksManagementClient(credential, subscriptionId);
const result = await client.workspaces.beginCreateOrUpdateAndWait(
resourceGroupName,
workspaceName,
parameters
);
console.log(result);
}
To use the Azure SDK library in your project, see this documentation. To provide feedback on this code sample, open a GitHub issue
Sample Response
{
"name": "myWorkspace",
"id": "/subscriptions/subid/resourceGroups/rg/providers/Microsoft.Databricks/workspaces/myWorkspace",
"type": "Microsoft.Databricks/workspaces",
"sku": {
"name": "premium"
},
"location": "East US 2",
"properties": {
"managedResourceGroupId": "/subscriptions/subid/resourceGroups/myManagedRG",
"parameters": {
"customPrivateSubnetName": {
"type": "String",
"value": "PrivateBob"
},
"customPublicSubnetName": {
"type": "String",
"value": "PublicSarah"
},
"customVirtualNetworkId": {
"type": "String",
"value": "/subscriptions/subid/resourceGroups/rg/providers/Microsoft.Network/virtualNetworks/myNetwork"
},
"prepareEncryption": {
"type": "Bool",
"value": true
},
"encryption": {
"type": "Object",
"value": {
"keySource": "Microsoft.Keyvault",
"keyvaulturi": "https://myKeyVault.vault.azure.net/",
"KeyName": "myKeyName",
"keyversion": "00000000000000000000000000000000"
}
}
},
"provisioningState": "Succeeded",
"uiDefinitionUri": "https://path/to/workspaceCreateUiDefinition.json",
"authorizations": [
{
"principalId": "00000000-0000-0000-0000-000000000000",
"roleDefinitionId": "11111111-1111-1111-1111-111111111111"
}
],
"createdBy": {
"oid": "22222222-2222-2222-2222-222222222222",
"puid": "33333333",
"applicationId": "44444444-4444-4444-4444-444444444444"
},
"storageAccountIdentity": {
"principalId": "55555555-5555-5555-5555-555555555555",
"tenantId": "66666666-6666-6666-6666-666666666666",
"type": "SystemAssigned"
},
"updatedBy": {
"oid": "22222222-2222-2222-2222-222222222222",
"puid": "33333333",
"applicationId": "44444444-4444-4444-4444-444444444444"
},
"createdDateTime": "2020-02-20T00:10:29.2858439Z",
"workspaceId": "5555555555555555",
"workspaceUrl": "adb-5555555555555555.19.azuredatabricks.net"
}
}
{
"name": "myWorkspace",
"id": "/subscriptions/subid/resourceGroups/rg/providers/Microsoft.Databricks/workspaces/myWorkspace",
"type": "Microsoft.Databricks/workspaces",
"location": "East US 2",
"tags": {
"environment": "dev"
},
"sku": {
"name": "premium"
},
"properties": {
"managedResourceGroupId": "/subscriptions/subid/resourceGroups/myManagedRG",
"provisioningState": "Accepted",
"uiDefinitionUri": "https://path/to/workspaceCreateUiDefinition.json",
"authorizations": [
{
"principalId": "00000000-0000-0000-0000-000000000000",
"roleDefinitionId": "11111111-1111-1111-1111-111111111111"
}
],
"createdBy": {
"oid": "22222222-2222-2222-2222-222222222222",
"puid": "33333333",
"applicationId": "44444444-4444-4444-4444-444444444444"
},
"updatedBy": {
"oid": "22222222-2222-2222-2222-222222222222",
"puid": "33333333",
"applicationId": "44444444-4444-4444-4444-444444444444"
},
"createdDateTime": "2020-02-20T00:10:29.2858439Z",
"storageAccountIdentity": {
"principalId": "55555555-5555-5555-5555-555555555555",
"tenantId": "66666666-6666-6666-6666-666666666666",
"type": "SystemAssigned"
}
}
}
Revert Customer-Managed Key (CMK) encryption to Microsoft Managed Keys encryption on a workspace
Sample Request
PUT https://management.azure.com/subscriptions/subid/resourceGroups/rg/providers/Microsoft.Databricks/workspaces/myWorkspace?api-version=2023-02-01
{
"properties": {
"managedResourceGroupId": "/subscriptions/subid/resourceGroups/myManagedRG",
"parameters": {
"encryption": {
"value": {
"keySource": "Default"
}
}
}
},
"location": "westus"
}
import com.azure.resourcemanager.databricks.models.Encryption;
import com.azure.resourcemanager.databricks.models.KeySource;
import com.azure.resourcemanager.databricks.models.WorkspaceCustomParameters;
import com.azure.resourcemanager.databricks.models.WorkspaceEncryptionParameter;
import java.util.HashMap;
import java.util.Map;
/** Samples for Workspaces CreateOrUpdate. */
public final class Main {
/*
* x-ms-original-file: specification/databricks/resource-manager/Microsoft.Databricks/stable/2023-02-01/examples/DisableEncryption.json
*/
/**
* Sample code: Revert Customer-Managed Key (CMK) encryption to Microsoft Managed Keys encryption on a workspace.
*
* @param manager Entry point to AzureDatabricksManager.
*/
public static void revertCustomerManagedKeyCMKEncryptionToMicrosoftManagedKeysEncryptionOnAWorkspace(
com.azure.resourcemanager.databricks.AzureDatabricksManager manager) {
manager
.workspaces()
.define("myWorkspace")
.withRegion("westus")
.withExistingResourceGroup("rg")
.withManagedResourceGroupId("/subscriptions/subid/resourceGroups/myManagedRG")
.withParameters(
new WorkspaceCustomParameters()
.withEncryption(
new WorkspaceEncryptionParameter()
.withValue(new Encryption().withKeySource(KeySource.DEFAULT))))
.create();
}
@SuppressWarnings("unchecked")
private static <T> Map<String, T> mapOf(Object... inputs) {
Map<String, T> map = new HashMap<>();
for (int i = 0; i < inputs.length; i += 2) {
String key = (String) inputs[i];
T value = (T) inputs[i + 1];
map.put(key, value);
}
return map;
}
}
To use the Azure SDK library in your project, see this documentation. To provide feedback on this code sample, open a GitHub issue
from azure.identity import DefaultAzureCredential
from azure.mgmt.databricks import AzureDatabricksManagementClient
"""
# PREREQUISITES
pip install azure-identity
pip install azure-mgmt-databricks
# USAGE
python disable_encryption.py
Before run the sample, please set the values of the client ID, tenant ID and client secret
of the AAD application as environment variables: AZURE_CLIENT_ID, AZURE_TENANT_ID,
AZURE_CLIENT_SECRET. For more info about how to get the value, please see:
https://docs.microsoft.com/azure/active-directory/develop/howto-create-service-principal-portal
"""
def main():
client = AzureDatabricksManagementClient(
credential=DefaultAzureCredential(),
subscription_id="subid",
)
response = client.workspaces.begin_create_or_update(
resource_group_name="rg",
workspace_name="myWorkspace",
parameters={
"location": "westus",
"properties": {
"managedResourceGroupId": "/subscriptions/subid/resourceGroups/myManagedRG",
"parameters": {"encryption": {"value": {"keySource": "Default"}}},
},
},
).result()
print(response)
# x-ms-original-file: specification/databricks/resource-manager/Microsoft.Databricks/stable/2023-02-01/examples/DisableEncryption.json
if __name__ == "__main__":
main()
To use the Azure SDK library in your project, see this documentation. To provide feedback on this code sample, open a GitHub issue
package armdatabricks_test
import (
"context"
"log"
"github.com/Azure/azure-sdk-for-go/sdk/azcore/to"
"github.com/Azure/azure-sdk-for-go/sdk/azidentity"
"github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/databricks/armdatabricks"
)
// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/e1a87e1a5deb3f986ea1474d233d6680f1e19fc1/specification/databricks/resource-manager/Microsoft.Databricks/stable/2023-02-01/examples/DisableEncryption.json
func ExampleWorkspacesClient_BeginCreateOrUpdate_revertCustomerManagedKeyCmkEncryptionToMicrosoftManagedKeysEncryptionOnAWorkspace() {
cred, err := azidentity.NewDefaultAzureCredential(nil)
if err != nil {
log.Fatalf("failed to obtain a credential: %v", err)
}
ctx := context.Background()
clientFactory, err := armdatabricks.NewClientFactory("<subscription-id>", cred, nil)
if err != nil {
log.Fatalf("failed to create client: %v", err)
}
poller, err := clientFactory.NewWorkspacesClient().BeginCreateOrUpdate(ctx, "rg", "myWorkspace", armdatabricks.Workspace{
Location: to.Ptr("westus"),
Properties: &armdatabricks.WorkspaceProperties{
ManagedResourceGroupID: to.Ptr("/subscriptions/subid/resourceGroups/myManagedRG"),
Parameters: &armdatabricks.WorkspaceCustomParameters{
Encryption: &armdatabricks.WorkspaceEncryptionParameter{
Value: &armdatabricks.Encryption{
KeySource: to.Ptr(armdatabricks.KeySourceDefault),
},
},
},
},
}, nil)
if err != nil {
log.Fatalf("failed to finish the request: %v", err)
}
res, err := poller.PollUntilDone(ctx, nil)
if err != nil {
log.Fatalf("failed to pull the result: %v", err)
}
// You could use response here. We use blank identifier for just demo purposes.
_ = res
// If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes.
// res.Workspace = armdatabricks.Workspace{
// Name: to.Ptr("myWorkspace"),
// Type: to.Ptr("Microsoft.Databricks/workspaces"),
// ID: to.Ptr("/subscriptions/subid/resourceGroups/rg/providers/Microsoft.Databricks/workspaces/myWorkspace"),
// Location: to.Ptr("East US 2"),
// Properties: &armdatabricks.WorkspaceProperties{
// Authorizations: []*armdatabricks.WorkspaceProviderAuthorization{
// {
// PrincipalID: to.Ptr("00000000-0000-0000-0000-000000000000"),
// RoleDefinitionID: to.Ptr("11111111-1111-1111-1111-111111111111"),
// }},
// CreatedBy: &armdatabricks.CreatedBy{
// ApplicationID: to.Ptr("44444444-4444-4444-4444-444444444444"),
// Oid: to.Ptr("22222222-2222-2222-2222-222222222222"),
// Puid: to.Ptr("33333333"),
// },
// CreatedDateTime: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2020-02-20T00:10:29.285Z"); return t}()),
// ManagedResourceGroupID: to.Ptr("/subscriptions/subid/resourceGroups/myManagedRG"),
// Parameters: &armdatabricks.WorkspaceCustomParameters{
// CustomPrivateSubnetName: &armdatabricks.WorkspaceCustomStringParameter{
// Type: to.Ptr(armdatabricks.CustomParameterTypeString),
// Value: to.Ptr("PrivateBob"),
// },
// CustomPublicSubnetName: &armdatabricks.WorkspaceCustomStringParameter{
// Type: to.Ptr(armdatabricks.CustomParameterTypeString),
// Value: to.Ptr("PublicSarah"),
// },
// CustomVirtualNetworkID: &armdatabricks.WorkspaceCustomStringParameter{
// Type: to.Ptr(armdatabricks.CustomParameterTypeString),
// Value: to.Ptr("/subscriptions/subid/resourceGroups/rg/providers/Microsoft.Network/virtualNetworks/myNetwork"),
// },
// Encryption: &armdatabricks.WorkspaceEncryptionParameter{
// Type: to.Ptr(armdatabricks.CustomParameterTypeObject),
// Value: &armdatabricks.Encryption{
// KeySource: to.Ptr(armdatabricks.KeySourceDefault),
// },
// },
// PrepareEncryption: &armdatabricks.WorkspaceCustomBooleanParameter{
// Type: to.Ptr(armdatabricks.CustomParameterTypeBool),
// Value: to.Ptr(true),
// },
// },
// ProvisioningState: to.Ptr(armdatabricks.ProvisioningStateSucceeded),
// StorageAccountIdentity: &armdatabricks.ManagedIdentityConfiguration{
// Type: to.Ptr("SystemAssigned"),
// PrincipalID: to.Ptr("55555555-5555-5555-5555-555555555555"),
// TenantID: to.Ptr("66666666-6666-6666-6666-666666666666"),
// },
// UIDefinitionURI: to.Ptr("https://path/to/workspaceCreateUiDefinition.json"),
// UpdatedBy: &armdatabricks.CreatedBy{
// ApplicationID: to.Ptr("44444444-4444-4444-4444-444444444444"),
// Oid: to.Ptr("22222222-2222-2222-2222-222222222222"),
// Puid: to.Ptr("33333333"),
// },
// WorkspaceID: to.Ptr("5555555555555555"),
// WorkspaceURL: to.Ptr("adb-5555555555555555.19.azuredatabricks.net"),
// },
// SKU: &armdatabricks.SKU{
// Name: to.Ptr("premium"),
// },
// }
}
To use the Azure SDK library in your project, see this documentation. To provide feedback on this code sample, open a GitHub issue
const { AzureDatabricksManagementClient } = require("@azure/arm-databricks");
const { DefaultAzureCredential } = require("@azure/identity");
/**
* This sample demonstrates how to Creates a new workspace.
*
* @summary Creates a new workspace.
* x-ms-original-file: specification/databricks/resource-manager/Microsoft.Databricks/stable/2023-02-01/examples/DisableEncryption.json
*/
async function revertCustomerManagedKeyCmkEncryptionToMicrosoftManagedKeysEncryptionOnAWorkspace() {
const subscriptionId = process.env["DATABRICKS_SUBSCRIPTION_ID"] || "subid";
const resourceGroupName = process.env["DATABRICKS_RESOURCE_GROUP"] || "rg";
const workspaceName = "myWorkspace";
const parameters = {
location: "westus",
managedResourceGroupId: "/subscriptions/subid/resourceGroups/myManagedRG",
parameters: { encryption: { value: { keySource: "Default" } } },
};
const credential = new DefaultAzureCredential();
const client = new AzureDatabricksManagementClient(credential, subscriptionId);
const result = await client.workspaces.beginCreateOrUpdateAndWait(
resourceGroupName,
workspaceName,
parameters
);
console.log(result);
}
To use the Azure SDK library in your project, see this documentation. To provide feedback on this code sample, open a GitHub issue
Sample Response
{
"name": "myWorkspace",
"id": "/subscriptions/subid/resourceGroups/rg/providers/Microsoft.Databricks/workspaces/myWorkspace",
"type": "Microsoft.Databricks/workspaces",
"sku": {
"name": "premium"
},
"location": "East US 2",
"properties": {
"managedResourceGroupId": "/subscriptions/subid/resourceGroups/myManagedRG",
"parameters": {
"customPrivateSubnetName": {
"type": "String",
"value": "PrivateBob"
},
"customPublicSubnetName": {
"type": "String",
"value": "PublicSarah"
},
"customVirtualNetworkId": {
"type": "String",
"value": "/subscriptions/subid/resourceGroups/rg/providers/Microsoft.Network/virtualNetworks/myNetwork"
},
"prepareEncryption": {
"type": "Bool",
"value": true
},
"encryption": {
"type": "Object",
"value": {
"keySource": "Default"
}
}
},
"provisioningState": "Succeeded",
"uiDefinitionUri": "https://path/to/workspaceCreateUiDefinition.json",
"authorizations": [
{
"principalId": "00000000-0000-0000-0000-000000000000",
"roleDefinitionId": "11111111-1111-1111-1111-111111111111"
}
],
"createdBy": {
"oid": "22222222-2222-2222-2222-222222222222",
"puid": "33333333",
"applicationId": "44444444-4444-4444-4444-444444444444"
},
"storageAccountIdentity": {
"principalId": "55555555-5555-5555-5555-555555555555",
"tenantId": "66666666-6666-6666-6666-666666666666",
"type": "SystemAssigned"
},
"updatedBy": {
"oid": "22222222-2222-2222-2222-222222222222",
"puid": "33333333",
"applicationId": "44444444-4444-4444-4444-444444444444"
},
"createdDateTime": "2020-02-20T00:10:29.2858439Z",
"workspaceId": "5555555555555555",
"workspaceUrl": "adb-5555555555555555.19.azuredatabricks.net"
}
}
{
"name": "myWorkspace",
"id": "/subscriptions/subid/resourceGroups/rg/providers/Microsoft.Databricks/workspaces/myWorkspace",
"type": "Microsoft.Databricks/workspaces",
"location": "East US 2",
"tags": {
"environment": "dev"
},
"sku": {
"name": "premium"
},
"properties": {
"managedResourceGroupId": "/subscriptions/subid/resourceGroups/myManagedRG",
"provisioningState": "Accepted",
"uiDefinitionUri": "https://path/to/workspaceCreateUiDefinition.json",
"authorizations": [
{
"principalId": "00000000-0000-0000-0000-000000000000",
"roleDefinitionId": "11111111-1111-1111-1111-111111111111"
}
],
"createdBy": {
"oid": "22222222-2222-2222-2222-222222222222",
"puid": "33333333",
"applicationId": "44444444-4444-4444-4444-444444444444"
},
"updatedBy": {
"oid": "22222222-2222-2222-2222-222222222222",
"puid": "33333333",
"applicationId": "44444444-4444-4444-4444-444444444444"
},
"createdDateTime": "2020-02-20T00:10:29.2858439Z",
"storageAccountIdentity": {
"principalId": "55555555-5555-5555-5555-555555555555",
"tenantId": "66666666-6666-6666-6666-666666666666",
"type": "SystemAssigned"
}
}
}
Update a workspace with Customer-Managed Key (CMK) encryption for Managed Disks
Sample Request
PUT https://management.azure.com/subscriptions/subid/resourceGroups/rg/providers/Microsoft.Databricks/workspaces/myWorkspace?api-version=2023-02-01
{
"properties": {
"managedResourceGroupId": "/subscriptions/subid/resourceGroups/myManagedRG",
"encryption": {
"entities": {
"managedDisk": {
"keySource": "Microsoft.Keyvault",
"keyVaultProperties": {
"keyVaultUri": "https://test-vault-name.vault.azure.net/",
"keyName": "test-cmk-key",
"keyVersion": "00000000000000000000000000000000"
},
"rotationToLatestKeyVersionEnabled": true
}
}
}
},
"location": "westus",
"tags": {
"mytag1": "myvalue1"
}
}
import com.azure.resourcemanager.databricks.models.EncryptionEntitiesDefinition;
import com.azure.resourcemanager.databricks.models.EncryptionKeySource;
import com.azure.resourcemanager.databricks.models.ManagedDiskEncryption;
import com.azure.resourcemanager.databricks.models.ManagedDiskEncryptionKeyVaultProperties;
import com.azure.resourcemanager.databricks.models.WorkspacePropertiesEncryption;
import java.util.HashMap;
import java.util.Map;
/** Samples for Workspaces CreateOrUpdate. */
public final class Main {
/*
* x-ms-original-file: specification/databricks/resource-manager/Microsoft.Databricks/stable/2023-02-01/examples/WorkspaceManagedDiskEncryptionUpdate.json
*/
/**
* Sample code: Update a workspace with Customer-Managed Key (CMK) encryption for Managed Disks.
*
* @param manager Entry point to AzureDatabricksManager.
*/
public static void updateAWorkspaceWithCustomerManagedKeyCMKEncryptionForManagedDisks(
com.azure.resourcemanager.databricks.AzureDatabricksManager manager) {
manager
.workspaces()
.define("myWorkspace")
.withRegion("westus")
.withExistingResourceGroup("rg")
.withManagedResourceGroupId("/subscriptions/subid/resourceGroups/myManagedRG")
.withTags(mapOf("mytag1", "myvalue1"))
.withEncryption(
new WorkspacePropertiesEncryption()
.withEntities(
new EncryptionEntitiesDefinition()
.withManagedDisk(
new ManagedDiskEncryption()
.withKeySource(EncryptionKeySource.MICROSOFT_KEYVAULT)
.withKeyVaultProperties(
new ManagedDiskEncryptionKeyVaultProperties()
.withKeyVaultUri("fakeTokenPlaceholder")
.withKeyName("fakeTokenPlaceholder")
.withKeyVersion("fakeTokenPlaceholder"))
.withRotationToLatestKeyVersionEnabled(true))))
.create();
}
@SuppressWarnings("unchecked")
private static <T> Map<String, T> mapOf(Object... inputs) {
Map<String, T> map = new HashMap<>();
for (int i = 0; i < inputs.length; i += 2) {
String key = (String) inputs[i];
T value = (T) inputs[i + 1];
map.put(key, value);
}
return map;
}
}
To use the Azure SDK library in your project, see this documentation. To provide feedback on this code sample, open a GitHub issue
from azure.identity import DefaultAzureCredential
from azure.mgmt.databricks import AzureDatabricksManagementClient
"""
# PREREQUISITES
pip install azure-identity
pip install azure-mgmt-databricks
# USAGE
python workspace_managed_disk_encryption_update.py
Before run the sample, please set the values of the client ID, tenant ID and client secret
of the AAD application as environment variables: AZURE_CLIENT_ID, AZURE_TENANT_ID,
AZURE_CLIENT_SECRET. For more info about how to get the value, please see:
https://docs.microsoft.com/azure/active-directory/develop/howto-create-service-principal-portal
"""
def main():
client = AzureDatabricksManagementClient(
credential=DefaultAzureCredential(),
subscription_id="subid",
)
response = client.workspaces.begin_create_or_update(
resource_group_name="rg",
workspace_name="myWorkspace",
parameters={
"location": "westus",
"properties": {
"encryption": {
"entities": {
"managedDisk": {
"keySource": "Microsoft.Keyvault",
"keyVaultProperties": {
"keyName": "test-cmk-key",
"keyVaultUri": "https://test-vault-name.vault.azure.net/",
"keyVersion": "00000000000000000000000000000000",
},
"rotationToLatestKeyVersionEnabled": True,
}
}
},
"managedResourceGroupId": "/subscriptions/subid/resourceGroups/myManagedRG",
},
"tags": {"mytag1": "myvalue1"},
},
).result()
print(response)
# x-ms-original-file: specification/databricks/resource-manager/Microsoft.Databricks/stable/2023-02-01/examples/WorkspaceManagedDiskEncryptionUpdate.json
if __name__ == "__main__":
main()
To use the Azure SDK library in your project, see this documentation. To provide feedback on this code sample, open a GitHub issue
package armdatabricks_test
import (
"context"
"log"
"github.com/Azure/azure-sdk-for-go/sdk/azcore/to"
"github.com/Azure/azure-sdk-for-go/sdk/azidentity"
"github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/databricks/armdatabricks"
)
// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/e1a87e1a5deb3f986ea1474d233d6680f1e19fc1/specification/databricks/resource-manager/Microsoft.Databricks/stable/2023-02-01/examples/WorkspaceManagedDiskEncryptionUpdate.json
func ExampleWorkspacesClient_BeginCreateOrUpdate_updateAWorkspaceWithCustomerManagedKeyCmkEncryptionForManagedDisks() {
cred, err := azidentity.NewDefaultAzureCredential(nil)
if err != nil {
log.Fatalf("failed to obtain a credential: %v", err)
}
ctx := context.Background()
clientFactory, err := armdatabricks.NewClientFactory("<subscription-id>", cred, nil)
if err != nil {
log.Fatalf("failed to create client: %v", err)
}
poller, err := clientFactory.NewWorkspacesClient().BeginCreateOrUpdate(ctx, "rg", "myWorkspace", armdatabricks.Workspace{
Location: to.Ptr("westus"),
Tags: map[string]*string{
"mytag1": to.Ptr("myvalue1"),
},
Properties: &armdatabricks.WorkspaceProperties{
Encryption: &armdatabricks.WorkspacePropertiesEncryption{
Entities: &armdatabricks.EncryptionEntitiesDefinition{
ManagedDisk: &armdatabricks.ManagedDiskEncryption{
KeySource: to.Ptr(armdatabricks.EncryptionKeySourceMicrosoftKeyvault),
KeyVaultProperties: &armdatabricks.ManagedDiskEncryptionKeyVaultProperties{
KeyName: to.Ptr("test-cmk-key"),
KeyVaultURI: to.Ptr("https://test-vault-name.vault.azure.net/"),
KeyVersion: to.Ptr("00000000000000000000000000000000"),
},
RotationToLatestKeyVersionEnabled: to.Ptr(true),
},
},
},
ManagedResourceGroupID: to.Ptr("/subscriptions/subid/resourceGroups/myManagedRG"),
},
}, nil)
if err != nil {
log.Fatalf("failed to finish the request: %v", err)
}
res, err := poller.PollUntilDone(ctx, nil)
if err != nil {
log.Fatalf("failed to pull the result: %v", err)
}
// You could use response here. We use blank identifier for just demo purposes.
_ = res
// If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes.
// res.Workspace = armdatabricks.Workspace{
// Type: to.Ptr("Microsoft.Databricks/workspaces"),
// ID: to.Ptr("/subscriptions/subid/resourceGroups/rg/providers/Microsoft.Databricks/workspaces/myWorkspace"),
// Location: to.Ptr("East US 2"),
// Tags: map[string]*string{
// "mytag1": to.Ptr("myvalue1"),
// },
// Properties: &armdatabricks.WorkspaceProperties{
// Authorizations: []*armdatabricks.WorkspaceProviderAuthorization{
// {
// PrincipalID: to.Ptr("00000000-0000-0000-0000-000000000000"),
// RoleDefinitionID: to.Ptr("11111111-1111-1111-1111-111111111111"),
// }},
// CreatedBy: &armdatabricks.CreatedBy{
// ApplicationID: to.Ptr("44444444-4444-4444-4444-444444444444"),
// Oid: to.Ptr("22222222-2222-2222-2222-222222222222"),
// Puid: to.Ptr("33333333"),
// },
// CreatedDateTime: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2020-02-20T00:10:29.285Z"); return t}()),
// DiskEncryptionSetID: to.Ptr("/subscriptions/subid/resourceGroups/myManagedRG/providers/Microsoft.Compute/diskEncryptionSets/myDiskEncryptionSet"),
// Encryption: &armdatabricks.WorkspacePropertiesEncryption{
// Entities: &armdatabricks.EncryptionEntitiesDefinition{
// ManagedDisk: &armdatabricks.ManagedDiskEncryption{
// KeySource: to.Ptr(armdatabricks.EncryptionKeySourceMicrosoftKeyvault),
// KeyVaultProperties: &armdatabricks.ManagedDiskEncryptionKeyVaultProperties{
// KeyName: to.Ptr("test-cmk-key"),
// KeyVaultURI: to.Ptr("https://test-vault-name.vault.azure.net/"),
// KeyVersion: to.Ptr("00000000000000000000000000000000"),
// },
// RotationToLatestKeyVersionEnabled: to.Ptr(true),
// },
// },
// },
// ManagedDiskIdentity: &armdatabricks.ManagedIdentityConfiguration{
// Type: to.Ptr("SystemAssigned"),
// PrincipalID: to.Ptr("22222222-2222-2222-2222-222222222222"),
// TenantID: to.Ptr("44444444-4444-4444-4444-444444444444"),
// },
// ManagedResourceGroupID: to.Ptr("/subscriptions/subid/resourceGroups/myManagedRG"),
// ProvisioningState: to.Ptr(armdatabricks.ProvisioningStateSucceeded),
// UIDefinitionURI: to.Ptr("https://path/to/workspaceCreateUiDefinition.json"),
// UpdatedBy: &armdatabricks.CreatedBy{
// ApplicationID: to.Ptr("44444444-4444-4444-4444-444444444444"),
// Oid: to.Ptr("22222222-2222-2222-2222-222222222222"),
// Puid: to.Ptr("33333333"),
// },
// WorkspaceID: to.Ptr("6666666666666666"),
// WorkspaceURL: to.Ptr("adb-6666666666666666.19.azuredatabricks.net"),
// },
// SKU: &armdatabricks.SKU{
// Name: to.Ptr("premium"),
// },
// }
}
To use the Azure SDK library in your project, see this documentation. To provide feedback on this code sample, open a GitHub issue
const { AzureDatabricksManagementClient } = require("@azure/arm-databricks");
const { DefaultAzureCredential } = require("@azure/identity");
/**
* This sample demonstrates how to Creates a new workspace.
*
* @summary Creates a new workspace.
* x-ms-original-file: specification/databricks/resource-manager/Microsoft.Databricks/stable/2023-02-01/examples/WorkspaceManagedDiskEncryptionUpdate.json
*/
async function updateAWorkspaceWithCustomerManagedKeyCmkEncryptionForManagedDisks() {
const subscriptionId = process.env["DATABRICKS_SUBSCRIPTION_ID"] || "subid";
const resourceGroupName = process.env["DATABRICKS_RESOURCE_GROUP"] || "rg";
const workspaceName = "myWorkspace";
const parameters = {
encryption: {
entities: {
managedDisk: {
keySource: "Microsoft.Keyvault",
keyVaultProperties: {
keyName: "test-cmk-key",
keyVaultUri: "https://test-vault-name.vault.azure.net/",
keyVersion: "00000000000000000000000000000000",
},
rotationToLatestKeyVersionEnabled: true,
},
},
},
location: "westus",
managedResourceGroupId: "/subscriptions/subid/resourceGroups/myManagedRG",
tags: { mytag1: "myvalue1" },
};
const credential = new DefaultAzureCredential();
const client = new AzureDatabricksManagementClient(credential, subscriptionId);
const result = await client.workspaces.beginCreateOrUpdateAndWait(
resourceGroupName,
workspaceName,
parameters
);
console.log(result);
}
To use the Azure SDK library in your project, see this documentation. To provide feedback on this code sample, open a GitHub issue
Sample Response
{
"id": "/subscriptions/subid/resourceGroups/rg/providers/Microsoft.Databricks/workspaces/myWorkspace",
"type": "Microsoft.Databricks/workspaces",
"location": "East US 2",
"tags": {
"mytag1": "myvalue1"
},
"sku": {
"name": "premium"
},
"properties": {
"managedResourceGroupId": "/subscriptions/subid/resourceGroups/myManagedRG",
"diskEncryptionSetId": "/subscriptions/subid/resourceGroups/myManagedRG/providers/Microsoft.Compute/diskEncryptionSets/myDiskEncryptionSet",
"encryption": {
"entities": {
"managedDisk": {
"keySource": "Microsoft.Keyvault",
"keyVaultProperties": {
"keyVaultUri": "https://test-vault-name.vault.azure.net/",
"keyName": "test-cmk-key",
"keyVersion": "00000000000000000000000000000000"
},
"rotationToLatestKeyVersionEnabled": true
}
}
},
"parameters": null,
"provisioningState": "Succeeded",
"uiDefinitionUri": "https://path/to/workspaceCreateUiDefinition.json",
"authorizations": [
{
"principalId": "00000000-0000-0000-0000-000000000000",
"roleDefinitionId": "11111111-1111-1111-1111-111111111111"
}
],
"createdBy": {
"oid": "22222222-2222-2222-2222-222222222222",
"puid": "33333333",
"applicationId": "44444444-4444-4444-4444-444444444444"
},
"updatedBy": {
"oid": "22222222-2222-2222-2222-222222222222",
"puid": "33333333",
"applicationId": "44444444-4444-4444-4444-444444444444"
},
"managedDiskIdentity": {
"principalId": "22222222-2222-2222-2222-222222222222",
"tenantId": "44444444-4444-4444-4444-444444444444",
"type": "SystemAssigned"
},
"createdDateTime": "2020-02-20T00:10:29.2858439Z",
"workspaceId": "6666666666666666",
"workspaceUrl": "adb-6666666666666666.19.azuredatabricks.net"
}
}
{
"id": "/subscriptions/subid/resourceGroups/rg/providers/Microsoft.Databricks/workspaces/myWorkspace",
"type": "Microsoft.Databricks/workspaces",
"location": "East US 2",
"tags": {
"mytag1": "myvalue1"
},
"sku": {
"name": "premium"
},
"properties": {
"managedResourceGroupId": "/subscriptions/subid/resourceGroups/myManagedRG",
"diskEncryptionSetId": "/subscriptions/subid/resourceGroups/myManagedRG/providers/Microsoft.Compute/diskEncryptionSets/myDiskEncryptionSet",
"encryption": {
"entities": {
"managedDisk": {
"keySource": "Microsoft.Keyvault",
"keyVaultProperties": {
"keyVaultUri": "https://test-vault-name.vault.azure.net/",
"keyName": "test-cmk-key",
"keyVersion": "00000000000000000000000000000000"
},
"rotationToLatestKeyVersionEnabled": true
}
}
},
"parameters": null,
"provisioningState": "Succeeded",
"uiDefinitionUri": "https://path/to/workspaceCreateUiDefinition.json",
"authorizations": [
{
"principalId": "00000000-0000-0000-0000-000000000000",
"roleDefinitionId": "11111111-1111-1111-1111-111111111111"
}
],
"createdBy": {
"oid": "22222222-2222-2222-2222-222222222222",
"puid": "33333333",
"applicationId": "44444444-4444-4444-4444-444444444444"
},
"updatedBy": {
"oid": "22222222-2222-2222-2222-222222222222",
"puid": "33333333",
"applicationId": "44444444-4444-4444-4444-444444444444"
},
"managedDiskIdentity": {
"principalId": "22222222-2222-2222-2222-222222222222",
"tenantId": "44444444-4444-4444-4444-444444444444",
"type": "SystemAssigned"
},
"createdDateTime": "2020-02-20T00:10:29.2858439Z",
"workspaceId": "6666666666666666",
"workspaceUrl": "adb-6666666666666666.19.azuredatabricks.net"
}
}
Definitions
CreatedBy
Provides details of the entity that created/updated the workspace.
Name |
Type |
Description |
applicationId
|
string
|
The application ID of the application that initiated the creation of the workspace. For example, Azure Portal.
|
oid
|
string
|
The Object ID that created the workspace.
|
puid
|
string
|
The Personal Object ID corresponding to the object ID above
|
createdByType
The type of identity that created the resource.
Name |
Type |
Description |
Application
|
string
|
|
Key
|
string
|
|
ManagedIdentity
|
string
|
|
User
|
string
|
|
CustomParameterType
The type of variable that this is
Name |
Type |
Description |
Bool
|
string
|
|
Object
|
string
|
|
String
|
string
|
|
Encryption
The object that contains details of encryption used on the workspace.
Name |
Type |
Default Value |
Description |
KeyName
|
string
|
|
The name of KeyVault key.
|
keySource
|
KeySource
|
Default
|
The encryption keySource (provider). Possible values (case-insensitive): Default, Microsoft.Keyvault
|
keyvaulturi
|
string
|
|
The Uri of KeyVault.
|
keyversion
|
string
|
|
The version of KeyVault key.
|
EncryptionEntitiesDefinition
Encryption entities for databricks workspace resource.
Name |
Type |
Description |
managedDisk
|
ManagedDiskEncryption
|
Encryption properties for the databricks managed disks.
|
managedServices
|
EncryptionV2
|
Encryption properties for the databricks managed services.
|
EncryptionKeySource
The encryption keySource (provider). Possible values (case-insensitive): Microsoft.Keyvault
Name |
Type |
Description |
Microsoft.Keyvault
|
string
|
|
EncryptionV2
The object that contains details of encryption used on the workspace.
Name |
Type |
Description |
keySource
|
EncryptionKeySource
|
The encryption keySource (provider). Possible values (case-insensitive): Microsoft.Keyvault
|
keyVaultProperties
|
KeyVaultProperties
|
Key Vault input properties for encryption.
|
ErrorDetail
Error details.
Name |
Type |
Description |
code
|
string
|
The error's code.
|
message
|
string
|
A human readable error message.
|
target
|
string
|
Indicates which property in the request is responsible for the error.
|
ErrorInfo
The code and message for an error.
Name |
Type |
Description |
code
|
string
|
A machine readable error code.
|
details
|
ErrorDetail[]
|
error details.
|
innererror
|
string
|
Inner error details if they exist.
|
message
|
string
|
A human readable error message.
|
ErrorResponse
Error response.
Name |
Type |
Description |
error
|
ErrorInfo
|
The code and message for an error.
The error details.
|
KeySource
The encryption keySource (provider). Possible values (case-insensitive): Default, Microsoft.Keyvault
Name |
Type |
Description |
Default
|
string
|
|
Microsoft.Keyvault
|
string
|
|
KeyVaultProperties
Key Vault input properties for encryption.
Name |
Type |
Description |
keyName
|
string
|
The name of KeyVault key.
|
keyVaultUri
|
string
|
The Uri of KeyVault.
|
keyVersion
|
string
|
The version of KeyVault key.
|
ManagedDiskEncryption
The object that contains details of encryption used on the workspace.
Name |
Type |
Description |
keySource
|
EncryptionKeySource
|
The encryption keySource (provider). Possible values (case-insensitive): Microsoft.Keyvault
|
keyVaultProperties
|
KeyVaultProperties
|
Key Vault input properties for encryption.
|
rotationToLatestKeyVersionEnabled
|
boolean
|
Indicate whether the latest key version should be automatically used for Managed Disk Encryption.
|
ManagedIdentityConfiguration
The Managed Identity details for storage account.
Name |
Type |
Description |
principalId
|
string
|
The objectId of the Managed Identity that is linked to the Managed Storage account.
|
tenantId
|
string
|
The tenant Id where the Managed Identity is created.
|
type
|
string
|
The type of Identity created. It can be either SystemAssigned or UserAssigned.
|
PrivateEndpoint
The private endpoint property of a private endpoint connection
Name |
Type |
Description |
id
|
string
|
The resource identifier.
|
PrivateEndpointConnection
The private endpoint connection of a workspace
Name |
Type |
Description |
id
|
string
|
The resource identifier.
|
name
|
string
|
The resource name.
|
properties
|
PrivateEndpointConnectionProperties
|
The private endpoint connection properties.
|
type
|
string
|
The resource type.
|
PrivateEndpointConnectionProperties
The properties of a private endpoint connection
PrivateEndpointConnectionProvisioningState
The current provisioning state.
Name |
Type |
Description |
Creating
|
string
|
|
Deleting
|
string
|
|
Failed
|
string
|
|
Succeeded
|
string
|
|
Updating
|
string
|
|
PrivateLinkServiceConnectionState
The current state of a private endpoint connection
Name |
Type |
Description |
actionsRequired
|
string
|
Actions required for a private endpoint connection
|
description
|
string
|
The description for the current state of a private endpoint connection
|
status
|
PrivateLinkServiceConnectionStatus
|
The status of a private endpoint connection
|
PrivateLinkServiceConnectionStatus
The status of a private endpoint connection
Name |
Type |
Description |
Approved
|
string
|
|
Disconnected
|
string
|
|
Pending
|
string
|
|
Rejected
|
string
|
|
ProvisioningState
Provisioning status of the workspace.
Name |
Type |
Description |
Accepted
|
string
|
|
Canceled
|
string
|
|
Created
|
string
|
|
Creating
|
string
|
|
Deleted
|
string
|
|
Deleting
|
string
|
|
Failed
|
string
|
|
Ready
|
string
|
|
Running
|
string
|
|
Succeeded
|
string
|
|
Updating
|
string
|
|
PublicNetworkAccess
The network access type for accessing workspace. Set value to disabled to access workspace only via private link.
Name |
Type |
Description |
Disabled
|
string
|
|
Enabled
|
string
|
|
RequiredNsgRules
Gets or sets a value indicating whether data plane (clusters) to control plane communication happen over private endpoint. Supported values are 'AllRules' and 'NoAzureDatabricksRules'. 'NoAzureServiceRules' value is for internal use only.
Name |
Type |
Description |
AllRules
|
string
|
|
NoAzureDatabricksRules
|
string
|
|
NoAzureServiceRules
|
string
|
|
Sku
SKU for the resource.
Name |
Type |
Description |
name
|
string
|
The SKU name.
|
tier
|
string
|
The SKU tier.
|
systemData
Metadata pertaining to creation and last modification of the resource.
Name |
Type |
Description |
createdAt
|
string
|
The timestamp of resource creation (UTC).
|
createdBy
|
string
|
The identity that created the resource.
|
createdByType
|
createdByType
|
The type of identity that created the resource.
|
lastModifiedAt
|
string
|
The timestamp of resource last modification (UTC)
|
lastModifiedBy
|
string
|
The identity that last modified the resource.
|
lastModifiedByType
|
createdByType
|
The type of identity that last modified the resource.
|
Workspace
Information about workspace.
Name |
Type |
Description |
id
|
string
|
Fully qualified resource Id for the resource. Ex - /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}
|
location
|
string
|
The geo-location where the resource lives
|
name
|
string
|
The name of the resource
|
properties.authorizations
|
WorkspaceProviderAuthorization[]
|
The workspace provider authorizations.
|
properties.createdBy
|
CreatedBy
|
Indicates the Object ID, PUID and Application ID of entity that created the workspace.
|
properties.createdDateTime
|
string
|
Specifies the date and time when the workspace is created.
|
properties.diskEncryptionSetId
|
string
|
The resource Id of the managed disk encryption set.
|
properties.encryption
|
WorkspaceProperties.Encryption
|
Encryption properties for databricks workspace
|
properties.managedDiskIdentity
|
ManagedIdentityConfiguration
|
The details of Managed Identity of Disk Encryption Set used for Managed Disk Encryption
|
properties.managedResourceGroupId
|
string
|
The managed resource group Id.
|
properties.parameters
|
WorkspaceCustomParameters
|
The workspace's custom parameters.
|
properties.privateEndpointConnections
|
PrivateEndpointConnection[]
|
Private endpoint connections created on the workspace
|
properties.provisioningState
|
ProvisioningState
|
The workspace provisioning state.
|
properties.publicNetworkAccess
|
PublicNetworkAccess
|
The network access type for accessing workspace. Set value to disabled to access workspace only via private link.
|
properties.requiredNsgRules
|
RequiredNsgRules
|
Gets or sets a value indicating whether data plane (clusters) to control plane communication happen over private endpoint. Supported values are 'AllRules' and 'NoAzureDatabricksRules'. 'NoAzureServiceRules' value is for internal use only.
|
properties.storageAccountIdentity
|
ManagedIdentityConfiguration
|
The details of Managed Identity of Storage Account
|
properties.uiDefinitionUri
|
string
|
The blob URI where the UI definition file is located.
|
properties.updatedBy
|
CreatedBy
|
Indicates the Object ID, PUID and Application ID of entity that last updated the workspace.
|
properties.workspaceId
|
string
|
The unique identifier of the databricks workspace in databricks control plane.
|
properties.workspaceUrl
|
string
|
The workspace URL which is of the format 'adb-{workspaceId}.{random}.azuredatabricks.net'
|
sku
|
Sku
|
The SKU of the resource.
|
systemData
|
systemData
|
The system metadata relating to this resource
|
tags
|
object
|
Resource tags.
|
type
|
string
|
The type of the resource. Ex- Microsoft.Compute/virtualMachines or Microsoft.Storage/storageAccounts.
|
Workspace.WorkspaceProperties.Encryption
Encryption properties for databricks workspace
WorkspaceCustomBooleanParameter
The value which should be used for this field.
Name |
Type |
Description |
type
|
CustomParameterType
|
The type of variable that this is
|
value
|
boolean
|
The value which should be used for this field.
|
WorkspaceCustomObjectParameter
The value which should be used for this field.
Name |
Type |
Description |
type
|
CustomParameterType
|
The type of variable that this is
|
value
|
object
|
The value which should be used for this field.
|
WorkspaceCustomParameters
Custom Parameters used for Cluster Creation.
WorkspaceCustomStringParameter
The Value.
Name |
Type |
Description |
type
|
CustomParameterType
|
The type of variable that this is
|
value
|
string
|
The value which should be used for this field.
|
WorkspaceEncryptionParameter
The object that contains details of encryption used on the workspace.
WorkspaceProperties.Encryption
Encryption properties for databricks workspace
WorkspaceProviderAuthorization
The workspace provider authorization.
Name |
Type |
Description |
principalId
|
string
|
The provider's principal identifier. This is the identity that the provider will use to call ARM to manage the workspace resources.
|
roleDefinitionId
|
string
|
The provider's role definition identifier. This role will define all the permissions that the provider must have on the workspace's container resource group. This role definition cannot have permission to delete the resource group.
|